~ubuntu-branches/ubuntu/oneiric/imagemagick/oneiric-updates

« back to all changes in this revision

Viewing changes to wand/drawing-wand.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-06-15 11:05:28 UTC
  • mfrom: (6.2.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110615110528-08jgo07a4846xh8d
Tags: 8:6.6.0.4-3ubuntu1
* Resynchronise with Debian (LP: #797595).  Remaining changes:
  - Make ufraw-batch (universe) a suggestion instead of a recommendation.
  - Make debian/rules install target depend on check; they cannot reliably
    be run in parallel.
  - Don't set MAKEFLAGS in debian/rules; just pass it to the build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
struct _DrawingWand
91
91
{
92
 
  size_t
 
92
  unsigned long
93
93
    id;
94
94
 
95
95
  char
110
110
    mvg_alloc,          /* total allocated memory */
111
111
    mvg_length;         /* total MVG length */
112
112
 
113
 
  size_t
 
113
  unsigned long
114
114
    mvg_width;          /* current line width */
115
115
 
116
116
  /* Pattern support */
124
124
    pattern_offset;
125
125
 
126
126
  /* Graphic wand */
127
 
  size_t
 
127
  unsigned long
128
128
    index;              /* array index */
129
129
 
130
130
  DrawInfo
134
134
    filter_off;         /* true if not filtering attributes */
135
135
 
136
136
  /* Pretty-printing depth */
137
 
  size_t
 
137
  unsigned long
138
138
    indent_depth;       /* number of left-hand pad characters */
139
139
 
140
140
  /* Path operation support */
148
148
    destroy,
149
149
    debug;
150
150
 
151
 
  size_t
 
151
  unsigned long
152
152
    signature;
153
153
};
154
154
 
160
160
    const unsigned char *);
161
161
  void (*DrawArc)(DrawingWand *,const double,const double,const double,
162
162
    const double,const double,const double);
163
 
  void (*DrawBezier)(DrawingWand *,const size_t,const PointInfo *);
 
163
  void (*DrawBezier)(DrawingWand *,const unsigned long,const PointInfo *);
164
164
  void (*DrawCircle)(DrawingWand *,const double,const double,const double,
165
165
    const double);
166
166
  void (*DrawColor)(DrawingWand *,const double,const double,const PaintMethod);
206
206
  void (*DrawPathMoveToRelative)(DrawingWand *,const double,const double);
207
207
  void (*DrawPathStart)(DrawingWand *);
208
208
  void (*DrawPoint)(DrawingWand *,const double,const double);
209
 
  void (*DrawPolygon)(DrawingWand *,const size_t,const PointInfo *);
210
 
  void (*DrawPolyline)(DrawingWand *,const size_t,const PointInfo *);
 
209
  void (*DrawPolygon)(DrawingWand *,const unsigned long,const PointInfo *);
 
210
  void (*DrawPolyline)(DrawingWand *,const unsigned long,const PointInfo *);
211
211
  void (*DrawPopClipPath)(DrawingWand *);
212
212
  void (*DrawPopDefs)(DrawingWand *);
213
213
  MagickBooleanType (*DrawPopPattern)(DrawingWand *);
236
236
  void (*DrawSetFontSize)(DrawingWand *,const double);
237
237
  void (*DrawSetFontStretch)(DrawingWand *,const StretchType);
238
238
  void (*DrawSetFontStyle)(DrawingWand *,const StyleType);
239
 
  void (*DrawSetFontWeight)(DrawingWand *,const size_t);
 
239
  void (*DrawSetFontWeight)(DrawingWand *,const unsigned long);
240
240
  void (*DrawSetGravity)(DrawingWand *,const GravityType);
241
241
  void (*DrawRotate)(DrawingWand *,const double);
242
242
  void (*DrawScale)(DrawingWand *,const double,const double);
248
248
  void (*DrawSetStrokeDashOffset)(DrawingWand *,const double);
249
249
  void (*DrawSetStrokeLineCap)(DrawingWand *,const LineCap);
250
250
  void (*DrawSetStrokeLineJoin)(DrawingWand *,const LineJoin);
251
 
  void (*DrawSetStrokeMiterLimit)(DrawingWand *,const size_t);
 
251
  void (*DrawSetStrokeMiterLimit)(DrawingWand *,const unsigned long);
252
252
  MagickBooleanType (*DrawSetStrokePatternURL)(DrawingWand *,const char *);
253
253
  void (*DrawSetStrokeWidth)(DrawingWand *,const double);
254
254
  void (*DrawSetTextAntialias)(DrawingWand *,const MagickBooleanType);
255
255
  void (*DrawSetTextDecoration)(DrawingWand *,const DecorationType);
256
256
  void (*DrawSetTextUnderColor)(DrawingWand *,const PixelWand *);
257
257
  void (*DrawTranslate)(DrawingWand *,const double,const double);
258
 
  void (*DrawSetViewbox)(DrawingWand *,size_t,size_t,
259
 
    size_t,size_t);
 
258
  void (*DrawSetViewbox)(DrawingWand *,unsigned long,unsigned long,
 
259
    unsigned long,unsigned long);
260
260
  void (*PeekDrawingWand)(DrawingWand *);
261
261
  MagickBooleanType (*PopDrawingWand)(DrawingWand *);
262
262
  MagickBooleanType (*PushDrawingWand)(DrawingWand *);
411
411
}
412
412
 
