6 /*----------------------------------------------------------------------*\
8 \*---------------------------------------------------------------------*/
10 /*--------------------------------------*\
12 \*-------------------------------------*/
17 /*--------------------------------------*\
19 \*-------------------------------------*/
23 __device__
VagueMath(int w
, int h
)
25 this->factor
= 4 * PI
/ (float) w
;
28 __device__
VagueMath(const VagueMath
& source
)
33 /*--------------------------------------*\
35 \*-------------------------------------*/
44 void colorIJ(uchar4
* ptrColor
, int i
, int j
, float t
)
46 unsigned char levelGris
;
48 f(levelGris
, i
, j
, t
); // update levelGris
50 ptrColor
->x
= levelGris
;
51 ptrColor
->y
= levelGris
;
52 ptrColor
->z
= levelGris
;
54 ptrColor
->w
= 255; // opaque
60 void f(unsigned char& levelGris
, int i
, int j
, float t
)
63 //unsigned char levelGris= 255 * abs(sin(t)); // same color for all the image (Hello image)
66 levelGris
= 255 * fabs(sin(i
* factor
+ t
));
69 /*--------------------------------------*\
71 \*-------------------------------------*/
81 /*----------------------------------------------------------------------*\
83 \*---------------------------------------------------------------------*/