@@ -1252,8 +1252,8 @@ MagickExport MagickBooleanType DrawAffineImage(Image *image,
1252
1252
edge .y2 = image -> rows - 1.0 ;
1253
1253
GetMagickPixelPacket (image ,& zero );
1254
1254
exception = (& image -> exception );
1255
- start = CastDoubleToLong (ceil (edge .y1 - 0.5 ));
1256
- stop = CastDoubleToLong (floor (edge .y2 + 0.5 ));
1255
+ start = CastDoubleToSSizeT (ceil (edge .y1 - 0.5 ));
1256
+ stop = CastDoubleToSSizeT (floor (edge .y2 + 0.5 ));
1257
1257
source_view = AcquireVirtualCacheView (source ,exception );
1258
1258
image_view = AcquireAuthenticCacheView (image ,exception );
1259
1259
#if defined(MAGICKCORE_OPENMP_SUPPORT )
@@ -1291,17 +1291,17 @@ MagickExport MagickBooleanType DrawAffineImage(Image *image,
1291
1291
inverse_edge .x1 = 0.0 ;
1292
1292
if (inverse_edge .x2 > image -> columns - 1.0 )
1293
1293
inverse_edge .x2 = image -> columns - 1.0 ;
1294
- q = GetCacheViewAuthenticPixels (image_view ,CastDoubleToLong (
1295
- ceil (inverse_edge .x1 - 0.5 )),y ,(size_t ) CastDoubleToLong (floor (
1294
+ q = GetCacheViewAuthenticPixels (image_view ,CastDoubleToSSizeT (
1295
+ ceil (inverse_edge .x1 - 0.5 )),y ,(size_t ) CastDoubleToSSizeT (floor (
1296
1296
inverse_edge .x2 + 0.5 )- ceil (inverse_edge .x1 - 0.5 )+ 1 ),1 ,exception );
1297
1297
if (q == (PixelPacket * ) NULL )
1298
1298
continue ;
1299
1299
indexes = GetCacheViewAuthenticIndexQueue (image_view );
1300
1300
pixel = zero ;
1301
1301
composite = zero ;
1302
1302
x_offset = 0 ;
1303
- for (x = CastDoubleToLong (ceil (inverse_edge .x1 - 0.5 ));
1304
- x <= CastDoubleToLong (floor (inverse_edge .x2 + 0.5 )); x ++ )
1303
+ for (x = CastDoubleToSSizeT (ceil (inverse_edge .x1 - 0.5 ));
1304
+ x <= CastDoubleToSSizeT (floor (inverse_edge .x2 + 0.5 )); x ++ )
1305
1305
{
1306
1306
point .x = (double ) x * inverse_affine .sx + y * inverse_affine .ry +
1307
1307
inverse_affine .tx ;
@@ -2075,8 +2075,8 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image,
2075
2075
case UndefinedSpread :
2076
2076
case PadSpread :
2077
2077
{
2078
- if ((x != CastDoubleToLong (ceil (gradient_vector -> x1 - 0.5 ))) ||
2079
- (y != CastDoubleToLong (ceil (gradient_vector -> y1 - 0.5 ))))
2078
+ if ((x != CastDoubleToSSizeT (ceil (gradient_vector -> x1 - 0.5 ))) ||
2079
+ (y != CastDoubleToSSizeT (ceil (gradient_vector -> y1 - 0.5 ))))
2080
2080
{
2081
2081
offset = GetStopColorOffset (gradient ,x ,y );
2082
2082
if (gradient -> type != RadialGradient )
@@ -2103,8 +2103,8 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image,
2103
2103
}
2104
2104
case ReflectSpread :
2105
2105
{
2106
- if ((x != CastDoubleToLong (ceil (gradient_vector -> x1 - 0.5 ))) ||
2107
- (y != CastDoubleToLong (ceil (gradient_vector -> y1 - 0.5 ))))
2106
+ if ((x != CastDoubleToSSizeT (ceil (gradient_vector -> x1 - 0.5 ))) ||
2107
+ (y != CastDoubleToSSizeT (ceil (gradient_vector -> y1 - 0.5 ))))
2108
2108
{
2109
2109
offset = GetStopColorOffset (gradient ,x ,y );
2110
2110
if (gradient -> type != RadialGradient )
@@ -2145,8 +2145,8 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image,
2145
2145
2146
2146
antialias = MagickFalse ;
2147
2147
repeat = 0.0 ;
2148
- if ((x != CastDoubleToLong (ceil (gradient_vector -> x1 - 0.5 ))) ||
2149
- (y != CastDoubleToLong (ceil (gradient_vector -> y1 - 0.5 ))))
2148
+ if ((x != CastDoubleToSSizeT (ceil (gradient_vector -> x1 - 0.5 ))) ||
2149
+ (y != CastDoubleToSSizeT (ceil (gradient_vector -> y1 - 0.5 ))))
2150
2150
{
2151
2151
offset = GetStopColorOffset (gradient ,x ,y );
2152
2152
if (gradient -> type == LinearGradient )
@@ -3472,14 +3472,14 @@ static MagickBooleanType RenderMVGContent(Image *image,
3472
3472
(void ) GetNextToken (q ,& q ,extent ,token );
3473
3473
(void ) CopyMagickString (name ,token ,MaxTextExtent );
3474
3474
(void ) GetNextToken (q ,& q ,extent ,token );
3475
- bounds .x = CastDoubleToLong (ceil (GetDrawValue (token ,
3475
+ bounds .x = CastDoubleToSSizeT (ceil (GetDrawValue (token ,
3476
3476
& next_token )- 0.5 ));
3477
3477
if (token == next_token )
3478
3478
ThrowPointExpectedException (image ,token );
3479
3479
(void ) GetNextToken (q ,& q ,extent ,token );
3480
3480
if (* token == ',' )
3481
3481
(void ) GetNextToken (q ,& q ,extent ,token );
3482
- bounds .y = CastDoubleToLong (ceil (GetDrawValue (token ,
3482
+ bounds .y = CastDoubleToSSizeT (ceil (GetDrawValue (token ,
3483
3483
& next_token )- 0.5 ));
3484
3484
if (token == next_token )
3485
3485
ThrowPointExpectedException (image ,token );
@@ -3895,14 +3895,14 @@ static MagickBooleanType RenderMVGContent(Image *image,
3895
3895
if (LocaleCompare ("viewbox" ,keyword ) == 0 )
3896
3896
{
3897
3897
(void ) GetNextToken (q ,& q ,extent ,token );
3898
- graphic_context [n ]-> viewbox .x = CastDoubleToLong (ceil (
3898
+ graphic_context [n ]-> viewbox .x = CastDoubleToSSizeT (ceil (
3899
3899
GetDrawValue (token ,& next_token )- 0.5 ));
3900
3900
if (token == next_token )
3901
3901
ThrowPointExpectedException (image ,token );
3902
3902
(void ) GetNextToken (q ,& q ,extent ,token );
3903
3903
if (* token == ',' )
3904
3904
(void ) GetNextToken (q ,& q ,extent ,token );
3905
- graphic_context [n ]-> viewbox .y = CastDoubleToLong (ceil (
3905
+ graphic_context [n ]-> viewbox .y = CastDoubleToSSizeT (ceil (
3906
3906
GetDrawValue (token ,& next_token )- 0.5 ));
3907
3907
if (token == next_token )
3908
3908
ThrowPointExpectedException (image ,token );
@@ -4974,10 +4974,10 @@ static MagickBooleanType DrawPolygonPrimitive(Image *image,
4974
4974
(double ) image -> columns - 1.0 : bounds .x2 ;
4975
4975
bounds .y2 = bounds .y2 < 0.0 ? 0.0 : bounds .y2 >= (double ) image -> rows - 1.0 ?
4976
4976
(double ) image -> rows - 1.0 : bounds .y2 ;
4977
- poly_extent .x1 = CastDoubleToLong (ceil (bounds .x1 - 0.5 ));
4978
- poly_extent .y1 = CastDoubleToLong (ceil (bounds .y1 - 0.5 ));
4979
- poly_extent .x2 = CastDoubleToLong (floor (bounds .x2 + 0.5 ));
4980
- poly_extent .y2 = CastDoubleToLong (floor (bounds .y2 + 0.5 ));
4977
+ poly_extent .x1 = CastDoubleToSSizeT (ceil (bounds .x1 - 0.5 ));
4978
+ poly_extent .y1 = CastDoubleToSSizeT (ceil (bounds .y1 - 0.5 ));
4979
+ poly_extent .x2 = CastDoubleToSSizeT (floor (bounds .x2 + 0.5 ));
4980
+ poly_extent .y2 = CastDoubleToSSizeT (floor (bounds .y2 + 0.5 ));
4981
4981
number_threads = GetMagickNumberThreads (image ,image ,poly_extent .y2 -
4982
4982
poly_extent .y1 + 1 ,1 );
4983
4983
status = AcquirePolygonEdgesTLS (polygon_info ,number_threads ,& image -> exception );
@@ -5022,8 +5022,8 @@ static MagickBooleanType DrawPolygonPrimitive(Image *image,
5022
5022
}
5023
5023
for ( ; x <= poly_extent .x2 ; x ++ )
5024
5024
{
5025
- if ((x == CastDoubleToLong (ceil (primitive_info -> point .x - 0.5 ))) &&
5026
- (y == CastDoubleToLong (ceil (primitive_info -> point .y - 0.5 ))))
5025
+ if ((x == CastDoubleToSSizeT (ceil (primitive_info -> point .x - 0.5 ))) &&
5026
+ (y == CastDoubleToSSizeT (ceil (primitive_info -> point .y - 0.5 ))))
5027
5027
(void ) GetFillColor (draw_info ,x - poly_extent .x1 ,y - poly_extent .y1 ,q );
5028
5028
q ++ ;
5029
5029
}
@@ -5041,8 +5041,8 @@ static MagickBooleanType DrawPolygonPrimitive(Image *image,
5041
5041
/*
5042
5042
Draw polygon or line.
5043
5043
*/
5044
- poly_extent .y1 = CastDoubleToLong (ceil (bounds .y1 - 0.5 ));
5045
- poly_extent .y2 = CastDoubleToLong (floor (bounds .y2 + 0.5 ));
5044
+ poly_extent .y1 = CastDoubleToSSizeT (ceil (bounds .y1 - 0.5 ));
5045
+ poly_extent .y2 = CastDoubleToSSizeT (floor (bounds .y2 + 0.5 ));
5046
5046
#if defined(MAGICKCORE_OPENMP_SUPPORT )
5047
5047
#pragma omp parallel for schedule(static) shared(status) \
5048
5048
num_threads(number_threads)
@@ -5164,8 +5164,8 @@ static void LogPrimitiveInfo(const PrimitiveInfo *primitive_info)
5164
5164
coordinates ,
5165
5165
y ;
5166
5166
5167
- x = CastDoubleToLong (ceil (primitive_info -> point .x - 0.5 ));
5168
- y = CastDoubleToLong (ceil (primitive_info -> point .y - 0.5 ));
5167
+ x = CastDoubleToSSizeT (ceil (primitive_info -> point .x - 0.5 ));
5168
+ y = CastDoubleToSSizeT (ceil (primitive_info -> point .y - 0.5 ));
5169
5169
switch (primitive_info -> primitive )
5170
5170
{
5171
5171
case PointPrimitive :
@@ -5279,8 +5279,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
5279
5279
status &=SetImageClipMask (image ,draw_info -> clipping_mask );
5280
5280
status &=SetImageMask (image ,draw_info -> composite_mask );
5281
5281
}
5282
- x = CastDoubleToLong (ceil (primitive_info -> point .x - 0.5 ));
5283
- y = CastDoubleToLong (ceil (primitive_info -> point .y - 0.5 ));
5282
+ x = CastDoubleToSSizeT (ceil (primitive_info -> point .x - 0.5 ));
5283
+ y = CastDoubleToSSizeT (ceil (primitive_info -> point .y - 0.5 ));
5284
5284
image_view = AcquireAuthenticCacheView (image ,exception );
5285
5285
switch (primitive_info -> primitive )
5286
5286
{
@@ -5580,8 +5580,8 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
5580
5580
composite_images = DestroyImageList (composite_images );
5581
5581
(void ) SetImageProgressMonitor (composite_image ,(MagickProgressMonitor )
5582
5582
NULL ,(void * ) NULL );
5583
- x1 = CastDoubleToLong (ceil (primitive_info [1 ].point .x - 0.5 ));
5584
- y1 = CastDoubleToLong (ceil (primitive_info [1 ].point .y - 0.5 ));
5583
+ x1 = CastDoubleToSSizeT (ceil (primitive_info [1 ].point .x - 0.5 ));
5584
+ y1 = CastDoubleToSSizeT (ceil (primitive_info [1 ].point .y - 0.5 ));
5585
5585
if (((x1 != 0L ) && (x1 != (ssize_t ) composite_image -> columns )) ||
5586
5586
((y1 != 0L ) && (y1 != (ssize_t ) composite_image -> rows )))
5587
5587
{
@@ -6181,7 +6181,7 @@ static MagickBooleanType TraceArcPath(MVGInfo *mvg_info,const PointInfo start,
6181
6181
else
6182
6182
if ((theta > 0.0 ) && (sweep == MagickFalse ))
6183
6183
theta -= 2.0 * MagickPI ;
6184
- arc_segments = (size_t ) CastDoubleToLong (ceil (fabs ((double ) (theta /(0.5 *
6184
+ arc_segments = (size_t ) CastDoubleToSSizeT (ceil (fabs ((double ) (theta /(0.5 *
6185
6185
MagickPI + MagickEpsilon )))));
6186
6186
p = primitive_info ;
6187
6187
status = MagickTrue ;
@@ -7522,7 +7522,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info,
7522
7522
theta .q = atan2 (box_q [2 ].y - center .y ,box_q [2 ].x - center .x );
7523
7523
if (theta .q < theta .p )
7524
7524
theta .q += 2.0 * MagickPI ;
7525
- arc_segments = (size_t ) CastDoubleToLong (ceil ((double ) ((theta .q -
7525
+ arc_segments = (size_t ) CastDoubleToSSizeT (ceil ((double ) ((theta .q -
7526
7526
theta .p )/(2.0 * sqrt (PerceptibleReciprocal (mid ))))));
7527
7527
CheckPathExtent (MaxStrokePad ,arc_segments + MaxStrokePad );
7528
7528
stroke_q [q ].x = box_q [1 ].x ;
@@ -7595,7 +7595,7 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info,
7595
7595
theta .q = atan2 (box_p [2 ].y - center .y ,box_p [2 ].x - center .x );
7596
7596
if (theta .p < theta .q )
7597
7597
theta .p += 2.0 * MagickPI ;
7598
- arc_segments = (size_t ) CastDoubleToLong (ceil ((double ) ((theta .p -
7598
+ arc_segments = (size_t ) CastDoubleToSSizeT (ceil ((double ) ((theta .p -
7599
7599
theta .q )/(2.0 * sqrt ((double ) (PerceptibleReciprocal (mid )))))));
7600
7600
CheckPathExtent (arc_segments + MaxStrokePad ,MaxStrokePad );
7601
7601
stroke_p [p ++ ]= box_p [1 ];
0 commit comments