413
413
static void MvgAppendPointsCommand(DrawingWand *wand,const char *command,
414
 
  const size_t number_coordinates,const PointInfo *coordinates)
 
414
  const unsigned long number_coordinates,const PointInfo *coordinates)
415
415
{
416
416
  const PointInfo
417
417
    *coordinate;
418
418
 
419
 
  size_t
 
419
  unsigned long
420
420
    i;
421
421
 
422
422
  (void) MvgPrintf(wand,"%s",command);
549
549
  DrawingWand
550
550
    *clone_wand;
551
551
 
552
 
  register ssize_t
 
552
  register long
553
553
    i;
554
554
 
555
555
  assert(wand != (DrawingWand *) NULL);
562
562
      "MemoryAllocationFailed",GetExceptionMessage(errno));
563
563
  (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
564
564
  clone_wand->id=AcquireWandId();
565
 
  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"DrawingWand-%.20g",
566
 
    (double) clone_wand->id);
 
565
  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"DrawingWand-%lu",
 
566
    clone_wand->id);
567
567
  clone_wand->exception=AcquireExceptionInfo();
568
568
  InheritException(clone_wand->exception,wand->exception);
569
569
  clone_wand->mvg=AcquireString(wand->mvg);
579
579
  if (clone_wand->graphic_context == (DrawInfo **) NULL)
580
580
    ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
581
581
      GetExceptionMessage(errno));
582
 
  for (i=0; i <= (ssize_t) wand->index; i++)
 
582
  for (i=0; i <= (long) wand->index; i++)
583
583
    clone_wand->graphic_context[i]=
584
584
      CloneDrawInfo((ImageInfo *) NULL,wand->graphic_context[i]);
585
585
  clone_wand->filter_off=wand->filter_off;
837
837
%  The format of the DrawBezier method is:
838
838
%
839
839
%      void DrawBezier(DrawingWand *wand,
840
 
%        const size_t number_coordinates,const PointInfo *coordinates)
 
840
%        const unsigned long number_coordinates,const PointInfo *coordinates)
841
841
%
842
842
%  A description of each parameter follows:
843
843
%
849
849
%
850
850
*/
851
851
WandExport void DrawBezier(DrawingWand *wand,
852
 
  const size_t number_coordinates,const PointInfo *coordinates)
 
852
  const unsigned long number_coordinates,const PointInfo *coordinates)
853
853
{
854
854
  assert(wand != (DrawingWand *) NULL);
855
855
  assert(wand->signature == WandSignature);
995
995
  register char
996
996
    *p;
997
997
 
998
 
  register ssize_t
 
998
  register long
999
999
    i;
1000
1000
 
1001
1001
  size_t
1033
1033
      char
1034
1034
        buffer[MaxTextExtent];
1035
1035
 
1036
 
      (void) FormatMagickString(buffer,MaxTextExtent,"%.20g bytes",(double)
 
1036
      (void) FormatMagickString(buffer,MaxTextExtent,"%ld bytes",
1037
1037
        (4L*blob_length/3L+4L));
1038
1038
      ThrowDrawException(ResourceLimitWarning,"MemoryAllocationFailed",
1039
1039
        wand->name);
1040
1040
      return(MagickFalse);
1041
1041
    }
1042
 
  mode=MagickOptionToMnemonic(MagickComposeOptions,(ssize_t) compose);
 
1042
  mode=MagickOptionToMnemonic(MagickComposeOptions,(long) compose);
1043
1043
  media_type=MagickToMime(image->magick);
1044
1044
  (void) MvgPrintf(wand,"image %s %g,%g %g,%g 'data:%s;base64,\n",
1045
1045
    mode,x,y,width,height,media_type);
1046
1046
  p=base64;
1047
 
  for (i=(ssize_t) encoded_length; i > 0; i-=76)
 
1047
  for (i=(long) encoded_length; i > 0; i-=76)
1048
1048
  {
1049
1049
    (void) MvgPrintf(wand,"%.76s",p);
1050
1050
    p+=76;
1101
1101
  if (wand->debug != MagickFalse)
1102
1102
    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1103
1103
  (void) MvgPrintf(wand,"color %g,%g '%s'\n",x,y,MagickOptionToMnemonic(
1104
 
    MagickMethodOptions,(ssize_t) paint_method));
 
1104
    MagickMethodOptions,(long) paint_method));
