aboutsummaryrefslogtreecommitdiffstats
path: root/_test
diff options
context:
space:
mode:
Diffstat (limited to '_test')
-rw-r--r--_test/meowpp.h1
-rw-r--r--_test/meowpp_Colors.cpp24
2 files changed, 13 insertions, 12 deletions
diff --git a/_test/meowpp.h b/_test/meowpp.h
index 8052f1a..94ff3ec 100644
--- a/_test/meowpp.h
+++ b/_test/meowpp.h
@@ -6,6 +6,7 @@
#include "meowpp/Usage.h"
#include "meowpp/oo/Register_Implement.h"
+#include "meowpp/oo/Properties.h"
extern meow::Usage usg, usg2;
extern int count;
diff --git a/_test/meowpp_Colors.cpp b/_test/meowpp_Colors.cpp
index 59f612f..ac740e0 100644
--- a/_test/meowpp_Colors.cpp
+++ b/_test/meowpp_Colors.cpp
@@ -16,9 +16,9 @@ TEST(Colors){
eps = 1e-8;
meow::messagePrintf(1, "rgb ---> hsl ---> rgb ---> hsl (eps = %e)", eps);
for(int i = 0; ok && i < 100000; i++){
- rgb.r(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.rMin(), rgb.rMax()));
- rgb.g(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.gMin(), rgb.gMax()));
- rgb.b(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.bMin(), rgb.bMax()));
+ rgb.r(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.rMin(), rgb.rMax()));
+ rgb.g(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.gMin(), rgb.gMax()));
+ rgb.b(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.bMin(), rgb.bMax()));
meow::RGB_to_HSL(rgb , &hsl );
meow::HSL_to_RGB(hsl , &rgb2);
meow::RGB_to_HSL(rgb2, &hsl2);
@@ -35,9 +35,9 @@ TEST(Colors){
eps = 1e-8;
meow::messagePrintf(1, "rgb ---> hsv ---> rgb ---> hsv (eps = %e)", eps);
for(int i = 0; ok && i < 100000; i++){
- rgb.r(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.rMin(), rgb.rMax()));
- rgb.g(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.gMin(), rgb.gMax()));
- rgb.b(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.bMin(), rgb.bMax()));
+ rgb.r(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.rMin(), rgb.rMax()));
+ rgb.g(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.gMin(), rgb.gMax()));
+ rgb.b(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.bMin(), rgb.bMax()));
meow::RGB_to_HSV(rgb , &hsv );
meow::HSV_to_RGB(hsv , &rgb2);
meow::RGB_to_HSV(rgb2, &hsv2);
@@ -93,9 +93,9 @@ TEST(Colors){
eps = 1e-3;
meow::messagePrintf(1, "rgb ---> yuv ---> rgb ---> yuv (eps = %e)", eps);
for(int i = 0; ok && i < 100000; i++){
- rgb.r(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.rMin(), rgb.rMax()));
- rgb.g(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.gMin(), rgb.gMax()));
- rgb.b(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, rgb.bMin(), rgb.bMax()));
+ rgb.r(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.rMin(), rgb.rMax()));
+ rgb.g(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.gMin(), rgb.gMax()));
+ rgb.b(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, rgb.bMin(), rgb.bMax()));
meow::RGB_to_YUV(rgb , &yuv );
meow::YUV_to_RGB(yuv , &rgb2);
meow::RGB_to_YUV(rgb2, &yuv2);
@@ -111,9 +111,9 @@ TEST(Colors){
eps = 1e-8;
meow::messagePrintf(1, "hsl ---> hsv ---> hsl ---> hsv (eps = %e)", eps);
for(int i = 0; ok && i < 100000; i++){
- hsl.h(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, hsl.hMin(), hsl.hMax()));
- hsl.s(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, hsl.sMin(), hsl.sMax()));
- hsl.l(meow::ratioMapping(0, 1, 1.0 * rand() / RAND_MAX, hsl.lMin(), hsl.lMax()));
+ hsl.h(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, hsl.hMin(), hsl.hMax()));
+ hsl.s(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, hsl.sMin(), hsl.sMax()));
+ hsl.l(meow::ratioMapping(0.0, 1.0, 1.0 * rand() / RAND_MAX, hsl.lMin(), hsl.lMax()));
meow::HSL_to_HSV(hsl , &hsv );
meow::HSV_to_HSL(hsv , &hsl2);
meow::HSL_to_HSV(hsl2, &hsv2);