86 #if defined(MAGICKCORE_FREETYPE_DELEGATE) 87 #if defined(__MINGW32__) 91 #if defined(FT_FREETYPE_H) 92 # include FT_FREETYPE_H 94 # include <freetype/freetype.h> 96 #if defined(FT_GLYPH_H) 99 # include <freetype/ftglyph.h> 101 #if defined(FT_OUTLINE_H) 102 # include FT_OUTLINE_H 104 # include <freetype/ftoutln.h> 106 #if defined(FT_BBOX_H) 109 # include <freetype/ftbbox.h> 112 #if defined(MAGICKCORE_RAQM_DELEGATE) 262 assert(image != (
Image *) NULL);
266 assert(draw_info != (
DrawInfo *) NULL);
268 if (draw_info->
text == (
char *) NULL)
270 if (*draw_info->
text ==
'\0')
274 annotate->
text=(
char *) NULL;
277 for (p=text; *p !=
'\0'; p++)
281 if (textlist == (
char **) NULL)
289 for (i=0; i < (ssize_t) number_lines; i++)
295 for (q=p; *q !=
'\0'; q++)
296 if ((*q ==
'\r') || (*q ==
'\n'))
306 textlist[i]=(
char *) NULL;
309 if (annotate_info->
geometry != (
char *) NULL)
326 (void) memset(&metrics,0,
sizeof(metrics));
327 for (i=0; textlist[i] != (
char *) NULL; i++)
329 if (*textlist[i] ==
'\0')
354 offset.
x=(geometry.
width == 0 ? -1.0 : 1.0)*annotate_info->
affine.
tx+i*
357 offset.
y=(geometry.
height == 0 ? -1.0 : 1.0)*annotate_info->
affine.
ty+i*
364 offset.
x=(geometry.
width == 0 ? -1.0 : 1.0)*annotate_info->
affine.
tx+
368 offset.
y=(geometry.
height == 0 ? -1.0 : 1.0)*annotate_info->
affine.
ty+i*
375 offset.
x=(geometry.
width == 0 ? 1.0 : -1.0)*annotate_info->
affine.
tx+
379 offset.
y=(geometry.
height == 0 ? -1.0 : 1.0)*annotate_info->
affine.
ty+i*
386 offset.
x=(geometry.
width == 0 ? -1.0 : 1.0)*annotate_info->
affine.
tx+i*
388 (metrics.
ascent+metrics.
descent-(number_lines-1.0)*height)/2.0;
392 (number_lines-1.0)*height)/2.0;
397 offset.
x=(geometry.
width == 0 ? -1.0 : 1.0)*annotate_info->
affine.
tx+
400 (metrics.
ascent+metrics.
descent-(number_lines-1.0)*height)/2.0;
404 (metrics.
ascent+metrics.
descent-(number_lines-1.0)*height)/2.0;
409 offset.
x=(geometry.
width == 0 ? 1.0 : -1.0)*annotate_info->
affine.
tx+
413 (number_lines-1.0)*height)/2.0-1.0;
418 (number_lines-1.0)*height)/2.0;
423 offset.
x=(geometry.
width == 0 ? -1.0 : 1.0)*annotate_info->
affine.
tx+i*
425 (number_lines-1.0)*height;
433 offset.
x=(geometry.
width == 0 ? -1.0 : 1.0)*annotate_info->
affine.
tx+
436 annotate_info->
affine.
ry*(number_lines-1.0)*height/2.0;
445 offset.
x=(geometry.
width == 0 ? 1.0 : -1.0)*annotate_info->
affine.
tx+
448 annotate_info->
affine.
ry*(number_lines-1.0)*height-1.0;
456 switch (annotate->
align)
497 "rectangle 0.0,0.0 %g,%g",metrics.
origin.
x,(
double) height);
499 (void)
DrawImage(image,undercolor_info,exception);
504 pixel=annotate_info->
fill;
506 pixel=annotate_info->
stroke;
509 "stroke-width %g line 0,0 %g,0",color,(
double)
521 (void)
DrawImage(image,annotate_info,exception);
529 (void)
DrawImage(image,annotate_info,exception);
535 status=
RenderType(image,annotate,&offset,&metrics,exception);
543 (void)
DrawImage(image,annotate_info,exception);
630 if (width <= image->columns)
632 if (s != (
char *) NULL)
646 if ((n > 0) && ((*caption)[n-1] !=
'\n'))
746 assert(image != (
Image *) NULL);
750 assert(draw_info != (
DrawInfo *) NULL);
751 assert(draw_info->
text != (
char *) NULL);
753 if (*draw_info->
text ==
'\0')
761 if (textlist == (
char **) NULL)
765 (void) memset(metrics,0,
sizeof(*metrics));
766 (void) memset(&extent,0,
sizeof(extent));
770 annotate_info->
text=textlist[0];
779 "WidthOrHeightExceedsLimit",
"`%s'",image->
filename);
784 for (i=1; i < (ssize_t) count; i++)
786 annotate_info->
text=textlist[i];
796 "WidthOrHeightExceedsLimit",
"`%s'",image->
filename);
801 metrics->
height=(double) height;
806 annotate_info->
text=(
char *) NULL;
808 for (i=0; i < (ssize_t) count; i++)
872 assert(image != (
Image *) NULL);
876 assert(draw_info != (
DrawInfo *) NULL);
877 assert(draw_info->
text != (
char *) NULL);
882 (void) memset(metrics,0,
sizeof(*metrics));
885 status=
RenderType(image,annotate_info,&offset,metrics,exception);
888 "width: %g; height: %g; ascent: %g; descent: %g; max advance: %g; " 889 "bounds: %g,%g %g,%g; origin: %g,%g; pixels per em: %g,%g; " 890 "underline position: %g; underline thickness: %g",annotate_info->
text,
951 if (draw_info->
font != (
char *) NULL)
953 if (*draw_info->
font ==
'@')
959 if (*draw_info->
font ==
'-')
960 return(
RenderX11(image,draw_info,offset,metrics,exception));
961 if (*draw_info->
font ==
'^')
970 if (type_info == (
const TypeInfo *) NULL)
972 "UnableToReadFont",
"`%s'",draw_info->
font);
974 if ((type_info == (
const TypeInfo *) NULL) &&
975 (draw_info->
family != (
const char *) NULL))
977 if (strchr(draw_info->
family,
',') == (
char *) NULL)
980 if (type_info == (
const TypeInfo *) NULL)
995 for (i=1; i < (ssize_t) number_families; i++)
999 if ((type_info != (
const TypeInfo *) NULL) &&
1003 for (i=0; i < (ssize_t) number_families; i++)
1006 if (type_info == (
const TypeInfo *) NULL)
1008 "UnableToReadFont",
"`%s'",draw_info->
family);
1025 if (type_info == (
const TypeInfo *) NULL)
1028 if (type_info == (
const TypeInfo *) NULL)
1031 if (type_info == (
const TypeInfo *) NULL)
1034 if (type_info == (
const TypeInfo *) NULL)
1037 if (type_info == (
const TypeInfo *) NULL)
1044 annotate_info->
face=type_info->
face;
1045 if (type_info->
metrics != (
char *) NULL)
1047 if (type_info->
glyphs != (
char *) NULL)
1091 #if defined(MAGICKCORE_FREETYPE_DELEGATE) 1093 static size_t ComplexTextLayout(
const Image *image,
const DrawInfo *draw_info,
1094 const char *text,
const size_t length,
const FT_Face face,
const FT_Int32 flags,
1097 #if defined(MAGICKCORE_RAQM_DELEGATE) 1115 if (rq == (raqm_t *) NULL)
1117 if (raqm_set_text_utf8(rq,text,length) == 0)
1119 if (raqm_set_par_direction(rq,(raqm_direction_t) draw_info->
direction) == 0)
1121 if (raqm_set_freetype_face(rq,face) == 0)
1124 if (features != (
const char *) NULL)
1141 status_token=
Tokenizer(token_info,0,token,50,features,
"",
",",
"",
'\0',
1142 &breaker,&next,"e);
1143 while (status_token == 0)
1145 raqm_add_font_feature(rq,token,strlen(token));
1146 status_token=
Tokenizer(token_info,0,token,50,features,
"",
",",
"",
'\0',
1147 &breaker,&next,"e);
1152 if (raqm_layout(rq) == 0)
1154 glyphs=raqm_get_glyphs(rq,&extent);
1155 if (glyphs == (raqm_glyph_t *) NULL)
1166 for (i=0; i < (ssize_t) extent; i++)
1168 (*grapheme)[i].index=glyphs[i].index;
1169 (*grapheme)[i].x_offset=glyphs[i].x_offset;
1170 (*grapheme)[i].x_advance=glyphs[i].x_advance;
1171 (*grapheme)[i].y_offset=glyphs[i].y_offset;
1172 (*grapheme)[i].cluster=glyphs[i].cluster;
1203 (*grapheme)[i].index=(ssize_t) FT_Get_Char_Index(face,
GetUTFCode(p));
1204 (*grapheme)[i].x_offset=0;
1205 (*grapheme)[i].y_offset=0;
1206 if (((*grapheme)[i].index != 0) && (last_glyph != 0))
1208 if (FT_HAS_KERNING(face))
1213 ft_status=FT_Get_Kerning(face,(FT_UInt) last_glyph,(FT_UInt)
1214 (*grapheme)[i].index,ft_kerning_default,&kerning);
1216 (*grapheme)[i-1].x_advance+=(FT_Pos) ((draw_info->
direction ==
1220 ft_status=FT_Load_Glyph(face,(FT_UInt) (*grapheme)[i].index,flags);
1221 (*grapheme)[i].x_advance=face->glyph->advance.x;
1222 (*grapheme)[i].cluster=p-text;
1223 last_glyph=(*grapheme)[i].index;
1231 return((outline.n_points == 0) || (outline.n_contours <= 0) ?
MagickTrue :
1235 static int TraceCubicBezier(FT_Vector *p,FT_Vector *q,FT_Vector *to,
1244 affine=draw_info->
affine;
1246 affine.
tx+p->x/64.0,affine.
ty-p->y/64.0,affine.
tx+q->x/64.0,affine.
ty-
1247 q->y/64.0,affine.
tx+to->x/64.0,affine.
ty-to->y/64.0);
1252 static int TraceLineTo(FT_Vector *to,
DrawInfo *draw_info)
1260 affine=draw_info->
affine;
1262 affine.
ty-to->y/64.0);
1267 static int TraceMoveTo(FT_Vector *to,
DrawInfo *draw_info)
1275 affine=draw_info->
affine;
1277 affine.
ty-to->y/64.0);
1282 static int TraceQuadraticBezier(FT_Vector *control,FT_Vector *to,
1291 affine=draw_info->
affine;
1293 control->x/64.0,affine.
ty-control->y/64.0,affine.
tx+to->x/64.0,affine.
ty-
1303 #if !defined(FT_OPEN_PATHNAME) 1304 #define FT_OPEN_PATHNAME ft_open_pathname 1307 typedef struct _GlyphInfo
1387 static FT_Outline_Funcs
1390 (FT_Outline_MoveTo_Func) TraceMoveTo,
1391 (FT_Outline_LineTo_Func) TraceLineTo,
1392 (FT_Outline_ConicTo_Func) TraceQuadraticBezier,
1393 (FT_Outline_CubicTo_Func) TraceCubicBezier,
1403 ft_status=FT_Init_FreeType(&library);
1407 args.flags=FT_OPEN_PATHNAME;
1408 if (draw_info->
font == (
char *) NULL)
1411 if (*draw_info->
font !=
'@')
1415 face=(FT_Face) NULL;
1416 ft_status=FT_Open_Face(library,&args,(
long) draw_info->
face,&face);
1419 (void) FT_Done_FreeType(library);
1421 "UnableToReadFont",
"`%s'",args.pathname);
1426 if ((draw_info->
metrics != (
char *) NULL) &&
1428 (void) FT_Attach_File(face,draw_info->
metrics);
1429 encoding_type=FT_ENCODING_UNICODE;
1430 ft_status=FT_Select_Charmap(face,encoding_type);
1431 if ((ft_status != 0) && (face->num_charmaps != 0))
1432 ft_status=FT_Set_Charmap(face,face->charmaps[0]);
1433 if (encoding != (
const char *) NULL)
1436 encoding_type=FT_ENCODING_ADOBE_CUSTOM;
1438 encoding_type=FT_ENCODING_ADOBE_EXPERT;
1440 encoding_type=FT_ENCODING_ADOBE_STANDARD;
1442 encoding_type=FT_ENCODING_APPLE_ROMAN;
1444 encoding_type=FT_ENCODING_BIG5;
1445 #if defined(FT_ENCODING_PRC) 1447 encoding_type=FT_ENCODING_PRC;
1449 #if defined(FT_ENCODING_JOHAB) 1451 encoding_type=FT_ENCODING_JOHAB;
1453 #if defined(FT_ENCODING_ADOBE_LATIN_1) 1455 encoding_type=FT_ENCODING_ADOBE_LATIN_1;
1457 #if defined(FT_ENCODING_ADOBE_LATIN_2) 1459 encoding_type=FT_ENCODING_OLD_LATIN_2;
1462 encoding_type=FT_ENCODING_NONE;
1464 encoding_type=FT_ENCODING_SJIS;
1466 encoding_type=FT_ENCODING_MS_SYMBOL;
1468 encoding_type=FT_ENCODING_UNICODE;
1470 encoding_type=FT_ENCODING_WANSUNG;
1471 ft_status=FT_Select_Charmap(face,encoding_type);
1474 (void) FT_Done_Face(face);
1475 (void) FT_Done_FreeType(library);
1484 if (draw_info->
density != (
char *) NULL)
1493 resolution.
x=geometry_info.
rho;
1494 resolution.
y=geometry_info.
sigma;
1496 resolution.
y=resolution.
x;
1498 ft_status=FT_Set_Char_Size(face,(FT_F26Dot6) (64.0*draw_info->
pointsize),
1499 (FT_F26Dot6) (64.0*draw_info->
pointsize),(FT_UInt) resolution.
x,
1500 (FT_UInt) resolution.
y);
1503 (void) FT_Done_Face(face);
1504 (void) FT_Done_FreeType(library);
1509 metrics->
ascent=(double) face->size->metrics.ascender/64.0;
1510 metrics->
descent=(
double) face->size->metrics.descender/64.0;
1514 metrics->
height=(double) face->size->metrics.height/64.0;
1517 metrics->
max_advance=(double) face->size->metrics.max_advance/64.0;
1527 FT_Get_First_Char(face,&first_glyph_id);
1528 if ((draw_info->
text == (
char *) NULL) || (*draw_info->
text ==
'\0') ||
1529 (first_glyph_id == 0))
1531 (void) FT_Done_Face(face);
1532 (void) FT_Done_FreeType(library);
1540 "font-encoding %s; text-encoding %s; pointsize %g",
1541 draw_info->
font != (
char *) NULL ? draw_info->
font :
"none",
1542 encoding != (
char *) NULL ? encoding :
"none",
1545 flags=FT_LOAD_DEFAULT;
1547 flags=FT_LOAD_NO_BITMAP;
1549 flags|=FT_LOAD_RENDER | FT_LOAD_TARGET_MONO;
1552 #if defined(FT_LOAD_TARGET_LIGHT) 1553 flags|=FT_LOAD_TARGET_LIGHT;
1554 #elif defined(FT_LOAD_TARGET_LCD) 1555 flags|=FT_LOAD_TARGET_LCD;
1559 if ((value != (
const char *) NULL) && (
LocaleCompare(value,
"off") == 0))
1560 flags|=FT_LOAD_NO_HINTING;
1562 glyph.image=(FT_Glyph) NULL;
1572 affine.xx=(FT_Fixed) (65536L*draw_info->
affine.
sx+0.5);
1573 affine.yx=(FT_Fixed) (-65536L*draw_info->
affine.
rx+0.5);
1574 affine.xy=(FT_Fixed) (-65536L*draw_info->
affine.
ry+0.5);
1575 affine.yy=(FT_Fixed) (65536L*draw_info->
affine.
sy+0.5);
1592 utf8=(
unsigned char *) NULL;
1598 if (utf8 != (
unsigned char *) NULL)
1602 length=ComplexTextLayout(image,draw_info,p,strlen(p),face,flags,&grapheme,
1604 missing_glyph_id=FT_Get_Char_Index(face,
' ');
1606 last_character=(ssize_t) length-1;
1607 for (i=0; i < (ssize_t) length; i++)
1615 glyph.id=(FT_UInt) grapheme[i].index;
1617 glyph.id=missing_glyph_id;
1618 if ((glyph.id != 0) && (last_glyph_id != 0))
1619 origin.x+=(FT_Pos) (64.0*draw_info->
kerning);
1620 glyph.origin=origin;
1621 glyph.origin.x+=(FT_Pos) grapheme[i].x_offset;
1622 glyph.origin.y+=(FT_Pos) grapheme[i].y_offset;
1623 if (glyph.image != (FT_Glyph) NULL)
1625 FT_Done_Glyph(glyph.image);
1626 glyph.image=(FT_Glyph) NULL;
1628 ft_status=FT_Load_Glyph(face,glyph.id,flags);
1631 ft_status=FT_Get_Glyph(face->glyph,&glyph.image);
1634 outline=((FT_OutlineGlyph) glyph.image)->outline;
1635 if ((glyph.image->format != FT_GLYPH_FORMAT_OUTLINE) &&
1638 ft_status=FT_Outline_Get_BBox(&outline,&bounds);
1641 if ((p == draw_info->
text) || (bounds.xMin < metrics->
bounds.
x1))
1642 if (bounds.xMin != 0)
1643 metrics->
bounds.
x1=(double) bounds.xMin;
1644 if ((p == draw_info->
text) || (bounds.yMin < metrics->
bounds.
y1))
1645 if (bounds.yMin != 0)
1646 metrics->
bounds.
y1=(double) bounds.yMin;
1647 if ((p == draw_info->
text) || (bounds.xMax > metrics->
bounds.
x2))
1648 if (bounds.xMax != 0)
1649 metrics->
bounds.
x2=(double) bounds.xMax;
1650 if ((p == draw_info->
text) || (bounds.yMax > metrics->
bounds.
y2))
1651 if (bounds.yMax != 0)
1652 metrics->
bounds.
y2=(double) bounds.yMax;
1660 annotate_info->
affine.
tx=glyph.origin.x/64.0;
1661 annotate_info->
affine.
ty=(-glyph.origin.y/64.0);
1663 ft_status=FT_Outline_Decompose(&outline,&OutlineMethods,
1666 FT_Vector_Transform(&glyph.origin,&affine);
1667 (void) FT_Glyph_Transform(glyph.image,&affine,&glyph.origin);
1668 ft_status=FT_Glyph_To_Bitmap(&glyph.image,FT_RENDER_MODE_NORMAL,
1672 bitmap=(FT_BitmapGlyph) glyph.image;
1673 point.
x=offset->
x+bitmap->left;
1674 if (bitmap->bitmap.pixel_mode == ft_pixel_mode_mono)
1675 point.
x+=(origin.x/64.0);
1676 point.
y=offset->
y-bitmap->top;
1697 r=bitmap->bitmap.buffer;
1698 for (y=0; y < (ssize_t) bitmap->bitmap.rows; y++)
1725 if ((y_offset < 0) || (y_offset >= (ssize_t) image->
rows))
1728 if ((x_offset < 0) || (x_offset >= (ssize_t) image->
columns))
1733 bitmap->bitmap.width,1,exception);
1736 n=y*bitmap->bitmap.pitch;
1737 for (x=0; x < (ssize_t) bitmap->bitmap.width; x++, n++)
1740 if ((x_offset < 0) || (x_offset >= (ssize_t) image->
columns))
1747 if (bitmap->bitmap.buffer != (
unsigned char *) NULL)
1749 if (bitmap->bitmap.pixel_mode == ft_pixel_mode_grays)
1750 fill_opacity=(double) (r[n])/(bitmap->bitmap.num_grays-1);
1752 if (bitmap->bitmap.pixel_mode == ft_pixel_mode_mono)
1753 fill_opacity=((r[(x >> 3)+y*bitmap->bitmap.pitch] &
1754 (1 << (~x & 0x07)))) == 0 ? 0.0 : 1.0;
1757 fill_opacity=fill_opacity >= 0.5 ? 1.0 : 0.0;
1766 GetFillColor(draw_info,x_offset,y_offset,&fill_color,exception);
1767 fill_opacity=fill_opacity*fill_color.
alpha;
1806 if (strlen(annotate_info->
primitive) > 7)
1807 (
void)
DrawImage(image,annotate_info,exception);
1816 if (i == last_character)
1817 origin.x+=
MagickMax((FT_Pos) grapheme[i].x_advance,bounds.xMax);
1819 origin.x+=(FT_Pos) grapheme[i].x_advance;
1820 metrics->
origin.
x=(double) origin.x;
1821 metrics->
origin.
y=(
double) origin.y;
1824 last_glyph_id=glyph.id;
1829 if (utf8 != (
unsigned char *) NULL)
1831 if (glyph.image != (FT_Glyph) NULL)
1833 FT_Done_Glyph(glyph.image);
1834 glyph.image=(FT_Glyph) NULL;
1850 (void) FT_Done_Face(face);
1851 (void) FT_Done_FreeType(library);
1861 draw_info->
font != (
char *) NULL ? draw_info->
font :
"none");
1913 assert(source != (
const char *) NULL);
1915 for (p=source; *p !=
'\0'; p++)
1917 if ((*p ==
'\\') || (*p ==
'(') || (*p ==
')'))
1925 destination=(
char *) NULL;
1928 sizeof(*destination));
1929 if (destination == (
char *) NULL)
1933 for (p=source; *p !=
'\0'; p++)
1935 if ((*p ==
'\\') || (*p ==
'(') || (*p ==
')'))
1940 return(destination);
1986 "Font %s; pointsize %g",draw_info->
font != (
char *) NULL ?
1990 if (unique_file != -1)
1991 file=fdopen(unique_file,
"wb");
1992 if ((unique_file == -1) || (file == (FILE *) NULL))
2002 " dict begin { 1 index /FID ne {def} {pop pop} ifelse } forall\n");
2004 " /Encoding ISOLatin1Encoding def currentdict end definefont pop\n");
2014 length=strlen(draw_info->
text);
2015 for (i=0; i <= (ssize_t) (length+2); i++)
2021 if (point.
x > extent.
x)
2023 if (point.
y > extent.
y)
2027 extent.
x/2.0,extent.
y/2.0);
2030 if ((draw_info->
font == (
char *) NULL) || (*draw_info->
font ==
'\0') ||
2031 (strchr(draw_info->
font,
'/') != (
char *) NULL))
2033 "/Times-Roman-ISO dup /Times-Roman ReencodeType findfont setfont\n");
2036 "/%s-ISO dup /%s ReencodeType findfont setfont\n",draw_info->
font,
2043 (void)
FormatLocaleFile(file,
"(%s) stringwidth pop -0.5 mul -0.5 rmoveto\n",
2048 (void) fclose(file);
2050 floor(extent.
x+0.5),floor(extent.
y+0.5));
2055 if (draw_info->
density != (
char *) NULL)
2058 annotate_image=
ReadImage(annotate_info,exception);
2062 if (annotate_image == (
Image *) NULL)
2067 if (draw_info->
density != (
char *) NULL)
2076 resolution.
x=geometry_info.
rho;
2077 resolution.
y=geometry_info.
sigma;
2079 resolution.
y=resolution.
x;
2082 (void)
TransformImage(&annotate_image,
"0x0",(
char *) NULL,exception);
2094 "%.20gx%.20g%+.20g%+.20g",(
double) crop_info.
width,(double)
2095 crop_info.
height,(
double) crop_info.
x,(double) crop_info.
y);
2096 (void)
TransformImage(&annotate_image,geometry,(
char *) NULL,exception);
2137 fill_color=draw_info->
fill;
2139 for (y=0; y < (ssize_t) annotate_image->
rows; y++)
2151 for (x=0; x < (ssize_t) annotate_image->
columns; x++)
2167 (ssize_t) ceil(offset->
x-0.5),(ssize_t) ceil(offset->
y-(metrics->
ascent+
2168 metrics->
descent)-0.5),exception);
2215 status=
XRenderImage(image,draw_info,offset,metrics,exception);
MagickExport MagickBooleanType NegateImage(Image *image, const MagickBooleanType grayscale, ExceptionInfo *exception)
MagickExport CacheView * DestroyCacheView(CacheView *cache_view)
MagickExport TokenInfo * DestroyTokenInfo(TokenInfo *token_info)
MagickExport MagickBooleanType QueryColorname(const Image *magick_unused(image), const PixelInfo *color, const ComplianceType compliance, char *name, ExceptionInfo *exception)
MagickExport ImageInfo * AcquireImageInfo(void)
MagickPrivate void AnnotateComponentTerminus(void)
MagickExport size_t ConcatenateMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
static Quantum GetPixelAlpha(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
MagickExport void UnlockSemaphoreInfo(SemaphoreInfo *semaphore_info)
MagickExport const TypeInfo * GetTypeInfo(const char *name, ExceptionInfo *exception)
static int GetUTFCode(const char *magick_restrict text)
#define ThrowFatalException(severity, tag)
static void GetFillColor(const DrawInfo *draw_info, const ssize_t x, const ssize_t y, PixelInfo *fill, ExceptionInfo *exception)
MagickExport void SetGeometryInfo(GeometryInfo *geometry_info)
MagickExport SemaphoreInfo * AcquireSemaphoreInfo(void)
static MagickBooleanType IsUTFSpace(int code)
MagickBooleanType antialias
MagickExport ExceptionInfo * AcquireExceptionInfo(void)
MagickExport ssize_t FormatLocaleString(char *magick_restrict string, const size_t length, const char *magick_restrict format,...)
static MagickBooleanType IsGrayColorspace(const ColorspaceType colorspace)
MagickExport size_t CopyMagickString(char *magick_restrict destination, const char *magick_restrict source, const size_t length)
#define DefaultResolution
static MagickBooleanType RenderPostscript(Image *, const DrawInfo *, const PointInfo *, TypeMetric *, ExceptionInfo *)
MagickExport MagickBooleanType CompositeImage(Image *image, const Image *composite, const CompositeOperator compose, const MagickBooleanType clip_to_self, const ssize_t x_offset, const ssize_t y_offset, ExceptionInfo *exception)
MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, const MagickSizeType size)
#define ThrowBinaryException(severity, tag, context)
static Quantum ClampToQuantum(const MagickRealType quantum)
MagickExport void GetPixelInfo(const Image *image, PixelInfo *pixel)
MagickExport TokenInfo * AcquireTokenInfo(void)
#define MagickCoreSignature
MagickExport void LockSemaphoreInfo(SemaphoreInfo *semaphore_info)
MagickExport Quantum * GetCacheViewAuthenticPixels(CacheView *cache_view, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
static MagickBooleanType RenderType(Image *, const DrawInfo *, const PointInfo *, TypeMetric *, ExceptionInfo *)
MagickExport double ExpandAffine(const AffineMatrix *affine)
MagickExport ssize_t FormatMagickCaption(Image *image, DrawInfo *draw_info, const MagickBooleanType split, TypeMetric *metrics, char **caption, ExceptionInfo *exception)
MagickExport ssize_t FormatLocaleFile(FILE *file, const char *magick_restrict format,...)
MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, const AlphaChannelOption alpha_type, ExceptionInfo *exception)
unsigned int MagickStatusType
MagickExport char * AcquireString(const char *source)
MagickExport MagickStatusType ParsePageGeometry(const Image *image, const char *geometry, RectangleInfo *region_info, ExceptionInfo *exception)
static double PerceptibleReciprocal(const double x)
MagickExport int AcquireUniqueFileResource(char *path)
MagickExport MagickBooleanType AnnotateImage(Image *image, const DrawInfo *draw_info, ExceptionInfo *exception)
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
char filename[MagickPathExtent]
MagickExport MagickBooleanType RelinquishUniqueFileResource(const char *path)
MagickPrivate MagickBooleanType XRenderImage(Image *, const DrawInfo *, const PointInfo *, TypeMetric *, ExceptionInfo *)
MagickExport MagickBooleanType DrawImage(Image *image, const DrawInfo *draw_info, ExceptionInfo *exception)
static SemaphoreInfo * annotate_semaphore
#define ThrowFileException(exception, severity, tag, context)
MagickExport Image * ReadImage(const ImageInfo *image_info, ExceptionInfo *exception)
static MagickBooleanType RenderX11(Image *, const DrawInfo *, const PointInfo *, TypeMetric *, ExceptionInfo *)
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
MagickExport MagickBooleanType IsPathAccessible(const char *path)
MagickExport const TypeInfo * GetTypeInfoByFamily(const char *family, const StyleType style, const StretchType stretch, const size_t weight, ExceptionInfo *exception)
MagickExport DrawInfo * CloneDrawInfo(const ImageInfo *image_info, const DrawInfo *draw_info)
static void SetPixelBlue(const Image *magick_restrict image, const Quantum blue, Quantum *magick_restrict pixel)
MagickPrivate MagickBooleanType AnnotateComponentGenesis(void)
MagickExport MagickBooleanType SetImageStorageClass(Image *image, const ClassType storage_class, ExceptionInfo *exception)
MagickExport void CatchException(ExceptionInfo *exception)
static double RoundToUnity(const double value)
static size_t GetPixelChannels(const Image *magick_restrict image)
MagickExport int LocaleCompare(const char *p, const char *q)
static ssize_t CastDoubleToLong(const double value)
char filename[MagickPathExtent]
#define GetMagickModule()
double underline_thickness
MagickExport MagickBooleanType GetMultilineTypeMetrics(Image *image, const DrawInfo *draw_info, TypeMetric *metrics, ExceptionInfo *exception)
MagickExport ImageInfo * DestroyImageInfo(ImageInfo *image_info)
MagickExport MagickBooleanType GetTypeMetrics(Image *image, const DrawInfo *draw_info, TypeMetric *metrics, ExceptionInfo *exception)
MagickExport RectangleInfo GetImageBoundingBox(const Image *image, ExceptionInfo *exception)
MagickExport MagickBooleanType SetImageColorspace(Image *image, const ColorspaceType colorspace, ExceptionInfo *exception)
MagickExport DrawInfo * DestroyDrawInfo(DrawInfo *draw_info)
MagickExport char * DestroyString(char *string)
MagickExport void ActivateSemaphoreInfo(SemaphoreInfo **semaphore_info)
MagickExport const char * GetImageProperty(const Image *image, const char *property, ExceptionInfo *exception)
double underline_position
static char * EscapeParenthesis(const char *source)
MagickBooleanType text_antialias
MagickExport MagickStatusType ParseGeometry(const char *geometry, GeometryInfo *geometry_info)
MagickExport char * GetPolicyValue(const char *name)
static void SetPixelAlpha(const Image *magick_restrict image, const Quantum alpha, Quantum *magick_restrict pixel)
MagickExport void SetGeometry(const Image *image, RectangleInfo *geometry)
MagickExport MagickBooleanType ConcatenateString(char **magick_restrict destination, const char *magick_restrict source)
static MagickBooleanType RenderFreetype(Image *, const DrawInfo *, const char *, const PointInfo *, TypeMetric *, ExceptionInfo *)
MagickExport void * RelinquishMagickMemory(void *memory)
#define magick_unreferenced(x)
static unsigned int GetUTFOctets(const char *magick_restrict text)
MagickExport char * CloneString(char **destination, const char *source)
MagickExport char ** StringToStrings(const char *text, size_t *count)
static void SetPixelRed(const Image *magick_restrict image, const Quantum red, Quantum *magick_restrict pixel)
static unsigned char * ConvertLatin1ToUTF8(const unsigned char *magick_restrict content)
MagickExport MagickBooleanType SyncCacheViewAuthenticPixels(CacheView *magick_restrict cache_view, ExceptionInfo *exception)
MagickExport CacheView * AcquireAuthenticCacheView(const Image *image, ExceptionInfo *exception)
MagickExport char ** StringToArgv(const char *text, int *argc)
MagickExport MagickRealType GetPixelIntensity(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
MagickExport void RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
MagickExport Image * DestroyImage(Image *image)
MagickExport char * ConstantString(const char *source)
ColorspaceType colorspace
MagickExport int Tokenizer(TokenInfo *token_info, const unsigned flag, char *token, const size_t max_token_length, const char *line, const char *white, const char *break_set, const char *quote, const char escape, char *breaker, int *next, char *quoted)
static void CompositePixelOver(const Image *image, const PixelInfo *p, const double alpha, const Quantum *q, const double beta, Quantum *composite)
MagickExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *exception)
static void SetPixelGreen(const Image *magick_restrict image, const Quantum green, Quantum *magick_restrict pixel)
struct _GraphemeInfo GraphemeInfo