1105
1105
}
1106
1106
 
1107
1107
/*
1228
1228
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1229
1229
%
1230
1230
%  DrawGetClipPath() obtains the current clipping path ID. The value returned
1231
 
%  must be deallocated by the user when it is no ssize_ter needed.
 
1231
%  must be deallocated by the user when it is no longer needed.
1232
1232
%
1233
1233
%  The format of the DrawGetClipPath method is:
1234
1234
%
1519
1519
%
1520
1520
%  DrawGetFont() returns a null-terminaged string specifying the font used
1521
1521
%  when annotating with text. The value returned must be freed by the user
1522
 
%  when no ssize_ter needed.
 
1522
%  when no longer needed.
1523
1523
%
1524
1524
%  The format of the DrawGetFont method is:
1525
1525
%
1553
1553
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1554
1554
%
1555
1555
%  DrawGetFontFamily() returns the font family to use when annotating with text.
1556
 
%  The value returned must be freed by the user when it is no ssize_ter needed.
 
1556
%  The value returned must be freed by the user when it is no longer needed.
1557
1557
%
1558
1558
%  The format of the DrawGetFontFamily method is:
1559
1559
%
1683
1683
%
1684
1684
%  The format of the DrawGetFontWeight method is:
1685
1685
%
1686
 
%      size_t DrawGetFontWeight(const DrawingWand *wand)
 
1686
%      unsigned long DrawGetFontWeight(const DrawingWand *wand)
1687
1687
%
1688
1688
%  A description of each parameter follows:
1689
1689
%
1690
1690
%    o wand: the drawing wand.
1691
1691
%
1692
1692
*/
1693
 
WandExport size_t DrawGetFontWeight(const DrawingWand *wand)
 
1693
WandExport unsigned long DrawGetFontWeight(const DrawingWand *wand)
1694
1694
{
1695
1695
  assert(wand != (const DrawingWand *) NULL);
1696
1696
  assert(wand->signature == WandSignature);
1850
1850
%
1851
1851
%  DrawGetStrokeDashArray() returns an array representing the pattern of
1852
1852
%  dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The
1853
 
%  array must be freed once it is no ssize_ter required by the user.
 
1853
%  array must be freed once it is no longer required by the user.
1854
1854
%
1855
1855
%  The format of the DrawGetStrokeDashArray method is:
1856
1856
%
1857
1857
%      double *DrawGetStrokeDashArray(const DrawingWand *wand,
1858
 
%        size_t *number_elements)
 
1858
%        unsigned long *number_elements)
1859
1859
%
1860
1860
%  A description of each parameter follows:
1861
1861
%
1865
1865
%
1866
1866
*/
1867
1867
WandExport double *DrawGetStrokeDashArray(const DrawingWand *wand,
1868
 
  size_t *number_elements)
 
1868
  unsigned long *number_elements)
1869
1869
{
1870
1870
  double
1871
1871
    *dash_array;
1876
1876
  register double
1877
1877
    *q;
1878
1878
 
1879
 
  register ssize_t
 
1879
  register long
1880
1880
    i;
1881
1881
 
1882
 
  size_t
 
1882
  unsigned long
1883
1883
    n;
1884
1884
 
1885
1885
  assert(wand != (const DrawingWand *) NULL);
1886
1886
  assert(wand->signature == WandSignature);
1887
1887
  if (wand->debug != MagickFalse)
1888
1888
    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1889
 
  assert(number_elements != (size_t *) NULL);
 
1889
  assert(number_elements != (unsigned long *) NULL);
1890
1890
  n=0;
1891
1891
  p=CurrentContext->dash_pattern;
1892
1892
  if (p != (const double *) NULL)
1900
1900
        sizeof(*dash_array));
1901
1901
      p=CurrentContext->dash_pattern;
1902
1902
      q=dash_array;
1903
 
      for (i=0; i < (ssize_t) n; i++)
 
1903
      for (i=0; i < (long) n; i++)
1904
1904
        *q++=(*p++);
1905
1905
    }
1906
1906
  return(dash_array);
2024
2024
%
2025
2025
%  The format of the DrawGetStrokeMiterLimit method is:
2026
2026
%
2027
 
%      size_t DrawGetStrokeMiterLimit(const DrawingWand *wand)
 
