@@ -56,7 +56,7 @@ namespace agg
5656 static value_type luminance (const rgba& c)
5757 {
5858 // Calculate grayscale value as per ITU-R BT.709.
59- return value_type (uround ((0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b ) * base_mask));
59+ return value_type (uround ((0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b ) * double ( base_mask) ));
6060 }
6161
6262 static value_type luminance (const rgba8& c)
@@ -215,13 +215,13 @@ namespace agg
215215 // --------------------------------------------------------------------
216216 static AGG_INLINE double to_double (value_type a)
217217 {
218- return double (a) / base_mask;
218+ return double (a) / double ( base_mask) ;
219219 }
220220
221221 // --------------------------------------------------------------------
222222 static AGG_INLINE value_type from_double (double a)
223223 {
224- return value_type (uround (a * base_mask));
224+ return value_type (uround (a * double ( base_mask) ));
225225 }
226226
227227 // --------------------------------------------------------------------
@@ -375,7 +375,7 @@ namespace agg
375375 self_type gradient (self_type c, double k) const
376376 {
377377 self_type ret;
378- calc_type ik = uround (k * base_scale);
378+ calc_type ik = uround (k * double ( base_scale) );
379379 ret.v = lerp (v, c.v , ik);
380380 ret.a = lerp (a, c.a , ik);
381381 return ret;
@@ -436,7 +436,7 @@ namespace agg
436436 static value_type luminance (const rgba& c)
437437 {
438438 // Calculate grayscale value as per ITU-R BT.709.
439- return value_type (uround ((0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b ) * base_mask));
439+ return value_type (uround ((0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b ) * double ( base_mask) ));
440440 }
441441
442442 static value_type luminance (const rgba16& c)
@@ -544,13 +544,13 @@ namespace agg
544544 // --------------------------------------------------------------------
545545 static AGG_INLINE double to_double (value_type a)
546546 {
547- return double (a) / base_mask;
547+ return double (a) / double ( base_mask) ;
548548 }
549549
550550 // --------------------------------------------------------------------
551551 static AGG_INLINE value_type from_double (double a)
552552 {
553- return value_type (uround (a * base_mask));
553+ return value_type (uround (a * double ( base_mask) ));
554554 }
555555
556556 // --------------------------------------------------------------------
@@ -705,7 +705,7 @@ namespace agg
705705 self_type gradient (self_type c, double k) const
706706 {
707707 self_type ret;
708- calc_type ik = uround (k * base_scale);
708+ calc_type ik = uround (k * double ( base_scale) );
709709 ret.v = lerp (v, c.v , ik);
710710 ret.a = lerp (a, c.a , ik);
711711 return ret;
@@ -953,9 +953,9 @@ namespace agg
953953 }
954954
955955 // --------------------------------------------------------------------
956- static AGG_INLINE value_type mult_cover (value_type a, cover_type b)
956+ static AGG_INLINE value_type mult_cover (value_type a, cover_type b)
957957 {
958- return value_type (a * b / cover_mask);
958+ return value_type (a * b / float ( cover_mask) );
959959 }
960960
961961 // --------------------------------------------------------------------
0 commit comments