% The format of the AnnotateImage method is:
%
% Image *PolaroidImage(const Image *image,const DrawInfo *draw_info,
-% const double angle,const PixelInterpolateMethod method,
-% ExceptionInfo exception)
+% const char *caption,const double angle,
+% const PixelInterpolateMethod method,ExceptionInfo exception)
%
% A description of each parameter follows:
%
%
% o draw_info: the draw info.
%
+% o caption: the Polaroid caption.
+%
% o angle: Apply the effect along this angle.
%
% o method: the pixel interpolation method.
%
*/
MagickExport Image *PolaroidImage(const Image *image,const DrawInfo *draw_info,
- const double angle,const PixelInterpolateMethod method,
+ const char *caption,const double angle,const PixelInterpolateMethod method,
ExceptionInfo *exception)
{
- const char
- *value;
-
Image
*bend_image,
*caption_image,
image->rows)/25.0,10.0);
height=image->rows+2*quantum;
caption_image=(Image *) NULL;
- value=GetImageProperty(image,"caption",exception);
- if (value != (const char *) NULL)
+ if (caption != (const char *) NULL)
{
char
- *caption,
- geometry[MaxTextExtent];
+ geometry[MaxTextExtent],
+ *text;
DrawInfo
*annotate_info;
if (caption_image == (Image *) NULL)
return((Image *) NULL);
annotate_info=CloneDrawInfo((const ImageInfo *) NULL,draw_info);
- caption=InterpretImageProperties((ImageInfo *) NULL,(Image *) image,
- value,exception);
- (void) CloneString(&annotate_info->text,caption);
+ text=InterpretImageProperties((ImageInfo *) NULL,(Image *) image,caption,
+ exception);
+ (void) CloneString(&annotate_info->text,text);
count=FormatMagickCaption(caption_image,annotate_info,MagickTrue,&metrics,
- &caption,exception);
- status=SetImageExtent(caption_image,image->columns,(size_t)
- ((count+1)*(metrics.ascent-metrics.descent)+0.5),exception);
+ &text,exception);
+ status=SetImageExtent(caption_image,image->columns,(size_t) ((count+1)*
+ (metrics.ascent-metrics.descent)+0.5),exception);
if (status == MagickFalse)
caption_image=DestroyImage(caption_image);
else
{
caption_image->background_color=image->border_color;
(void) SetImageBackgroundColor(caption_image,exception);
- (void) CloneString(&annotate_info->text,caption);
+ (void) CloneString(&annotate_info->text,text);
(void) FormatLocaleString(geometry,MaxTextExtent,"+0+%g",
metrics.ascent);
if (annotate_info->gravity == UndefinedGravity)
height+=caption_image->rows;
}
annotate_info=DestroyDrawInfo(annotate_info);
- caption=DestroyString(caption);
+ text=DestroyString(text);
}
picture_image=CloneImage(image,image->columns+2*quantum,height,MagickTrue,
exception);
*ImplodeImage(const Image *,const double,const PixelInterpolateMethod,
ExceptionInfo *),
*MorphImages(const Image *,const size_t,ExceptionInfo *),
- *PolaroidImage(const Image *,const DrawInfo *,const double,
+ *PolaroidImage(const Image *,const DrawInfo *,const char *,const double,
const PixelInterpolateMethod,ExceptionInfo *),
*SepiaToneImage(const Image *,const double,ExceptionInfo *),
*ShadowImage(const Image *,const double,const double,const double,
% The format of the MagickPolaroidImage method is:
%
% MagickBooleanType MagickPolaroidImage(MagickWand *wand,
-% const DrawingWand *drawing_wand,const double angle,
+% const DrawingWand *drawing_wand,const char *caption,const double angle,
% const PixelInterpolateMethod method)
%
% A description of each parameter follows:
%
% o drawing_wand: the draw wand.
%
+% o caption: the Polaroid caption.
+%
% o angle: Apply the effect along this angle.
%
% o method: the pixel interpolation method.
%
*/
WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
- const DrawingWand *drawing_wand,const double angle,
+ const DrawingWand *drawing_wand,const char *caption,const double angle,
const PixelInterpolateMethod method)
{
DrawInfo
draw_info=PeekDrawingWand(drawing_wand);
if (draw_info == (DrawInfo *) NULL)
return(MagickFalse);
- polaroid_image=PolaroidImage(wand->images,draw_info,angle,method,
+ polaroid_image=PolaroidImage(wand->images,draw_info,caption,angle,method,
wand->exception);
if (polaroid_image == (Image *) NULL)
return(MagickFalse);
MagickPingImage(MagickWand *,const char *),
MagickPingImageBlob(MagickWand *,const void *,const size_t),
MagickPingImageFile(MagickWand *,FILE *),
- MagickPolaroidImage(MagickWand *,const DrawingWand *,const double,
- const PixelInterpolateMethod),
+ MagickPolaroidImage(MagickWand *,const DrawingWand *,const char *,
+ const double,const PixelInterpolateMethod),
MagickPosterizeImage(MagickWand *,const size_t,const MagickBooleanType),
MagickPreviousImage(MagickWand *),
MagickQuantizeImage(MagickWand *,const size_t,const ColorspaceType,
}
if (LocaleCompare("polaroid",option+1) == 0)
{
+ const char
+ *caption;
+
double
angle;
flags=ParseGeometry(argv[i+1],&geometry_info);
angle=geometry_info.rho;
}
- mogrify_image=PolaroidImage(*image,draw_info,angle,
+ caption=GetImageProperty(*image,"caption",exception);
+ mogrify_image=PolaroidImage(*image,draw_info,caption,angle,
interpolate_method,exception);
break;
}
}
if (LocaleCompare("polaroid",option) == 0)
{
+ const char
+ *caption;
+
double
angle;
flags=ParseGeometry(args[0],&geometry_info);
angle=geometry_info.rho;
}
- new_image=PolaroidImage(*image,draw_info,angle,
+ caption=GetImageProperty(*image,"caption",exception);
+ new_image=PolaroidImage(*image,draw_info,caption,angle,
interpolate_method,exception);
break;
}
}
case 110: /* Polaroid */
{
+ char
+ *caption;
+
DrawInfo
*draw_info;
draw_info=CloneDrawInfo(info ? info->image_info : (ImageInfo *) NULL,
(DrawInfo *) NULL);
+ caption=(char *) NULL;
if (attribute_flag[0] != 0)
- (void) SetImageProperty(image,"caption",InterpretImageProperties(
- info ? info->image_info : (ImageInfo *) NULL,image,
- argument_list[0].string_reference,exception),exception);
+ caption=InterpretImageProperties(info ? info->image_info :
+ (ImageInfo *) NULL,image,argument_list[0].string_reference,
+ exception);
angle=0.0;
if (attribute_flag[1] != 0)
angle=argument_list[1].real_reference;
method=UndefinedInterpolatePixel;
if (attribute_flag[9] != 0)
method=(PixelInterpolateMethod) argument_list[9].integer_reference;
- image=PolaroidImage(image,draw_info,angle,method,exception);
+ image=PolaroidImage(image,draw_info,caption,angle,method,exception);
draw_info=DestroyDrawInfo(draw_info);
+ if (caption != (char *) NULL)
+ caption=DestroyString(caption);
break;
}
case 111: /* FloodfillPaint */