2027
%      unsigned long DrawGetStrokeMiterLimit(const DrawingWand *wand)
2028
2028
%
2029
2029
%  A description of each parameter follows:
2030
2030
%
2031
2031
%    o wand: the drawing wand.
2032
2032
%
2033
2033
*/
2034
 
WandExport size_t DrawGetStrokeMiterLimit(const DrawingWand *wand)
 
2034
WandExport unsigned long DrawGetStrokeMiterLimit(const DrawingWand *wand)
2035
2035
{
2036
2036
  assert(wand != (const DrawingWand *) NULL);
2037
2037
  assert(wand->signature == WandSignature);
2216
2216
%
2217
2217
%  DrawGetTextEncoding() returns a null-terminated string which specifies the
2218
2218
%  code set used for text annotations. The string must be freed by the user
2219
 
%  once it is no ssize_ter required.
 
2219
%  once it is no longer required.
2220
2220
%
2221
2221
%  The format of the DrawGetTextEncoding method is:
2222
2222
%
2345
2345
%
2346
2346
%  DrawGetVectorGraphics() returns a null-terminated string which specifies the
2347
2347
%  vector graphics generated by any graphics calls made since the wand was
2348
 
%  instantiated.  The string must be freed by the user once it is no ssize_ter
 
2348
%  instantiated.  The string must be freed by the user once it is no longer
2349
2349
%  required.
2350
2350
%
2351
2351
%  The format of the DrawGetVectorGraphics method is:
2381
2381
  MagickPixelPacket
2382
2382
    pixel;
2383
2383
 
2384
 
  register ssize_t
 
2384
  register long
2385
2385
    i;
2386
2386
 
2387
2387
  XMLTreeInfo
2403
2403
  if (child != (XMLTreeInfo *) NULL)
2404
2404
    {
2405
2405
      (void) CopyMagickString(value,MagickOptionToMnemonic(
2406
 
        MagickClipPathOptions,(ssize_t) CurrentContext->clip_units),MaxTextExtent);
 
2406
        MagickClipPathOptions,(long) CurrentContext->clip_units),MaxTextExtent);
2407
2407
      (void) SetXMLTreeContent(child,value);
2408
2408
    }
2409
2409
  child=AddChildToXMLTree(xml_info,"decorate",0);
2410
2410
  if (child != (XMLTreeInfo *) NULL)
2411
2411
    {
2412
2412
      (void) CopyMagickString(value,MagickOptionToMnemonic(
2413
 
        MagickDecorateOptions,(ssize_t) CurrentContext->decorate),MaxTextExtent);
 
2413
        MagickDecorateOptions,(long) CurrentContext->decorate),MaxTextExtent);
2414
2414
      (void) SetXMLTreeContent(child,value);
2415
2415
    }
2416
2416
  child=AddChildToXMLTree(xml_info,"encoding",0);
2438
2438
  if (child != (XMLTreeInfo *) NULL)
2439
2439
    {
2440
2440
      (void) CopyMagickString(value,MagickOptionToMnemonic(
2441
 
        MagickFillRuleOptions,(ssize_t) CurrentContext->fill_rule),MaxTextExtent);
 
2441
        MagickFillRuleOptions,(long) CurrentContext->fill_rule),MaxTextExtent);
2442
2442
      (void) SetXMLTreeContent(child,value);
2443
2443
    }
2444
2444
  child=AddChildToXMLTree(xml_info,"font",0);
2458
2458
  if (child != (XMLTreeInfo *) NULL)
2459
2459
    {
2460
2460
      (void) CopyMagickString(value,MagickOptionToMnemonic(
2461
 
        MagickStretchOptions,(ssize_t) CurrentContext->stretch),MaxTextExtent);
 
2461
        MagickStretchOptions,(long) CurrentContext->stretch),MaxTextExtent);
2462
2462
      (void) SetXMLTreeContent(child,value);
2463
2463
    }
2464
2464
  child=AddChildToXMLTree(xml_info,"font-style",0);
2465
2465
  if (child != (XMLTreeInfo *) NULL)
2466
2466
    {
2467
2467
      (void) CopyMagickString(value,MagickOptionToMnemonic(
2468
 
        MagickStyleOptions,(ssize_t) CurrentContext->style),MaxTextExtent);
 
2468
        MagickStyleOptions,(long) CurrentContext->style),MaxTextExtent);
2469
2469
      (void) SetXMLTreeContent(child,value);
2470
2470
    }
2471
2471
  child=AddChildToXMLTree(xml_info,"font-weight",0);
2472
2472
  if (child != (XMLTreeInfo *) NULL)
