这篇教程C++ ConstantString函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ConstantString函数的典型用法代码示例。如果您正苦于以下问题:C++ ConstantString函数的具体用法?C++ ConstantString怎么用?C++ ConstantString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ConstantString函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetPolicyValue/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% G e t P o l i c y V a l u e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetPolicyValue() returns the value associated with the named policy.%% The format of the GetPolicyValue method is:%% char *GetPolicyValue(const char *name)%% A description of each parameter follows:%% o name: The name of the policy.%*/MagickExport char *GetPolicyValue(const char *name){ const char *value; const PolicyInfo *policy_info; ExceptionInfo *exception; assert(name != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",name); exception=AcquireExceptionInfo(); policy_info=GetPolicyInfo(name,exception); exception=DestroyExceptionInfo(exception); if (policy_info == (PolicyInfo *) NULL) return((char *) NULL); value=policy_info->value; if ((value == (const char *) NULL) || (*value == '/0')) return((char *) NULL); return(ConstantString(value));}
开发者ID:ImageMagick,项目名称:ImageMagick,代码行数:45,
示例2: GetConfigureOption/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% G e t C o n f i g u r e O p t i o n %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetConfigureOption() returns the value associated with the configure option.%% The format of the GetConfigureOption method is:%% char *GetConfigureOption(const char *option)%% A description of each parameter follows:%% o configure_info: The configure info.%*/MagickExport char *GetConfigureOption(const char *option){ const char *value; const ConfigureInfo *configure_info; ExceptionInfo *exception; assert(option != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",option); exception=AcquireExceptionInfo(); configure_info=GetConfigureInfo(option,exception); exception=DestroyExceptionInfo(exception); if (configure_info == (ConfigureInfo *) NULL) return((char *) NULL); value=GetConfigureValue(configure_info); if ((value == (const char *) NULL) || (*value == '/0')) return((char *) NULL); return(ConstantString(value));}
开发者ID:marsluong,项目名称:stupid,代码行数:45,
示例3: NewImageView/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% N e w I m a g e V i e w %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NewImageView() returns a image view required for all other methods in the% Image View API.%% The format of the NewImageView method is:%% ImageView *NewImageView(MagickCore *wand,ExceptionInfo *exception)%% A description of each parameter follows:%% o image: the image.%% o exception: return any errors or warnings in this structure.%*/MagickExport ImageView *NewImageView(Image *image,ExceptionInfo *exception){ ImageView *image_view; assert(image != (Image *) NULL); assert(image->signature == MagickSignature); image_view=(ImageView *) AcquireMagickMemory(sizeof(*image_view)); if (image_view == (ImageView *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(image_view,0,sizeof(*image_view)); image_view->description=ConstantString("ImageView"); image_view->image=image; image_view->view=AcquireVirtualCacheView(image_view->image,exception); image_view->extent.width=image->columns; image_view->extent.height=image->rows; image_view->extent.x=0; image_view->extent.y=0; image_view->exception=AcquireExceptionInfo(); image_view->debug=IsEventLogging(); image_view->signature=MagickSignature; return(image_view);}
开发者ID:rickwangtw,项目名称:ImageMagick,代码行数:48,
示例4: RegisterPANGOImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r P A N G O I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterPANGOImage() adds attributes for the Pango Markup Language format to% the list of supported formats. The attributes include the image format% tag, a method to read and/or write the format, whether the format% supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief% description of the format.%% The format of the RegisterPANGOImage method is:%% size_t RegisterPANGOImage(void)%*/ModuleExport size_t RegisterPANGOImage(void){ char version[MagickPathExtent]; MagickInfo *entry; *version='/0';#if defined(PANGO_VERSION_STRING) (void) FormatLocaleString(version,MagickPathExtent,"Pangocairo %s", PANGO_VERSION_STRING);#endif entry=AcquireMagickInfo("PANGO","PANGO","Pango Markup Language");#if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) entry->decoder=(DecodeImageHandler *) ReadPANGOImage;#endif if (*version != '/0') entry->version=ConstantString(version); entry->flags^=CoderAdjoinFlag; (void) RegisterMagickInfo(entry); return(MagickImageCoderSignature);}
开发者ID:edalquist,项目名称:ImageMagick,代码行数:46,
示例5: RegisterCALSImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r C A L S I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterCALSImage() adds attributes for the CALS Raster Group 1 image file% image format to the list of supported formats. The attributes include the% image format tag, a method to read and/or write the format, whether the% format supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief description% of the format.%% The format of the RegisterCALSImage method is:%% size_t RegisterCALSImage(void)%*/ModuleExport size_t RegisterCALSImage(void){ MagickInfo *entry; static const char *CALSDescription= { "Continuous Acquisition and Life-cycle Support Type 1" }, *CALSNote= { "Specified in MIL-R-28002 and MIL-PRF-28002" }; entry=SetMagickInfo("CAL"); entry->decoder=(DecodeImageHandler *) ReadCALSImage;#if defined(MAGICKCORE_TIFF_DELEGATE) entry->encoder=(EncodeImageHandler *) WriteCALSImage;#endif entry->adjoin=MagickFalse; entry->magick=(IsImageFormatHandler *) IsCALS; entry->description=ConstantString(CALSDescription); entry->note=ConstantString(CALSNote); entry->module=ConstantString("CALS"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("CALS"); entry->decoder=(DecodeImageHandler *) ReadCALSImage;#if defined(MAGICKCORE_TIFF_DELEGATE) entry->encoder=(EncodeImageHandler *) WriteCALSImage;#endif entry->adjoin=MagickFalse; entry->magick=(IsImageFormatHandler *) IsCALS; entry->description=ConstantString(CALSDescription); entry->note=ConstantString(CALSNote); entry->module=ConstantString("CALS"); (void) RegisterMagickInfo(entry); return(MagickImageCoderSignature);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:62,
示例6: RegisterEPTImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r E P T I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterEPTImage() adds attributes for the EPT image format to% the list of supported formats. The attributes include the image format% tag, a method to read and/or write the format, whether the format% supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief% description of the format.%% The format of the RegisterEPTImage method is:%% size_t RegisterEPTImage(void)%*/ModuleExport size_t RegisterEPTImage(void){ MagickInfo *entry; entry=SetMagickInfo("EPT"); entry->decoder=(DecodeImageHandler *) ReadEPTImage; entry->encoder=(EncodeImageHandler *) WriteEPTImage; entry->magick=(IsImageFormatHandler *) IsEPT; entry->seekable_stream=MagickTrue; entry->adjoin=MagickFalse; entry->blob_support=MagickFalse; entry->description=ConstantString( "Encapsulated PostScript with TIFF preview"); entry->module=ConstantString("EPT"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPT2"); entry->decoder=(DecodeImageHandler *) ReadEPTImage; entry->encoder=(EncodeImageHandler *) WriteEPTImage; entry->magick=(IsImageFormatHandler *) IsEPT; entry->adjoin=MagickFalse; entry->seekable_stream=MagickTrue; entry->blob_support=MagickFalse; entry->description=ConstantString( "Encapsulated PostScript Level II with TIFF preview"); entry->module=ConstantString("EPT"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("EPT3"); entry->decoder=(DecodeImageHandler *) ReadEPTImage; entry->encoder=(EncodeImageHandler *) WriteEPTImage; entry->magick=(IsImageFormatHandler *) IsEPT; entry->seekable_stream=MagickTrue; entry->blob_support=MagickFalse; entry->description=ConstantString( "Encapsulated PostScript Level III with TIFF preview"); entry->module=ConstantString("EPT"); (void) RegisterMagickInfo(entry); return(MagickImageCoderSignature);}
开发者ID:ChaseReid,项目名称:ImageMagick,代码行数:62,
示例7: RegisterPS2Image/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r P S 2 I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterPS2Image() adds properties for the PS2 image format to% the list of supported formats. The properties include the image format% tag, a method to read and/or write the format, whether the format% supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief% description of the format.%% The format of the RegisterPS2Image method is:%% size_t RegisterPS2Image(void)%*/ModuleExport size_t RegisterPS2Image(void){ MagickInfo *entry; entry=SetMagickInfo("EPS2"); entry->encoder=(EncodeImageHandler *) WritePS2Image; entry->adjoin=MagickFalse; entry->seekable_stream=MagickTrue; entry->description=ConstantString("Level II Encapsulated PostScript"); entry->mime_type=ConstantString("application/postscript"); entry->module=ConstantString("PS2"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("PS2"); entry->encoder=(EncodeImageHandler *) WritePS2Image; entry->seekable_stream=MagickTrue; entry->description=ConstantString("Level II PostScript"); entry->mime_type=ConstantString("application/postscript"); entry->module=ConstantString("PS2"); (void) RegisterMagickInfo(entry); return(MagickImageCoderSignature);}
开发者ID:INT2208-ST,项目名称:MyFriend,代码行数:45,
示例8: GetConfigurePaths/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% G e t C o n f i g u r e P a t h s %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetConfigurePaths() returns any Magick configuration paths associated% with the specified filename.%% The format of the GetConfigurePaths method is:%% LinkedListInfo *GetConfigurePaths(const char *filename,% ExceptionInfo *exception)%% A description of each parameter follows:%% o filename: the configure file name.%% o exception: return any errors or warnings in this structure.%*/MagickExport LinkedListInfo *GetConfigurePaths(const char *filename, ExceptionInfo *exception){#define RegistryKey "ConfigurePath"#define MagickCoreDLL "CORE_RL_magick_.dll"#define MagickCoreDebugDLL "CORE_DB_magick_.dll" char path[MaxTextExtent]; LinkedListInfo *paths; assert(filename != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename); assert(exception != (ExceptionInfo *) NULL); (void) CopyMagickString(path,filename,MaxTextExtent); paths=NewLinkedList(0); { char *configure_path; /* Search $MAGICK_CONFIGURE_PATH. */ configure_path=GetEnvironmentValue("MAGICK_CONFIGURE_PATH"); if (configure_path != (char *) NULL) { register char *p, *q; for (p=configure_path-1; p != (char *) NULL; ) { (void) CopyMagickString(path,p+1,MaxTextExtent); q=strchr(path,DirectoryListSeparator); if (q != (char *) NULL) *q='/0'; q=path+strlen(path)-1; if ((q >= path) && (*q != *DirectorySeparator)) (void) ConcatenateMagickString(path,DirectorySeparator, MaxTextExtent); (void) AppendValueToLinkedList(paths,ConstantString(path)); p=strchr(p+1,DirectoryListSeparator); } configure_path=DestroyString(configure_path); } }#if defined(MAGICKCORE_INSTALLED_SUPPORT)#if defined(MAGICKCORE_SHARE_PATH) (void) AppendValueToLinkedList(paths,ConstantString(MAGICKCORE_SHARE_PATH));#endif#if defined(MAGICKCORE_SHAREARCH_PATH) (void) AppendValueToLinkedList(paths,ConstantString( MAGICKCORE_SHAREARCH_PATH));#endif#if defined(MAGICKCORE_CONFIGURE_PATH) (void) AppendValueToLinkedList(paths,ConstantString( MAGICKCORE_CONFIGURE_PATH));#endif#if defined(MAGICKCORE_DOCUMENTATION_PATH) (void) AppendValueToLinkedList(paths,ConstantString( MAGICKCORE_DOCUMENTATION_PATH));#endif#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_PATH)) { unsigned char *key_value; /* Locate file via registry key. */ key_value=NTRegistryKeyLookup(RegistryKey); if (key_value != (unsigned char *) NULL)//.........这里部分代码省略.........
开发者ID:MaximOrlovsky,项目名称:unix-toolbox.js-imagemagick,代码行数:101,
示例9: LoadConfigureList//.........这里部分代码省略......... (void) ThrowMagickException(exception,GetMagickModule(), ConfigureError,"IncludeElementNestedTooDeeply","`%s'",token); else { char path[MaxTextExtent], *xml; GetPathComponent(filename,HeadPath,path); if (*path != '/0') (void) ConcatenateMagickString(path,DirectorySeparator, MaxTextExtent); if (*token == *DirectorySeparator) (void) CopyMagickString(path,token,MaxTextExtent); else (void) ConcatenateMagickString(path,token,MaxTextExtent); xml=FileToString(path,~0,exception); if (xml != (char *) NULL) { status=LoadConfigureList(xml,path,depth+1,exception); xml=(char *) RelinquishMagickMemory(xml); } } } } continue; } if (LocaleCompare(keyword,"<configure") == 0) { /* Configure element. */ configure_info=(ConfigureInfo *) AcquireMagickMemory( sizeof(*configure_info)); if (configure_info == (ConfigureInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(configure_info,0,sizeof(*configure_info)); configure_info->path=ConstantString(filename); configure_info->exempt=MagickFalse; configure_info->signature=MagickSignature; continue; } if (configure_info == (ConfigureInfo *) NULL) continue; if (LocaleCompare(keyword,"/>") == 0) { status=AppendValueToLinkedList(configure_list,configure_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", configure_info->name); configure_info=(ConfigureInfo *) NULL; } /* Parse configure element. */ GetMagickToken(q,(const char **) NULL,token); if (*token != '=') continue; GetMagickToken(q,&q,token); GetMagickToken(q,&q,token); switch (*keyword) { case 'N': case 'n': { if (LocaleCompare((char *) keyword,"name") == 0) { configure_info->name=ConstantString(token); break; } break; } case 'S': case 's': { if (LocaleCompare((char *) keyword,"stealth") == 0) { configure_info->stealth=IsMagickTrue(token); break; } break; } case 'V': case 'v': { if (LocaleCompare((char *) keyword,"value") == 0) { configure_info->value=ConstantString(token); break; } break; } default: break; } } token=(char *) RelinquishMagickMemory(token); return(status);}
开发者ID:MaximOrlovsky,项目名称:unix-toolbox.js-imagemagick,代码行数:101,
示例10: SetImageRegistryMagickExport MagickBooleanType SetImageRegistry(const RegistryType type, const char *key,const void *value,ExceptionInfo *exception){ MagickBooleanType status; RegistryInfo *registry_info; void *clone_value; if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",key); clone_value=(void *) NULL; switch (type) { case StringRegistryType: default: { const char *string; string=(const char *) value; clone_value=(void *) ConstantString(string); break; } case ImageRegistryType: { const Image *image; image=(const Image *) value; if (image->signature != MagickSignature) { (void) ThrowMagickException(exception,GetMagickModule(),RegistryError, "UnableToSetRegistry","%s",key); return(MagickFalse); } clone_value=(void *) CloneImageList(image,exception); break; } case ImageInfoRegistryType: { const ImageInfo *image_info; image_info=(const ImageInfo *) value; if (image_info->signature != MagickSignature) { (void) ThrowMagickException(exception,GetMagickModule(),RegistryError, "UnableToSetRegistry","%s",key); return(MagickFalse); } clone_value=(void *) CloneImageInfo(image_info); break; } } if (clone_value == (void *) NULL) return(MagickFalse); registry_info=(RegistryInfo *) AcquireMagickMemory(sizeof(*registry_info)); if (registry_info == (RegistryInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(registry_info,0,sizeof(*registry_info)); registry_info->type=type; registry_info->value=clone_value; registry_info->signature=MagickSignature; if ((registry == (SplayTreeInfo *) NULL) && (instantiate_registry == MagickFalse)) { if (registry_semaphore == (SemaphoreInfo *) NULL) AcquireSemaphoreInfo(®istry_semaphore); LockSemaphoreInfo(registry_semaphore); if ((registry == (SplayTreeInfo *) NULL) && (instantiate_registry == MagickFalse)) { registry=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory, DestroyRegistryNode); instantiate_registry=MagickTrue; } UnlockSemaphoreInfo(registry_semaphore); } status=AddValueToSplayTree(registry,ConstantString(key),registry_info); return(status);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:85,
示例11: GetImageRegistry/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% G e t I m a g e R e g i s t r y %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetImageRegistry() returns a value associated with an image registry key.%% The format of the GetImageRegistry method is:%% void *GetImageRegistry(const RegistryType type,const char *key,% ExceptionInfo *exception)%% A description of each parameter follows:%% o type: the type.%% o key: the key.%% o exception: the exception.%*/MagickExport void *GetImageRegistry(const RegistryType type,const char *key, ExceptionInfo *exception){ void *value; RegistryInfo *registry_info; if (IsEventLogging() != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",key); if (registry == (void *) NULL) return((void *) NULL); registry_info=(RegistryInfo *) GetValueFromSplayTree(registry,key); if (registry_info == (void *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(),RegistryError, "UnableToGetRegistryID","`%s'",key); return((void *) NULL); } value=(void *) NULL; switch (type) { case ImageRegistryType: { if (type == registry_info->type) value=(void *) CloneImageList((Image *) registry_info->value,exception); break; } case ImageInfoRegistryType: { if (type == registry_info->type) value=(void *) CloneImageInfo((ImageInfo *) registry_info->value); break; } case StringRegistryType: { switch (registry_info->type) { case ImageRegistryType: { value=(Image *) ConstantString(((Image *) registry_info->value)->filename); break; } case ImageInfoRegistryType: { value=(Image *) ConstantString(((ImageInfo *) registry_info->value)->filename); break; } case StringRegistryType: { value=(void *) ConstantString((char *) registry_info->value); break; } default: break; } break; } default: break; } return(value);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:93,
示例12: ThrowFatalExceptionstatic SplayTreeInfo *AcquireCoderCache(const char *filename, ExceptionInfo *exception){ const StringInfo *option; LinkedListInfo *options; MagickStatusType status; register ssize_t i; SplayTreeInfo *coder_cache; /* Load external coder map. */ coder_cache=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory, DestroyCoderNode); if (coder_cache == (SplayTreeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); status=MagickTrue; options=GetConfigureOptions(filename,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); while (option != (const StringInfo *) NULL) { status&=LoadCoderCache(coder_cache,(const char *) GetStringInfoDatum(option),GetStringInfoPath(option),0,exception); option=(const StringInfo *) GetNextValueInLinkedList(options); } options=DestroyConfigureOptions(options); /* Load built-in coder map. */ for (i=0; i < (ssize_t) (sizeof(CoderMap)/sizeof(*CoderMap)); i++) { CoderInfo *coder_info; register const CoderMapInfo *p; p=CoderMap+i; coder_info=(CoderInfo *) AcquireMagickMemory(sizeof(*coder_info)); if (coder_info == (CoderInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",p->name); continue; } (void) ResetMagickMemory(coder_info,0,sizeof(*coder_info)); coder_info->path=(char *) "[built-in]"; coder_info->magick=(char *) p->magick; coder_info->name=(char *) p->name; coder_info->exempt=MagickTrue; coder_info->signature=MagickCoreSignature; status&=AddValueToSplayTree(coder_cache,ConstantString(coder_info->magick), coder_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",coder_info->name); } return(coder_cache);}
开发者ID:hj3938,项目名称:ImageMagick,代码行数:68,
示例13: LoadTypeList//.........这里部分代码省略......... *sans_exception; *path='/0'; GetPathComponent(filename,HeadPath,path); if (*path != '/0') (void) ConcatenateMagickString(path,DirectorySeparator, MaxTextExtent); if (*token == *DirectorySeparator) (void) CopyMagickString(path,token,MaxTextExtent); else (void) ConcatenateMagickString(path,token,MaxTextExtent); sans_exception=AcquireExceptionInfo(); xml=FileToString(path,~0UL,sans_exception); sans_exception=DestroyExceptionInfo(sans_exception); if (xml != (char *) NULL) { status=LoadTypeList(xml,path,depth+1,exception); xml=(char *) RelinquishMagickMemory(xml); } } } } continue; } if (LocaleCompare(keyword,"<type") == 0) { /* Type element. */ type_info=(TypeInfo *) AcquireMagickMemory(sizeof(*type_info)); if (type_info == (TypeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(type_info,0,sizeof(*type_info)); type_info->path=ConstantString(filename); type_info->signature=MagickSignature; continue; } if (type_info == (TypeInfo *) NULL) continue; if (LocaleCompare(keyword,"/>") == 0) { status=AddValueToSplayTree(type_list,type_info->name,type_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'",type_info->name); type_info=(TypeInfo *) NULL; } GetMagickToken(q,(const char **) NULL,token); if (*token != '=') continue; GetMagickToken(q,&q,token); GetMagickToken(q,&q,token); switch (*keyword) { case 'E': case 'e': { if (LocaleCompare((char *) keyword,"encoding") == 0) { type_info->encoding=ConstantString(token); break; } break; } case 'F': case 'f':
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:67,
示例14: assert/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e a d V I D I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ReadVIDImage reads one of more images and creates a Visual Image% Directory file. It allocates the memory necessary for the new Image% structure and returns a pointer to the new image.%% The format of the ReadVIDImage method is:%% Image *ReadVIDImage(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 *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception){#define ClientName "montage" char **filelist, *label; Image *image, *images, *montage_image, *next_image, *thumbnail_image; ImageInfo *read_info; int number_files; MagickBooleanType status; MontageInfo *montage_info; RectangleInfo geometry; register ssize_t i; /* Expand the filename. */ 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); filelist=(char **) AcquireAlignedMemory(1,sizeof(*filelist)); if (filelist == (char **) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); filelist[0]=ConstantString(image_info->filename); number_files=1; status=ExpandFilenames(&number_files,&filelist); if ((status == MagickFalse) || (number_files == 0)) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); image=DestroyImage(image); /* Read each image and convert them to a tile. */ images=NewImageList(); read_info=CloneImageInfo(image_info); SetImageInfoBlob(read_info,(void *) NULL,0); (void) SetImageInfoProgressMonitor(read_info,(MagickProgressMonitor) NULL, (void *) NULL); if (read_info->size == (char *) NULL) (void) CloneString(&read_info->size,DefaultTileGeometry); for (i=0; i < (ssize_t) number_files; i++) { if (image_info->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(),"name: %s", filelist[i]); (void) CopyMagickString(read_info->filename,filelist[i],MaxTextExtent); filelist[i]=DestroyString(filelist[i]); *read_info->magick='/0'; next_image=ReadImage(read_info,exception); CatchException(exception); if (next_image == (Image *) NULL)//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例15: ReadLABELImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e a d L A B E L I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ReadLABELImage() reads a LABEL image file and returns it. It% allocates the memory necessary for the new Image structure and returns a% pointer to the new image.%% The format of the ReadLABELImage method is:%% Image *ReadLABELImage(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 *ReadLABELImage(const ImageInfo *image_info, ExceptionInfo *exception){ char geometry[MaxTextExtent], *property; const char *label; DrawInfo *draw_info; Image *image; MagickBooleanType status; TypeMetric metrics; size_t height, width; /* Initialize Image structure. */ 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); (void) ResetImagePage(image,"0x0+0+0"); property=InterpretImageProperties(image_info,image,image_info->filename); (void) SetImageProperty(image,"label",property); property=DestroyString(property); label=GetImageProperty(image,"label"); draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); draw_info->text=ConstantString(label); if (((image->columns != 0) || (image->rows != 0)) && (image_info->pointsize == 0.0)) { /* Fit label to canvas size. */ status=GetMultilineTypeMetrics(image,draw_info,&metrics); for ( ; status != MagickFalse; draw_info->pointsize*=2.0) { width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); if (((image->columns != 0) && (width > (image->columns+1))) || ((image->rows != 0) && (height > (image->rows+1)))) break; status=GetMultilineTypeMetrics(image,draw_info,&metrics); } for ( ; status != MagickFalse; draw_info->pointsize--) { width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5); height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); if ((image->columns != 0) && (width <= (image->columns+1)) && ((image->rows == 0) || (height <= (image->rows+1)))) break; if ((image->rows != 0) && (height <= (image->rows+1)) && ((image->columns == 0) || (width <= (image->columns+1)))) break; if (draw_info->pointsize < 2.0) break; status=GetMultilineTypeMetrics(image,draw_info,&metrics);//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例16: ReadCAPTIONImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e a d C A P T I O N I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ReadCAPTIONImage() reads a CAPTION image file and returns it. It% allocates the memory necessary for the new Image structure and returns a% pointer to the new image.%% The format of the ReadCAPTIONImage method is:%% Image *ReadCAPTIONImage(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 *ReadCAPTIONImage(const ImageInfo *image_info, ExceptionInfo *exception){ char *caption, geometry[MaxTextExtent], *property; const char *gravity; DrawInfo *draw_info; Image *image; MagickBooleanType status; register long i; TypeMetric metrics; unsigned long height, width; /* Initialize Image structure. */ 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); if (image->columns == 0) ThrowReaderException(OptionError,"MustSpecifyImageSize"); (void) ResetImagePage(image,"0x0+0+0"); /* Format caption. */ property=InterpretImageProperties(image_info,image,image_info->filename); (void) SetImageProperty(image,"caption",property); property=DestroyString(property); caption=ConstantString(GetImageProperty(image,"caption")); draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); draw_info->text=ConstantString(caption); gravity=GetImageOption(image_info,"gravity"); if (gravity != (char *) NULL) draw_info->gravity=(GravityType) ParseMagickOption(MagickGravityOptions, MagickFalse,gravity); if ((*caption != '/0') && (image->rows != 0) && (image_info->pointsize == 0.0)) { char *text; /* Scale text to fit bounding box. */ for ( ; ; ) { text=AcquireString(caption); i=FormatMagickCaption(image,draw_info,&metrics,&text); (void) CloneString(&draw_info->text,text); text=DestroyString(text); (void) FormatMagickString(geometry,MaxTextExtent,"%+g%+g",//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例17: LoadMagicCache//.........这里部分代码省略......... char path[MaxTextExtent], *xml; GetPathComponent(filename,HeadPath,path); if (*path != '/0') (void) ConcatenateMagickString(path,DirectorySeparator, MaxTextExtent); if (*token == *DirectorySeparator) (void) CopyMagickString(path,token,MaxTextExtent); else (void) ConcatenateMagickString(path,token,MaxTextExtent); xml=FileToXML(path,~0UL); if (xml != (char *) NULL) { status&=LoadMagicCache(magic_cache,xml,path,depth+1, exception); xml=(char *) RelinquishMagickMemory(xml); } } } } continue; } if (LocaleCompare(keyword,"<magic") == 0) { /* Magic element. */ magic_info=(MagicInfo *) AcquireMagickMemory(sizeof(*magic_info)); if (magic_info == (MagicInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(magic_info,0,sizeof(*magic_info)); magic_info->path=ConstantString(filename); magic_info->exempt=MagickFalse; magic_info->signature=MagickSignature; continue; } if (magic_info == (MagicInfo *) NULL) continue; if (LocaleCompare(keyword,"/>") == 0) { status=AppendValueToLinkedList(magic_cache,magic_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", magic_info->name); magic_info=(MagicInfo *) NULL; continue; } GetMagickToken(q,(const char **) NULL,token); if (*token != '=') continue; GetMagickToken(q,&q,token); GetMagickToken(q,&q,token); switch (*keyword) { case 'N': case 'n': { if (LocaleCompare((char *) keyword,"name") == 0) { magic_info->name=ConstantString(token); break; } break;
开发者ID:GalliumOS,项目名称:imagemagick,代码行数:67,
示例18: ReadDNGImage//.........这里部分代码省略......... (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) CloseBlob(image); (void) DestroyImageList(image); /* Convert DNG to PPM with delegate. */ image=AcquireImage(image_info); read_info=CloneImageInfo(image_info); (void) InvokeDelegate(read_info,image,"dng:decode",(char *) NULL,exception); image=DestroyImage(image); (void) FormatMagickString(read_info->filename,MaxTextExtent,"%s.png", read_info->unique); sans_exception=AcquireExceptionInfo(); image=ReadImage(read_info,sans_exception); sans_exception=DestroyExceptionInfo(sans_exception); if (image == (Image *) NULL) { (void) FormatMagickString(read_info->filename,MaxTextExtent,"%s.ppm", read_info->unique); image=ReadImage(read_info,exception); } (void) RelinquishUniqueFileResource(read_info->filename); if (image != (Image *) NULL) { char filename[MaxTextExtent], *xml; ExceptionInfo *sans; (void) CopyMagickString(image->magick,read_info->magick,MaxTextExtent); (void) FormatMagickString(filename,MaxTextExtent,"%s.ufraw", read_info->unique); sans=AcquireExceptionInfo(); xml=FileToString(filename,MaxTextExtent,sans); (void) RelinquishUniqueFileResource(filename); if (xml != (char *) NULL) { XMLTreeInfo *ufraw; /* Inject */ ufraw=NewXMLTree(xml,sans); if (ufraw != (XMLTreeInfo *) NULL) { char *content, property[MaxTextExtent]; const char *tag; XMLTreeInfo *next; if (image->properties == (void *) NULL) ((Image *) image)->properties=NewSplayTree( CompareSplayTreeString,RelinquishMagickMemory, RelinquishMagickMemory); next=GetXMLTreeChild(ufraw,(const char *) NULL); while (next != (XMLTreeInfo *) NULL) { tag=GetXMLTreeTag(next); if (tag == (char *) NULL) tag="unknown"; (void) FormatMagickString(property,MaxTextExtent,"dng:%s",tag); content=ConstantString(GetXMLTreeContent(next)); StripString(content); if ((LocaleCompare(tag,"log") != 0) && (LocaleCompare(tag,"InputFilename") != 0) && (LocaleCompare(tag,"OutputFilename") != 0) && (LocaleCompare(tag,"OutputType") != 0) && (strlen(content) != 0)) (void) AddValueToSplayTree((SplayTreeInfo *) ((Image *) image)->properties,ConstantString(property), content); next=GetXMLTreeSibling(next); } ufraw=DestroyXMLTree(ufraw); } xml=DestroyString(xml); } sans=DestroyExceptionInfo(sans); } read_info=DestroyImageInfo(read_info); return(image);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例19: RegisterDNGImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r D N G I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterDNGImage() adds attributes for the DNG image format to% the list of supported formats. The attributes include the image format% tag, a method to read and/or write the format, whether the format% supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief% description of the format.%% The format of the RegisterDNGImage method is:%% unsigned long RegisterDNGImage(void)%*/ModuleExport unsigned long RegisterDNGImage(void){ MagickInfo *entry; entry=SetMagickInfo("ARW"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Sony Alpha Raw Image Format"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("DNG"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Digital Negative"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("CR2"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Canon Digital Camera Raw Image Format"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("CRW"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Canon Digital Camera Raw Image Format"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("DCR"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Kodak Digital Camera Raw Image File"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("ERF"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Epson RAW Format"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("KDC"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Kodak Digital Camera Raw Image Format"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("K25"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Kodak Digital Camera Raw Image Format"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("MRW"); entry->decoder=(DecodeImageHandler *) ReadDNGImage; entry->blob_support=MagickFalse; entry->seekable_stream=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Sony (Minolta) Raw Image File"); entry->module=ConstantString("DNG"); (void) RegisterMagickInfo(entry);//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例20: assert//.........这里部分代码省略......... if (*p++ == '"') { if (active != MagickFalse) *q++='/n'; active=active != MagickFalse ? MagickFalse : MagickTrue; } if (active != MagickFalse) *q++=(*p); } *q='/0'; /* Initialize image structure. */ xpm_colors=NewSplayTree(CompareXPMColor,RelinquishMagickMemory, (void *(*)(void *)) NULL); if (AcquireImageColormap(image,image->colors) == MagickFalse) { xpm_buffer=DestroyString(xpm_buffer); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } /* Read image colormap. */ image->depth=1; next=NextXPMLine(xpm_buffer); for (j=0; (j < (ssize_t) image->colors) && (next != (char *) NULL); j++) { MagickPixelPacket pixel; p=next; next=NextXPMLine(p); (void) CopyXPMColor(key,p,MagickMin((size_t) width,MaxTextExtent-1)); status=AddValueToSplayTree(xpm_colors,ConstantString(key),(void *) j); /* Parse color. */ (void) CopyMagickString(target,"gray",MaxTextExtent); q=ParseXPMColor(p+width,MagickTrue); if (q != (char *) NULL) { while ((isspace((int) ((unsigned char) *q)) == 0) && (*q != '/0')) q++; if ((next-q) < 0) break; if (next != (char *) NULL) (void) CopyXPMColor(target,q,MagickMin((size_t) (next-q), MaxTextExtent-1)); else (void) CopyMagickString(target,q,MaxTextExtent); q=ParseXPMColor(target,MagickFalse); if (q != (char *) NULL) *q='/0'; } StripString(target); grey=strstr(target,"grey"); if (grey != (char *) NULL) grey[2]='a'; if (LocaleCompare(target,"none") == 0) { image->storage_class=DirectClass; image->matte=MagickTrue; } status=QueryColorCompliance(target,XPMCompliance,&image->colormap[j], exception); if (status == MagickFalse)
开发者ID:MarinaAndenko,项目名称:MyBlog,代码行数:67,
示例21: LoadFontConfigFontsMagickExport MagickBooleanType LoadFontConfigFonts(SplayTreeInfo *type_list, ExceptionInfo *exception){#if !defined(FC_FULLNAME)#define FC_FULLNAME "fullname"#endif char extension[MaxTextExtent], name[MaxTextExtent]; FcChar8 *family, *file, *fullname, *style; FcConfig *font_config; FcFontSet *font_set; FcObjectSet *object_set; FcPattern *pattern; FcResult status; int slant, width, weight; register ssize_t i; TypeInfo *type_info; /* Load system fonts. */ (void) exception; font_config=FcInitLoadConfigAndFonts(); if (font_config == (FcConfig *) NULL) return(MagickFalse); font_set=(FcFontSet *) NULL; object_set=FcObjectSetBuild(FC_FULLNAME,FC_FAMILY,FC_STYLE,FC_SLANT, FC_WIDTH,FC_WEIGHT,FC_FILE,(char *) NULL); if (object_set != (FcObjectSet *) NULL) { pattern=FcPatternCreate(); if (pattern != (FcPattern *) NULL) { font_set=FcFontList(0,pattern,object_set); FcPatternDestroy(pattern); } FcObjectSetDestroy(object_set); } if (font_set == (FcFontSet *) NULL) { FcConfigDestroy(font_config); return(MagickFalse); } for (i=0; i < (ssize_t) font_set->nfont; i++) { status=FcPatternGetString(font_set->fonts[i],FC_FAMILY,0,&family); if (status != FcResultMatch) continue; status=FcPatternGetString(font_set->fonts[i],FC_FILE,0,&file); if (status != FcResultMatch) continue; *extension='/0'; GetPathComponent((const char *) file,ExtensionPath,extension); if ((*extension != '/0') && (LocaleCompare(extension,"gz") == 0)) continue; type_info=(TypeInfo *) AcquireMagickMemory(sizeof(*type_info)); if (type_info == (TypeInfo *) NULL) continue; (void) ResetMagickMemory(type_info,0,sizeof(*type_info)); type_info->path=ConstantString("System Fonts"); type_info->signature=MagickSignature; (void) CopyMagickString(name,"Unknown",MaxTextExtent); status=FcPatternGetString(font_set->fonts[i],FC_FULLNAME,0,&fullname); if ((status == FcResultMatch) && (fullname != (FcChar8 *) NULL)) (void) CopyMagickString(name,(const char *) fullname,MaxTextExtent); else { if (family != (FcChar8 *) NULL) (void) CopyMagickString(name,(const char *) family,MaxTextExtent); status=FcPatternGetString(font_set->fonts[i],FC_STYLE,0,&style); if ((status == FcResultMatch) && (style != (FcChar8 *) NULL) && (LocaleCompare((const char *) style,"Regular") != 0)) { (void) ConcatenateMagickString(name," ",MaxTextExtent); (void) ConcatenateMagickString(name,(const char *) style,//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例22: NTAcquireTypeCache//.........这里部分代码省略......... registry_index = 0, type, value_data_size, value_name_length; char value_data[MaxTextExtent], value_name[MaxTextExtent]; res = ERROR_SUCCESS; while (res != ERROR_NO_MORE_ITEMS) { char *family_extent, token[MaxTextExtent], *pos, *q; value_name_length = sizeof(value_name) - 1; value_data_size = sizeof(value_data) - 1; res=RegEnumValueA(reg_key,registry_index,value_name,&value_name_length, 0,&type,(BYTE *) value_data,&value_data_size); registry_index++; if (res != ERROR_SUCCESS) continue; if ((pos=strstr(value_name," (TrueType)")) == (char*) NULL) continue; *pos='/0'; /* Remove (TrueType) from string */ type_info=(TypeInfo *) AcquireMagickMemory(sizeof(*type_info)); if (type_info == (TypeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(type_info,0,sizeof(TypeInfo)); type_info->path=ConstantString("Windows Fonts"); type_info->signature=MagickSignature; (void) CopyMagickString(buffer,value_name,MaxTextExtent); /* name */ for (pos=buffer; *pos != 0; pos++) if (*pos == ' ') *pos='-'; type_info->name=ConstantString(buffer); type_info->description=ConstantString(value_name); /* fullname */ type_info->format=ConstantString("truetype"); /* format */ if (strchr(value_data,'//') != (char *) NULL) /* glyphs */ (void) CopyMagickString(buffer,value_data,MaxTextExtent); else { (void) CopyMagickString(buffer,font_root,MaxTextExtent); (void) ConcatenateMagickString(buffer,value_data,MaxTextExtent); } LocaleLower(buffer); type_info->glyphs=ConstantString(buffer); type_info->stretch=NormalStretch; type_info->style=NormalStyle; type_info->weight=400; /* Some fonts are known to require special encodings. */ if ( (LocaleCompare(type_info->name, "Symbol") == 0 ) || (LocaleCompare(type_info->name, "Wingdings") == 0 ) || (LocaleCompare(type_info->name, "Wingdings-2") == 0 ) || (LocaleCompare(type_info->name, "Wingdings-3") == 0 ) ) type_info->encoding=ConstantString("AppleRoman"); family_extent=value_name; for (q=value_name; *q != '/0'; ) { GetMagickToken(q,(const char **) &q,token);
开发者ID:CamiloBenavides,项目名称:SnoutPoint-Web,代码行数:67,
示例23: assert//.........这里部分代码省略......... if (*p == '=') { p+=2; while (isspace((int) ((unsigned char) *p)) != 0) p++; } if (LocaleCompare(keyword,"end") == 0) break; if (LocaleCompare(keyword,"extend") == 0) fits_info.extend=(*p == 'T') || (*p == 't') ? MagickTrue : MagickFalse; if (LocaleCompare(keyword,"simple") == 0) fits_info.simple=(*p == 'T') || (*p == 't') ? MagickTrue : MagickFalse; if (LocaleCompare(keyword,"bitpix") == 0) fits_info.bits_per_pixel=StringToLong(p); if (LocaleCompare(keyword,"naxis") == 0) fits_info.number_axes=StringToLong(p); if (LocaleCompare(keyword,"naxis1") == 0) fits_info.columns=StringToLong(p); if (LocaleCompare(keyword,"naxis2") == 0) fits_info.rows=StringToLong(p); if (LocaleCompare(keyword,"naxis3") == 0) fits_info.number_planes=StringToLong(p); if (LocaleCompare(keyword,"datamax") == 0) fits_info.max_data=InterpretLocaleValue(p,(char **) NULL); if (LocaleCompare(keyword,"datamin") == 0) fits_info.min_data=InterpretLocaleValue(p,(char **) NULL); if (LocaleCompare(keyword,"bzero") == 0) fits_info.zero=InterpretLocaleValue(p,(char **) NULL); if (LocaleCompare(keyword,"bscale") == 0) fits_info.scale=InterpretLocaleValue(p,(char **) NULL); if (LocaleCompare(keyword,"comment") == 0) { if (comment == (char *) NULL) comment=ConstantString(p); else (void) ConcatenateString(&comment,p); } if (LocaleCompare(keyword,"xendian") == 0) { if (LocaleNCompare(p,"big",3) == 0) fits_info.endian=MSBEndian; else fits_info.endian=LSBEndian; } (void) FormatLocaleString(property,MaxTextExtent,"fits:%s",keyword); (void) SetImageProperty(image,property,p); } c=0; while (((TellBlob(image) % FITSBlocksize) != 0) && (c != EOF)) c=ReadBlobByte(image); if (fits_info.extend == MagickFalse) break; number_pixels=(MagickSizeType) fits_info.columns*fits_info.rows; if ((fits_info.simple != MagickFalse) && (fits_info.number_axes >= 1) && (fits_info.number_axes <= 4) && (number_pixels != 0)) break; } /* Verify that required image information is defined. */ if (comment != (char *) NULL) { (void) SetImageProperty(image,"comment",comment); comment=DestroyString(comment); } if (EOFBlob(image) != MagickFalse)
开发者ID:Deni-al,项目名称:Android-ImageMagick,代码行数:67,
示例24: RegisterRGBImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r R G B I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterRGBImage() adds attributes for the RGB or RGBA image format to% the list of supported formats. The attributes include the image format% tag, a method to read and/or write the format, whether the format% supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief% description of the format.%% The format of the RegisterRGBImage method is:%% unsigned long RegisterRGBImage(void)%*/ModuleExport unsigned long RegisterRGBImage(void){ MagickInfo *entry; entry=SetMagickInfo("RGB"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw red, green, and blue samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("RBG"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw red, blue, and green samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("GRB"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw green, red, and blue samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("GBR"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw green, blue, and red samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("BRG"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw blue, red, and green samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("BGR"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw blue, green, and red samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("RGBA"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw red, green, blue, and alpha samples"); entry->module=ConstantString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("RGBO"); entry->decoder=(DecodeImageHandler *) ReadRGBImage; entry->encoder=(EncodeImageHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->format_type=ExplicitFormatType; entry->description=ConstantString("Raw red, green, blue, and opacity " "samples"); entry->module=ConstantString("RGB");//.........这里部分代码省略.........
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例25: LoadCoderList//.........这里部分代码省略......... 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; GetPathComponent(filename,HeadPath,path); if (*path != '/0') (void) ConcatenateMagickString(path,DirectorySeparator, MaxTextExtent); (void) ConcatenateMagickString(path,token,MaxTextExtent); xml=FileToString(path,~0,exception); if (LoadCoderList(xml,path,depth+1,exception) == MagickFalse) status=MagickFalse; xml=(char *) RelinquishMagickMemory(xml); } } } continue; } if (LocaleCompare(keyword,"<coder") == 0) { /* Allocate memory for the coder list. */ coder_info=(CoderInfo *) AcquireMagickMemory(sizeof(*coder_info)); if (coder_info == (CoderInfo *) NULL) ThrowMagickFatalException(ResourceLimitFatalError, "MemoryAllocationFailed",filename); (void) ResetMagickMemory(coder_info,0,sizeof(*coder_info)); coder_info->path=ConstantString(AcquireString(filename)); coder_info->signature=MagickSignature; continue; } if (coder_info == (CoderInfo *) NULL) continue; if (LocaleCompare(keyword,"/>") == 0) { status=AddValueToSplayTree(coder_list, ConstantString(AcquireString(coder_info->magick)),coder_info); if (status == MagickFalse) (void) ThrowMagickException(exception,GetMagickModule(), ResourceLimitError,"MemoryAllocationFailed","`%s'", coder_info->magick); coder_info=(CoderInfo *) NULL; } GetMagickToken(q,(char **) NULL,token); if (*token != '=') continue; GetMagickToken(q,&q,token); GetMagickToken(q,&q,token); switch (*keyword) { case 'M': case 'm': { if (LocaleCompare((char *) keyword,"magick") == 0) { coder_info->magick=ConstantString(AcquireString(token)); break; } break; } case 'N': case 'n': { if (LocaleCompare((char *) keyword,"name") == 0) { coder_info->name=ConstantString(AcquireString(token)); break; } break; } case 'S': case 's': { if (LocaleCompare((char *) keyword,"stealth") == 0) { coder_info->stealth=(MagickBooleanType) (LocaleCompare(token,"True") == 0); break; } break; } default: break; } } token=(char *) RelinquishMagickMemory(token); if (coder_list == (SplayTreeInfo *) NULL) return(MagickFalse); return(status);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:101,
示例26: RegisterXTRNImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r X T R N I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterXTRNImage() adds attributes for the XTRN image format to% the list of supported formats. The attributes include the image format% tag, a method to read and/or write the format, whether the format% supports the saving of more than one frame to the same file or blob,% whether the format supports native in-memory I/O, and a brief% description of the format.%% The format of the RegisterXTRNImage method is:%% RegisterXTRNImage(void)%*/ModuleExport void RegisterXTRNImage(void){ MagickInfo *entry; entry=SetMagickInfo("XTRNFILE"); entry->decoder=ReadXTRNImage; entry->encoder=WriteXTRNImage; entry->adjoin=MagickFalse; entry->stealth=MagickTrue; entry->description=ConstantString("External transfer of a file"); entry->module=ConstantString("XTRN"); RegisterMagickInfo(entry); entry=SetMagickInfo("XTRNIMAGE"); entry->decoder=ReadXTRNImage; entry->encoder=WriteXTRNImage; entry->adjoin=MagickFalse; entry->stealth=MagickTrue; entry->description=ConstantString("External transfer of a image in memory"); entry->module=ConstantString("XTRN"); RegisterMagickInfo(entry); entry=SetMagickInfo("XTRNBLOB"); entry->decoder=ReadXTRNImage; entry->encoder=WriteXTRNImage; entry->adjoin=MagickFalse; entry->stealth=MagickTrue; entry->description=ConstantString("IExternal transfer of a blob in memory"); entry->module=ConstantString("XTRN"); RegisterMagickInfo(entry); entry=SetMagickInfo("XTRNSTREAM"); entry->decoder=ReadXTRNImage; entry->encoder=WriteXTRNImage; entry->adjoin=MagickFalse; entry->stealth=MagickTrue; entry->description=ConstantString("External transfer via a streaming interface"); entry->module=ConstantString("XTRN"); RegisterMagickInfo(entry); entry=SetMagickInfo("XTRNARRAY"); entry->decoder=ReadXTRNImage; entry->encoder=WriteXTRNImage; entry->adjoin=MagickFalse; entry->stealth=MagickTrue; entry->description=ConstantString("External transfer via a smart array interface"); entry->module=ConstantString("XTRN"); RegisterMagickInfo(entry); entry=SetMagickInfo("XTRNBSTR"); entry->decoder=ReadXTRNImage; entry->encoder=WriteXTRNImage; entry->adjoin=MagickFalse; entry->stealth=MagickTrue; entry->description=ConstantString("External transfer via a smart array interface"); entry->module=ConstantString("XTRN"); RegisterMagickInfo(entry);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:82,
注:本文中的ConstantString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Construct函数代码示例 C++ ConstPtr函数代码示例 |