本文整理汇总了C++中LocaleNCompare函数的典型用法代码示例。如果您正苦于以下问题:C++ LocaleNCompare函数的具体用法?C++ LocaleNCompare怎么用?C++ LocaleNCompare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LocaleNCompare函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: IsXPM
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s X P M %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsXPM() returns MagickTrue if the image format type, identified by the
% magick string, is XPM.
%
% The format of the IsXPM method is:
%
% MagickBooleanType IsXPM(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes. or
% blob.
%
% o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsXPM(const unsigned char *magick,const size_t length)
{
if (length < 9)
return(MagickFalse);
if (LocaleNCompare((char *) magick+1,"* XPM *",7) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:ChaseReid,项目名称:ImageMagick,代码行数:34,代码来源:xpm.c
示例2: IsPFA
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s P F A %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsPFA()() returns MagickTrue if the image format type, identified by the
% magick string, is PFA.
%
% The format of the IsPFA method is:
%
% MagickBooleanType IsPFA(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
%
*/
static MagickBooleanType IsPFA(const unsigned char *magick,const size_t length)
{
if (length < 14)
return(MagickFalse);
if (LocaleNCompare((char *) magick,"%!PS-AdobeFont",14) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:vcgato29,项目名称:ImageMagick,代码行数:34,代码来源:ttf.c
示例3: IsWEBP
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s W E B P %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsWEBP() returns MagickTrue if the image format type, identified by the
% magick string, is WebP.
%
% The format of the IsWEBP method is:
%
% MagickBooleanType IsWEBP(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsWEBP(const unsigned char *magick,const size_t length)
{
if (length < 12)
return(MagickFalse);
if (LocaleNCompare((const char *) magick+8,"WEBP",4) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:UIKit0,项目名称:YoyaMagick,代码行数:33,代码来源:webp.c
示例4: IsXCF
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s X C F %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsXCF() returns MagickTrue if the image format type, identified by the
% magick string, is XCF (GIMP native format).
%
% The format of the IsXCF method is:
%
% MagickBooleanType IsXCF(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
%
*/
static MagickBooleanType IsXCF(const unsigned char *magick,const size_t length)
{
if (length < 8)
return(MagickFalse);
if (LocaleNCompare((char *) magick,"gimp xcf",8) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:yoya,项目名称:ImageMagick,代码行数:34,代码来源:xcf.c
示例5: IsPWP
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s P W P %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsPWP() returns MagickTrue if the image format type, identified by the
% magick string, is PWP.
%
% The format of the IsPWP method is:
%
% MagickBooleanType IsPWP(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
%
*/
static MagickBooleanType IsPWP(const unsigned char *magick,const size_t length)
{
if (length < 5)
return(MagickFalse);
if (LocaleNCompare((char *) magick,"SFW95",5) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:UIKit0,项目名称:YoyaMagick,代码行数:34,代码来源:pwp.c
示例6: IsMPC
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s M P C %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsMPC() returns MagickTrue if the image format type, identified by the
% magick string, is an Magick Persistent Cache image.
%
% The format of the IsMPC method is:
%
% MagickBooleanType IsMPC(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsMPC(const unsigned char *magick,const size_t length)
{
if (length < 14)
return(MagickFalse);
if (LocaleNCompare((const char *) magick,"id=MagickCache",14) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:33,代码来源:mpc.c
示例7: IsMGK
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s M G K %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsMGK() returns MagickTrue if the image format type, identified by the
% magick string, is MGK.
%
% The format of the IsMGK method is:
%
% MagickBooleanType IsMGK(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: This string is generally the first few bytes of an image file
% or blob.
%
% o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsMGK(const unsigned char *magick,const size_t length)
{
if (length < 7)
return(MagickFalse);
if (LocaleNCompare((char *) magick,"id=mgk",7) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:278443820,项目名称:ImageMagick,代码行数:34,代码来源:mgk.c
示例8: IsIPL
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s I P L %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsIPL() returns MagickTrue if the image format type, identified by the
% magick string, is IPL.
%
% The format of the IsIPL method is:
%
% MagickBooleanType IsIPL(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsIPL(const unsigned char *magick,const size_t length)
{
if (length < 4)
return(MagickFalse);
if (LocaleNCompare((const char *) magick,"data",4) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:278443820,项目名称:ImageMagick,代码行数:33,代码来源:ipl.c
示例9: IsFAX
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s F A X %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Method IsFAX returns True if the image format type, identified by the
% magick string, is FAX.
%
% The format of the IsFAX method is:
%
% unsigned int IsFAX(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o status: Method IsFAX returns True if the image format type is FAX.
%
% o magick: This string is generally the first few bytes of an image file
% or blob.
%
% o length: Specifies the length of the magick string.
%
%
*/
static unsigned int IsFAX(const unsigned char *magick,const size_t length)
{
if (length < 4)
return(False);
if (LocaleNCompare((char *) magick,"DFAX",4) == 0)
return(True);
return(False);
}
开发者ID:hank2015,项目名称:testCMS,代码行数:37,代码来源:fax.c
示例10: IsMVG
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s M V G %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Method IsMVG returns True if the image format type, identified by the
% magick string, is MVG.
%
% The format of the IsMVG method is:
%
% unsigned int IsMVG(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o status: Method IsMVG returns True if the image format type is MVG.
%
% o magick: This string is generally the first few bytes of an image file
% or blob.
%
% o length: Specifies the length of the magick string.
%
%
*/
static unsigned int IsMVG(const unsigned char *magick,const size_t length)
{
if (length < 7)
return(False);
if (LocaleNCompare((char *) magick,"viewbox",7) == 0)
return(True);
return(False);
}
开发者ID:CliffsDover,项目名称:graphicsmagick,代码行数:37,代码来源:mvg.c
示例11: IsSCT
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s S C T %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsSCT() returns MagickTrue if the image format type, identified by the
% magick string, is SCT.
%
% The format of the IsSCT method is:
%
% MagickBooleanType IsSCT(const unsigned char *magick,const size_t length)
%
% A description of each parameter follows:
%
% o magick: compare image format pattern against these bytes.
%
% o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsSCT(const unsigned char *magick,const size_t length)
{
if (length < 2)
return(MagickFalse);
if (LocaleNCompare((const char *) magick,"CT",2) == 0)
return(MagickTrue);
return(MagickFalse);
}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:33,代码来源:sct.c
示例12: IsMagickWand
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s M a g i c k W a n d %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsMagickWand() returns MagickTrue if the wand is verified as a magick wand.
%
% The format of the IsMagickWand method is:
%
% MagickBooleanType IsMagickWand(const MagickWand *wand)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
*/
WandExport MagickBooleanType IsMagickWand(const MagickWand *wand)
{
if (wand == (const MagickWand *) NULL)
return(MagickFalse);
if (wand->signature != WandSignature)
return(MagickFalse);
if (LocaleNCompare(wand->name,MagickWandId,strlen(MagickWandId)) != 0)
return(MagickFalse);
return(MagickTrue);
}
开发者ID:saitoha,项目名称:ImageMagick-V7-SIXEL,代码行数:32,代码来源:magick-wand.c
示例13: IsPixelView
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s P i x e l V i e w %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsPixelView() returns MagickTrue if the the parameter is verified as a pixel
% view container.
%
% The format of the IsPixelView method is:
%
% MagickBooleanType IsPixelView(const PixelView *pixel_view)
%
% A description of each parameter follows:
%
% o pixel_view: the pixel view.
%
*/
WandExport MagickBooleanType IsPixelView(const PixelView *pixel_view)
{
size_t
length;
if (pixel_view == (const PixelView *) NULL)
return(MagickFalse);
if (pixel_view->signature != WandSignature)
return(MagickFalse);
length=strlen(PixelViewId);
if (LocaleNCompare(pixel_view->name,PixelViewId,length) != 0)
return(MagickFalse);
return(MagickTrue);
}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:37,代码来源:pixel-view.c
示例14: IsPixelIterator
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s P i x e l I t e r a t o r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% IsPixelIterator() returns MagickTrue if the iterator is verified as a pixel
% iterator.
%
% The format of the IsPixelIterator method is:
%
% MagickBooleanType IsPixelIterator(const PixelIterator *iterator)
%
% A description of each parameter follows:
%
% o iterator: the magick iterator.
%
*/
WandExport MagickBooleanType IsPixelIterator(const PixelIterator *iterator)
{
size_t
length;
if (iterator == (const PixelIterator *) NULL)
return(MagickFalse);
if (iterator->signature != WandSignature)
return(MagickFalse);
length=strlen(PixelIteratorId);
if (LocaleNCompare(iterator->name,PixelIteratorId,length) != 0)
return(MagickFalse);
return(MagickTrue);
}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:37,代码来源:pixel-iterator.c
示例15: AcquireScriptTokenInfo
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% A c q u i r e S c r i p t T o k e n I n f o %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% AcquireScriptTokenInfo() allocated, initializes and opens the given
% file stream from which tokens are to be extracted.
%
% The format of the AcquireScriptTokenInfo method is:
%
% ScriptTokenInfo *AcquireScriptTokenInfo(char *filename)
%
% A description of each parameter follows:
%
% o filename the filename to open ("-" means stdin)
%
*/
WandExport ScriptTokenInfo *AcquireScriptTokenInfo(char *filename)
{
ScriptTokenInfo
*token_info;
token_info=(ScriptTokenInfo *) AcquireMagickMemory(sizeof(*token_info));
if (token_info == (ScriptTokenInfo *) NULL)
return token_info;
(void) ResetMagickMemory(token_info,0,sizeof(*token_info));
token_info->opened=MagickFalse;
if ( LocaleCompare(filename,"-") == 0 ) {
token_info->stream=stdin;
token_info->opened=MagickFalse;
}
else if ( LocaleNCompare(filename,"fd:",3) == 0 ) {
token_info->stream=fdopen(StringToLong(filename+3),"r");
token_info->opened=MagickFalse;
}
else {
token_info->stream=fopen_utf8(filename, "r");
}
if ( token_info->stream == (FILE *)NULL ) {
token_info=(ScriptTokenInfo *) RelinquishMagickMemory(token_info);
return(token_info);
}
token_info->curr_line=1;
token_info->length=INITAL_TOKEN_LENGTH;
token_info->token=(char *) AcquireMagickMemory(token_info->length);
token_info->status=(token_info->token != (char *)NULL)
? TokenStatusOK : TokenStatusMemoryFailed;
token_info->signature=WandSignature;
return token_info;
}
开发者ID:Ladeira,项目名称:ImageMagick,代码行数:60,代码来源:script-token.c
示例16: LoadConfigureList
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
+ L o a d C o n f i g u r e L i s t %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% LoadConfigureList() loads the configure configuration file which provides a
% mapping between configure attributes and a configure name.
%
% The format of the LoadConfigureList method is:
%
% MagickBooleanType LoadConfigureList(const char *xml,const char *filename,
% const size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o xml: The configure list in XML format.
%
% o filename: The configure list filename.
%
% o depth: depth of <include /> statements.
%
% o exception: return any errors or warnings in this structure.
%
*/
static MagickBooleanType LoadConfigureList(const char *xml,const char *filename,
const size_t depth,ExceptionInfo *exception)
{
char
keyword[MaxTextExtent],
*token;
ConfigureInfo
*configure_info;
const char
*q;
MagickBooleanType
status;
/*
Load the configure map file.
*/
(void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
"Loading configure file \"%s\" ...",filename);
if (configure_list == (LinkedListInfo *) NULL)
{
configure_list=NewLinkedList(0);
if (configure_list == (LinkedListInfo *) NULL)
{
ThrowFileException(exception,ResourceLimitError,
"MemoryAllocationFailed",filename);
return(MagickFalse);
}
}
status=MagickTrue;
configure_info=(ConfigureInfo *) NULL;
token=AcquireString((char *) xml);
for (q=(char *) xml; *q != '\0'; )
{
/*
Interpret XML.
*/
GetMagickToken(q,&q,token);
if (*token == '\0')
break;
(void) CopyMagickString(keyword,token,MaxTextExtent);
if (LocaleNCompare(keyword,"<!DOCTYPE",9) == 0)
{
/*
Doctype element.
*/
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
GetMagickToken(q,&q,token);
continue;
}
if (LocaleNCompare(keyword,"<!--",4) == 0)
{
/*
Comment element.
*/
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
GetMagickToken(q,&q,token);
continue;
}
if (LocaleCompare(keyword,"<include") == 0)
{
/*
Include element.
*/
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
{
(void) CopyMagickString(keyword,token,MaxTextExtent);
GetMagickToken(q,&q,token);
//.........这里部分代码省略.........
开发者ID:MaximOrlovsky,项目名称:unix-toolbox.js-imagemagick,代码行数:101,代码来源:configure.c
示例17: assert
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e a d M V G I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ReadMVGImage creates a gradient image and initializes it to
% the X server color range as specified by the filename. It allocates the
% memory necessary for the new Image structure and returns a pointer to the
% new image.
%
% The format of the ReadMVGImage method is:
%
% Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image_info: the image info.
%
% o exception: return any errors or warnings in this structure.
%
*/
static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define BoundingBox "viewbox"
DrawInfo
*draw_info;
Image
*image;
MagickBooleanType
status;
/*
Open image.
*/
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
image=AcquireImage(image_info);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
image=DestroyImageList(image);
return((Image *) NULL);
}
if ((image->columns == 0) || (image->rows == 0))
{
char
primitive[MaxTextExtent];
register char
*p;
SegmentInfo
bounds;
/*
Determine size of image canvas.
*/
while (ReadBlobString(image,primitive) != (char *) NULL)
{
for (p=primitive; (*p == ' ') || (*p == '\t'); p++) ;
if (LocaleNCompare(BoundingBox,p,strlen(BoundingBox)) != 0)
continue;
(void) sscanf(p,"viewbox %lf %lf %lf %lf",&bounds.x1,&bounds.y1,
&bounds.x2,&bounds.y2);
image->columns=(size_t) floor((bounds.x2-bounds.x1)+0.5);
image->rows=(size_t) floor((bounds.y2-bounds.y1)+0.5);
break;
}
}
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(OptionError,"MustSpecifyImageSize");
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
draw_info->affine.sx=image->x_resolution == 0.0 ? 1.0 : image->x_resolution/
DefaultResolution;
draw_info->affine.sy=image->y_resolution == 0.0 ? 1.0 : image->y_resolution/
DefaultResolution;
image->columns=(size_t) (draw_info->affine.sx*image->columns);
image->rows=(size_t) (draw_info->affine.sy*image->rows);
if (SetImageBackgroundColor(image) == MagickFalse)
{
InheritException(exception,&image->exception);
image=DestroyImageList(image);
return((Image *) NULL);
}
/*
Render drawing.
//.........这里部分代码省略.........
开发者ID:leloulight,项目名称:cs225,代码行数:101,代码来源:mvg.c
示例18: IdentifyImageCommand
//.........这里部分代码省略.........
{
if (LocaleCompare("debug",option+1) == 0)
{
ssize_t
event;
if (*option == '+')
break;
i++;
if (i == (ssize_t) argc)
ThrowIdentifyException(OptionError,"MissingArgument",option);
event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
if (event < 0)
ThrowIdentifyException(OptionError,"UnrecognizedEventType",
argv[i]);
(void) SetLogEventMask(argv[i]);
break;
}
if (LocaleCompare("define",option+1) == 0)
{
i++;
if (i == (ssize_t) argc)
ThrowIdentifyException(OptionError,"MissingArgument",option);
if (*option == '+')
{
const char
*define;
define=GetImageOption(image_info,argv[i]);
if (define == (const char *) NULL)
ThrowIdentifyException(OptionError,"NoSuchOption",argv[i]);
break;
}
if (LocaleNCompare("identify:locate",argv[i],14) == 0)
image_info->ping=MagickFalse;
break;
}
if (LocaleCompare("density",option+1) == 0)
{
if (*option == '+')
break;
i++;
if (i == (ssize_t) argc)
ThrowIdentifyException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowIdentifyInvalidArgumentException(option,argv[i]);
break;
}
if (LocaleCompare("depth",option+1) == 0)
{
if (*option == '+')
break;
i++;
if (i == (ssize_t) argc)
ThrowIdentifyException(OptionError,"MissingArgument",option);
if (IsGeometry(argv[i]) == MagickFalse)
ThrowIdentifyInvalidArgumentException(option,argv[i]);
break;
}
if (LocaleCompare("duration",option+1) == 0)
{
if (*option == '+')
break;
i++;
if (i == (ssize_t) (argc-1))
ThrowIdentifyException(OptionError,"MissingArgument",option);
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:67,代码来源:identify.c
示例19: LoadTypeList
static MagickBooleanType LoadTypeList(const char *xml,const char *filename,
const size_t depth,ExceptionInfo *exception)
{
char
font_path[MaxTextExtent],
keyword[MaxTextExtent],
*token;
const char
*q;
MagickBooleanType
status;
TypeInfo
*type_info;
/*
Load the type map file.
*/
(void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
"Loading type configure file \"%s\" ...",filename);
if (xml == (const char *) NULL)
return(MagickFalse);
if (type_list == (SplayTreeInfo *) NULL)
{
type_list=NewSplayTree(CompareSplayTreeString,(void *(*)(void *)) NULL,
DestroyTypeNode);
if (type_list == (SplayTreeInfo *) NULL)
{
ThrowFileException(exception,ResourceLimitError,
"MemoryAllocationFailed",filename);
return(MagickFalse);
}
}
status=MagickTrue;
type_info=(TypeInfo *) NULL;
token=AcquireString(xml);
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
/*
Determine the Ghostscript font path.
*/
*font_path='\0';
if (NTGhostscriptFonts(font_path,MaxTextExtent-2))
(void) ConcatenateMagickString(font_path,DirectorySeparator,MaxTextExtent);
#endif
for (q=(char *) xml; *q != '\0'; )
{
/*
Interpret XML.
*/
GetMagickToken(q,&q,token);
if (*token == '\0')
break;
(void) CopyMagickString(keyword,token,MaxTextExtent);
if (LocaleNCompare(keyword,"<!DOCTYPE",9) == 0)
{
/*
Doctype element.
*/
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
GetMagickToken(q,&q,token);
continue;
}
if (LocaleNCompare(keyword,"<!--",4) == 0)
{
/*
Comment element.
*/
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
GetMagickToken(q,&q,token);
continue;
}
if (LocaleCompare(keyword,"<include") == 0)
{
/*
Include element.
*/
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
{
(void) CopyMagickString(keyword,token,MaxTextExtent);
GetMagickToken(q,&q,token);
if (*token != '=')
continue;
GetMagickToken(q,&q,token);
if (LocaleCompare(keyword,"file") == 0)
{
if (depth > 200)
(void) ThrowMagickException(exception,GetMagickModule(),
ConfigureError,"IncludeNodeNestedTooDeeply","`%s'",token);
else
{
char
path[MaxTextExtent],
*xml;
ExceptionInfo
*sans_exception;
*path='\0';
//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,代码来源:type.c
示例20: ReadTXTImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e a d T X T I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ReadTXTImage() reads a text file and returns it as an image. It allocates
% the memory necessary for the new Image structure and returns a pointer to
% the new image.
%
% The format of the ReadTXTImage method is:
%
% Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image_info: the image info.
%
% o exception: return any errors or warnings in this structure.
%
*/
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
colorspace[MaxTextExtent],
text[MaxTextExtent];
Image
*image;
IndexPacket
*indexes;
long
type,
x_offset,
y,
y_offset;
MagickBooleanType
status;
MagickPixelPacket
pixel;
QuantumAny
range;
register ssize_t
i,
x;
register PixelPacket
*q;
ssize_t
count;
unsigned long
depth,
height,
max_value,
width;
/*
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
image=AcquireImage(image_info);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
image=DestroyImageList(image);
return((Image *) NULL);
}
(void) ResetMagickMemory(text,0,sizeof(text));
(void) ReadBlobString(image,text);
if (LocaleNCompare((char *) text,MagickID,strlen(MagickID)) != 0)
return(ReadTEXTImage(image_info,image,text,exception));
do
{
width=0;
height=0;
max_value=0;
*colorspace='\0';
count=(ssize_t) sscanf(text+32,"%lu,%lu,%lu,%s",&width,&hei
|
请发表评论