2473
2473
    {
2474
 
      (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
 
2474
      (void) FormatMagickString(value,MaxTextExtent,"%lu",
2475
2475
        CurrentContext->weight);
2476
2476
      (void) SetXMLTreeContent(child,value);
2477
2477
    }
2479
2479
  if (child != (XMLTreeInfo *) NULL)
2480
2480
    {
2481
2481
      (void) CopyMagickString(value,MagickOptionToMnemonic(MagickGravityOptions,
2482
 
        (ssize_t) CurrentContext->gravity),MaxTextExtent);
 
2482
        (long) CurrentContext->gravity),MaxTextExtent);
2483
2483
      (void) SetXMLTreeContent(child,value);
2484
2484
    }
2485
2485
  child=AddChildToXMLTree(xml_info,"stroke",0);
2530
2530
  if (child != (XMLTreeInfo *) NULL)
2531
2531
    {
2532
2532
      (void) CopyMagickString(value,MagickOptionToMnemonic(MagickLineCapOptions,
2533
 
        (ssize_t) CurrentContext->linecap),MaxTextExtent);
 
2533
        (long) CurrentContext->linecap),MaxTextExtent);
2534
2534
      (void) SetXMLTreeContent(child,value);
2535
2535
    }
2536
2536
  child=AddChildToXMLTree(xml_info,"stroke-linejoin",0);
2537
2537
  if (child != (XMLTreeInfo *) NULL)
2538
2538
    {
2539
2539
      (void) CopyMagickString(value,MagickOptionToMnemonic(
2540
 
        MagickLineJoinOptions,(ssize_t) CurrentContext->linejoin),
2541
 
        MaxTextExtent);
 
2540
        MagickLineJoinOptions,(long) CurrentContext->linejoin),MaxTextExtent);
2542
2541
      (void) SetXMLTreeContent(child,value);
2543
2542
    }
2544
2543
  child=AddChildToXMLTree(xml_info,"stroke-miterlimit",0);
2545
2544
  if (child != (XMLTreeInfo *) NULL)
2546
2545
    {
2547
 
      (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
 
2546
      (void) FormatMagickString(value,MaxTextExtent,"%lu",
2548
2547
        CurrentContext->miterlimit);
2549
2548
      (void) SetXMLTreeContent(child,value);
2550
2549
    }
2566
2565
  if (child != (XMLTreeInfo *) NULL)
2567
2566
    {
2568
2567
      (void) CopyMagickString(value,MagickOptionToMnemonic(MagickAlignOptions,
2569
 
        (ssize_t) CurrentContext->align),MaxTextExtent);
 
2568
        (long) CurrentContext->align),MaxTextExtent);
2570
2569
      (void) SetXMLTreeContent(child,value);
2571
2570
    }
2572
2571
  child=AddChildToXMLTree(xml_info,"text-antialias",0);
2721
2720
  if (wand->debug != MagickFalse)
2722
2721
    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2723
2722
  (void) MvgPrintf(wand,"matte %g,%g '%s'\n",x,y,MagickOptionToMnemonic(
2724
 
    MagickMethodOptions,(ssize_t) paint_method));
 
2723
    MagickMethodOptions,(long) paint_method));
2725
2724
}
2726
2725
 
2727
2726
/*
3860
3859
%  The format of the DrawPolygon method is:
3861
3860
%
3862
3861
%      void DrawPolygon(DrawingWand *wand,
3863
 
%        const size_t number_coordinates,const PointInfo *coordinates)
 
3862
%        const unsigned long number_coordinates,const PointInfo *coordinates)
3864
3863
%
3865
3864
%  A description of each parameter follows:
3866
3865
%
3872
3871
%
3873
3872
*/
3874
3873
WandExport void DrawPolygon(DrawingWand *wand,
3875
 
  const size_t number_coordinates,const PointInfo *coordinates)
 
3874
  const unsigned long number_coordinates,const PointInfo *coordinates)
3876
3875
{
3877
3876
  assert(wand != (DrawingWand *) NULL);
3878
3877
  assert(wand->signature == WandSignature);
3898
3897
%  The format of the DrawPolyline method is:
3899
3898
%
3900
3899
%      void DrawPolyline(DrawingWand *wand,
3901
 
%        const size_t number_coordinates,const PointInfo *coordinates)
 
3900
%        const unsigned long number_coordinates,const PointInfo *coordinates)
3902
3901
%
3903
3902
%  A description of each parameter follows:
3904
3903
%
3910
3909
%
3911
3910
*/
3912
3911
WandExport void DrawPolyline(DrawingWand *wand,
3913
 
  const size_t number_coordinates,const PointInfo *coordinates)
 
3912
  const unsigned long number_coordinates,const PointInfo *coordinates)
3914
3913
{
3915
3914
  assert(wand != (DrawingWand *) NULL);
3916
3915
  assert(wand->signature == WandSignature);
4027
4026
    }
4028
4027
  (void) FormatMagickString(key,MaxTextExtent,"%s",wand->pattern_id);
4029
4028
  (void) SetImageArtifact(wand->image,key,wand->mvg+wand->pattern_offset);
4030
 
  (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
4031
 
    (double) wand->pattern_bounds.width,(double) wand->pattern_bounds.height,
4032
 
    (double) wand->pattern_bounds.x,(double) wand->pattern_bounds.y);
 
4029
  (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
 
4030
    wand->pattern_bounds.width,wand->pattern_bounds.height,
 
4031
    wand->pattern_bounds.x,wand->pattern_bounds.y);
4033
4032
  (void) SetImageArtifact(wand->image,key,geometry);
4034
4033
  wand->pattern_id=DestroyString(wand->pattern_id);
4035
4034
  wand->pattern_offset=0;
4174
4173
    x,y,width,height);
4175
4174
  wand->indent_depth++;
4176
4175
  wand->pattern_id=AcquireString(pattern_id);
4177
 
  wand->pattern_bounds.x=(ssize_t) ceil(x-0.5);
4178
 
  wand->pattern_bounds.y=(ssize_t) ceil(y-0.5);
4179
 
  wand->pattern_bounds.width=(size_t) floor(width+0.5);
4180
 
  wand->pattern_bounds.height=(size_t) floor(height+0.5);
 
4176
  wand->pattern_bounds.x=(long) ceil(x-0.5);
 
4177
  wand->pattern_bounds.y=(long) ceil(y-0.5);
 
4178
  wand->pattern_bounds.width=(unsigned long) (width+0.5);
 
4179
  wand->pattern_bounds.height=(unsigned long) (height+0.5);
4181
4180
  wand->pattern_offset=wand->mvg_length;
4182
4181
  return(MagickTrue);
4183
4182
}
4510
4509
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4511
4510
%
4512
4511
%  DrawSetClipPath() associates a named clipping path with the image.  Only
4513
 
%  the areas drawn on by the clipping path will be modified as ssize_t as it
 
4512
%  the areas drawn on by the clipping path will be modified as long as it
4514
4513
%  remains in effect.
4515
4514
%
4516
4515
%  The format of the DrawSetClipPath method is:
4583
4582
    {
4584
4583
      CurrentContext->fill_rule=fill_rule;
4585
4584
      (void) MvgPrintf(wand, "clip-rule '%s'\n",MagickOptionToMnemonic(
4586
 
        MagickFillRuleOptions,(ssize_t) fill_rule));
 
4585
        MagickFillRuleOptions,(long) fill_rule));
4587
4586
    }
4588
4587
}
4589
4588
 
4637
4636
          AdjustAffine(wand,&affine);
4638
4637
        }
4639
4638
      (void) MvgPrintf(wand, "clip-units '%s'\n",MagickOptionToMnemonic(
4640
 
        MagickClipPathOptions,(ssize_t) clip_units));
 
4639
        MagickClipPathOptions,(long) clip_units));
4641
4640
    }
4642
4641
}
4643
4642
 
4771
4770
  if ((wand->filter_off != MagickFalse) ||
4772
4771
      (CurrentContext->opacity != quantum_opacity))
4773
4772
    {
4774
 
      CurrentContext->opacity=(Quantum) opacity;
 
4773
      CurrentContext->opacity=opacity;
4775
4774
      (void) MvgPrintf(wand,"opacity %g\n",opacity);
4776
4775
    }
4777
4776
}
4875
4874
    {
4876
4875
      CurrentContext->fill_rule=fill_rule;
4877
4876
      (void) MvgPrintf(wand, "fill-rule '%s'\n",MagickOptionToMnemonic(
4878
 
        MagickFillRuleOptions,(ssize_t) fill_rule));
 
4877
        MagickFillRuleOptions,(long) fill_rule));
4879
4878
    }
4880
4879
}
4881
4880
 
5044
5043
    {
5045
5044
      CurrentContext->stretch=font_stretch;
5046
5045
      (void) MvgPrintf(wand, "font-stretch '%s'\n",MagickOptionToMnemonic(
5047
 
        MagickStretchOptions,(ssize_t) font_stretch));
 
5046
        MagickStretchOptions,(long) font_stretch));
5048
5047
    }
5049
5048
}
5050
5049
 
5084
5083
    {
5085
5084
      CurrentContext->style=style;
5086
5085
      (void) MvgPrintf(wand, "font-style '%s'\n",MagickOptionToMnemonic(
5087
 
        MagickStyleOptions,(ssize_t) style));
 
5086
        MagickStyleOptions,(long) style));
5088
5087
    }
5089
5088
}
5090
5089
 
5104
5103
%  The format of the DrawSetFontWeight method is:
5105
5104
%
5106
5105
%      void DrawSetFontWeight(DrawingWand *wand,
5107
 
%        const size_t font_weight)
 
5106
%        const unsigned long font_weight)
5108
5107
%
5109
5108
%  A description of each parameter follows:
5110
5109
%
5114
5113
%
5115
5114
*/
5116
5115
WandExport void DrawSetFontWeight(DrawingWand *wand,
5117
 
  const size_t font_weight)
 
5116
  const unsigned long font_weight)
5118
5117
{
5119
5118
  assert(wand != (DrawingWand *) NULL);
5120
5119
  assert(wand->signature == WandSignature);
5124
5123
      (CurrentContext->weight != font_weight))
5125
5124
    {
5126
5125
      CurrentContext->weight=font_weight;
5127
 
      (void) MvgPrintf(wand,"font-weight %.20g\n",(double) font_weight);
 
5126
      (void) MvgPrintf(wand,"font-weight %lu\n",font_weight);
5128
5127
    }
5129
5128
}
5130
5129
 
5167
5166
    {
5168
5167
      CurrentContext->gravity=gravity;
5169
5168
      (void) MvgPrintf(wand,"gravity '%s'\n",MagickOptionToMnemonic(
5170
 
        MagickGravityOptions,(ssize_t) gravity));
 
5169
        MagickGravityOptions,(long) gravity));
5171
5170
    }
5172
5171
}
5173
5172
 
5346
5345
%  The format of the DrawSetStrokeDashArray method is:
5347
5346
%
5348
5347
%      MagickBooleanType DrawSetStrokeDashArray(DrawingWand *wand,
5349
 
%        const size_t number_elements,const double *dash_array)
 
5348
%        const unsigned long number_elements,const double *dash_array)
5350
5349
%
5351
5350
%  A description of each parameter follows:
5352
5351
%
5358
5357
%
5359
5358
*/
5360
5359
WandExport MagickBooleanType DrawSetStrokeDashArray(DrawingWand *wand,
5361
 
  const size_t number_elements,const double *dash_array)
 
5360
  const unsigned long number_elements,const double *dash_array)
5362
5361
{
5363
5362
  MagickBooleanType
5364
5363
    update;
5369
5368
  register double
5370
5369
    *q;
5371
5370
 
5372
 
  register ssize_t
 
5371
  register long
5373
5372
    i;
5374
5373
 
5375
 
  size_t
 
5374
  unsigned long
5376
5375
    n_new,
5377
5376
    n_old;
5378
5377
 
5398
5397
        {
5399
5398
          p=dash_array;
5400
5399
          q=CurrentContext->dash_pattern;
5401
 
          for (i=0; i < (ssize_t) n_new; i++)
 
5400
          for (i=0; i < (long) n_new; i++)
5402
5401
          {
5403
5402
            if (fabs((*p)-(*q)) > MagickEpsilon)
5404
5403
              {
5426
5425
            }
5427
5426
          q=CurrentContext->dash_pattern;
5428
5427
          p=dash_array;
5429
 
          for (i=0; i < (ssize_t) n_new; i++)
 
5428
          for (i=0; i < (long) n_new; i++)
5430
5429
            *q++=(*p++);
5431
5430
          *q=0;
5432
5431
        }
5437
5436
        {
5438
5437
          p=dash_array;
5439
5438
          (void) MvgPrintf(wand,"%g",*p++);
5440
 
          for (i=1; i < (ssize_t) n_new; i++)
 
5439
          for (i=1; i < (long) n_new; i++)
5441
5440
            (void) MvgPrintf(wand,",%g",*p++);
5442
5441
          (void) MvgPrintf(wand,"\n");
5443
5442
        }
5524
5523
    {
5525
5524
      CurrentContext->linecap=linecap;
5526
5525
      (void) MvgPrintf(wand,"stroke-linecap '%s'\n",MagickOptionToMnemonic(
5527
 
        MagickLineCapOptions,(ssize_t) linecap));
 
5526
        MagickLineCapOptions,(long) linecap));
5528
5527
    }
5529
5528
}
5530
5529
 
5566
5565
    {
5567
5566
      CurrentContext->linejoin=linejoin;
5568
5567
      (void) MvgPrintf(wand, "stroke-linejoin '%s'\n",MagickOptionToMnemonic(
5569
 
        MagickLineJoinOptions,(ssize_t) linejoin));
 
5568
        MagickLineJoinOptions,(long) linejoin));
5570
5569
    }
5571
5570
}
5572
5571
 
5590
5589
%  The format of the DrawSetStrokeMiterLimit method is:
5591
5590
%
5592
5591
%      void DrawSetStrokeMiterLimit(DrawingWand *wand,
5593
 
%        const size_t miterlimit)
 
5592
%        const unsigned long miterlimit)
5594
5593
%
5595
5594
%  A description of each parameter follows:
5596
5595
%
5600
5599
%
5601
5600
*/
5602
5601
WandExport void DrawSetStrokeMiterLimit(DrawingWand *wand,
5603
 
  const size_t miterlimit)
 
5602
  const unsigned long miterlimit)
5604
5603
{
5605
5604
  assert(wand != (DrawingWand *) NULL);
5606
5605
  assert(wand->signature == WandSignature);
5609
5608
  if (CurrentContext->miterlimit != miterlimit)
5610
5609
    {
5611
5610
      CurrentContext->miterlimit=miterlimit;
5612
 
      (void) MvgPrintf(wand,"stroke-miterlimit %.20g\n",(double) miterlimit);
 
5611
      (void) MvgPrintf(wand,"stroke-miterlimit %lu\n",miterlimit);
5613
5612
    }
5614
5613
}
5615
5614
 
5735
5734
    {
5736
5735
      CurrentContext->align=alignment;
5737
5736
      (void) MvgPrintf(wand,"text-align '%s'\n",MagickOptionToMnemonic(
5738
 
        MagickAlignOptions,(ssize_t) alignment));
 
5737
        MagickAlignOptions,(long) alignment));
5739
5738
    }
5740
5739
}
5741
5740
 
5820
5819
    {
5821
5820
      CurrentContext->decorate=decoration;
5822
5821
      (void) MvgPrintf(wand,"decorate '%s'\n",MagickOptionToMnemonic(
5823
 
        MagickDecorateOptions,(ssize_t) decoration));
 
5822
        MagickDecorateOptions,(long) decoration));
5824
5823
    }
5825
5824
}
5826
5825
 
6213
6212
      const char
6214
6213
        *q;
6215
6214
 
6216
 
      ssize_t
 
6215
      long
6217
6216
        j;
6218
6217
 
6219
 
      register ssize_t
 
6218
      register long
6220
6219
        x;
6221
6220
 
6222
6221
      value=GetXMLTreeContent(child);
6485
6484
%
6486
6485
%  The format of the DrawSetViewbox method is:
6487
6486
%
6488
 
%      void DrawSetViewbox(DrawingWand *wand,size_t x1,
6489
 
%        size_t y1,size_t x2,size_t y2)
 
6487
%      void DrawSetViewbox(DrawingWand *wand,unsigned long x1,
 
6488
%        unsigned long y1,unsigned long x2,unsigned long y2)
6490
6489
%
6491
6490
%  A description of each parameter follows:
6492
6491
%
6501
6500
%    o y2: bottom y ordinate
6502
6501
%
6503
6502
*/
6504
 
WandExport void DrawSetViewbox(DrawingWand *wand,ssize_t x1,ssize_t y1,
6505
 
  ssize_t x2,ssize_t y2)
 
6503
WandExport void DrawSetViewbox(DrawingWand *wand,unsigned long x1,
 
6504
  unsigned long y1,unsigned long x2,unsigned long y2)
6506
6505
{
6507
6506
  assert(wand != (DrawingWand *) NULL);
6508
6507
  assert(wand->signature == WandSignature);
6509
6508
  if (wand->debug != MagickFalse)
6510
6509
    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6511
 
  (void) MvgPrintf(wand,"viewbox %.20g %.20g %.20g %.20g\n",(double) x1,
6512
 
    (double) y1,(double) x2,(double) y2);
 
6510
  (void) MvgPrintf(wand,"viewbox %lu %lu %lu %lu\n",x1,y1,x2,y2);
6513
6511
}
6514
6512
 
6515
6513
/*
6572
6570
  DrawingWand
6573
6571
    *wand;
6574
6572
 
6575
 
  size_t
 
6573
  unsigned long
6576
6574
    depth;
6577
6575
 
6578
6576
  quantum=GetMagickQuantumDepth(&depth);
6584
6582
      GetExceptionMessage(errno));
6585
6583
  (void) ResetMagickMemory(wand,0,sizeof(*wand));
6586
6584
  wand->id=AcquireWandId();
6587
 
  (void) FormatMagickString(wand->name,MaxTextExtent,"%s-%.20g",DrawingWandId,
6588
 
    (double) wand->id);
 
6585
  (void) FormatMagickString(wand->name,MaxTextExtent,"%s-%lu",DrawingWandId,
 
6586
    wand->id);
6589
6587
  if (wand->debug != MagickFalse)
6590
6588
    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6591
6589
  wand->mvg=(char *) NULL;