这篇教程C++ AcquireString函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcquireString函数的典型用法代码示例。如果您正苦于以下问题:C++ AcquireString函数的具体用法?C++ AcquireString怎么用?C++ AcquireString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AcquireString函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetMontageInfo/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% G e t M o n t a g e I n f o %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetMontageInfo() initializes montage_info to default values.%% The format of the GetMontageInfo method is:%% void GetMontageInfo(const ImageInfo *image_info,% MontageInfo *montage_info)%% A description of each parameter follows:%% o image_info: a structure of type ImageInfo.%% o montage_info: Specifies a pointer to a MontageInfo structure.%*/MagickExport void GetMontageInfo(const ImageInfo *image_info, MontageInfo *montage_info){ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(montage_info != (MontageInfo *) NULL); (void) ResetMagickMemory(montage_info,0,sizeof(*montage_info)); (void) CopyMagickString(montage_info->filename,image_info->filename, MagickPathExtent); montage_info->geometry=AcquireString(DefaultTileGeometry); if (image_info->font != (char *) NULL) montage_info->font=AcquireString(image_info->font); montage_info->gravity=CenterGravity; montage_info->pointsize=image_info->pointsize; montage_info->fill.alpha=OpaqueAlpha; montage_info->stroke.alpha=(Quantum) TransparentAlpha; montage_info->matte_color=image_info->matte_color; montage_info->background_color=image_info->background_color; montage_info->border_color=image_info->border_color; montage_info->debug=IsEventLogging(); montage_info->signature=MagickCoreSignature;}
开发者ID:vcgato29,项目名称:ImageMagick,代码行数:50,
示例2: getHandle/* * Class: magick_ImageInfo * Method: setImageOption * Signature: (Ljava/lang/String;Ljava/lang/String;)V */JNIEXPORT void JNICALL Java_magick_ImageInfo_setImageOption (JNIEnv *env, jobject self, jstring option, jstring value){ ImageInfo *info = NULL; const char *cstr1 = NULL; const char *cstr2 = NULL; info = (ImageInfo *) getHandle(env, self, "imageInfoHandle", NULL); if (info == NULL) { throwMagickException(env, "Unable to retrieve handle"); return; } cstr1 = (*env)->GetStringUTFChars(env, option, 0); if (cstr1 == NULL) { throwMagickException(env, "Unable to retrieve Java string chars"); return; } cstr2 = (*env)->GetStringUTFChars(env, value, 0); if (cstr2 == NULL) { throwMagickException(env, "Unable to retrieve Java string chars"); return; } SetImageOption(info, (char *)AcquireString(cstr1), (char *)AcquireString(cstr2)); (*env)->ReleaseStringUTFChars(env, option, cstr1); (*env)->ReleaseStringUTFChars(env, value, cstr2); }
开发者ID:VRDate,项目名称:jmagick,代码行数:35,
示例3: RegisterFAXImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r F A X I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterFAXImage() adds attributes for the FAX 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 RegisterFAXImage method is:%% RegisterFAXImage(void)%*/ModuleExport void RegisterFAXImage(void){ MagickInfo *entry; static const char *Note= { "See TIFF format. Note that FAX machines use non-square pixels which/n" "are 1.5 times wider than they are tall but computer displays use/n" "square pixels. FAX images may appear to be narrow unless they are/n" "explicitly resized using a resize specification of /"150x100%/"." }; entry=SetMagickInfo("FAX"); entry->decoder=(DecoderHandler *) ReadFAXImage; entry->encoder=(EncoderHandler *) WriteFAXImage; entry->magick=(MagickHandler *) IsFAX; entry->description=AcquireString("Group 3 FAX"); entry->note=AcquireString(Note); entry->module=AcquireString("FAX"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("G3"); entry->decoder=(DecoderHandler *) ReadFAXImage; entry->encoder=(EncoderHandler *) WriteFAXImage; entry->magick=(MagickHandler *) IsFAX; entry->adjoin=MagickFalse; entry->description=AcquireString("Group 3 FAX"); entry->module=AcquireString("FAX"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard_linux314,代码行数:54,
示例4: RegisterSTEGANOImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r S T E G A N O I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterSTEGANOImage() adds attributes for the STEGANO 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 RegisterSTEGANOImage method is:%% RegisterSTEGANOImage(void)%*/ModuleExport void RegisterSTEGANOImage(void){ MagickInfo *entry; entry=SetMagickInfo("STEGANO"); entry->decoder=(DecoderHandler *) ReadSTEGANOImage; entry->description=AcquireString("Steganographic image"); entry->module=AcquireString("STEGANO"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:34,
示例5: RegisterCIPImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r C I P I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterCIPImage() adds attributes for the CIP IP phone 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 RegisterCIPImage method is:%% RegisterCIPImage(void)%*/ModuleExport void RegisterCIPImage(void){ MagickInfo *entry; entry=SetMagickInfo("CIP"); entry->encoder=(EncoderHandler *) WriteCIPImage; entry->adjoin=MagickFalse; entry->description=AcquireString("Cisco IP phone image format"); entry->module=AcquireString("CIP"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:35,
示例6: RegisterTILEImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r T I L E I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterTILEImage() adds attributes for the TILE 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 RegisterTILEImage method is:%% RegisterTILEImage(void)%*/ModuleExport void RegisterTILEImage(void){ MagickInfo *entry; entry=SetMagickInfo("TILE"); entry->decoder=(DecoderHandler *) ReadTILEImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->description=AcquireString("Tile image with a texture"); entry->module=AcquireString("TILE"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:36,
示例7: RegisterMVGImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r M V G I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterMVGImage() adds attributes for the MVG 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 RegisterMVGImage method is:%% RegisterMVGImage(void)%*/ModuleExport void RegisterMVGImage(void){ MagickInfo *entry; entry=SetMagickInfo("MVG"); entry->decoder=(DecoderHandler *) ReadMVGImage; entry->encoder=(EncoderHandler *) WriteMVGImage; entry->magick=(MagickHandler *) IsMVG; entry->adjoin=MagickFalse; entry->seekable_stream=MagickTrue; entry->description=AcquireString("Magick Vector Graphics"); entry->module=AcquireString("MVG"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:38,
示例8: RegisterPLASMAImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r P L A S M A I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterPLASMAImage() adds attributes for the Plasma 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 RegisterPLASMAImage method is:%% RegisterPLASMAImage(void)%*/ModuleExport void RegisterPLASMAImage(void){ MagickInfo *entry; entry=SetMagickInfo("PLASMA"); entry->decoder=(DecoderHandler *) ReadPlasmaImage; entry->adjoin=MagickFalse; entry->description=AcquireString("Plasma fractal image"); entry->module=AcquireString("PLASMA"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("FRACTAL"); entry->decoder=(DecoderHandler *) ReadPlasmaImage; entry->adjoin=MagickFalse; entry->description=AcquireString("Plasma fractal image"); entry->module=AcquireString("PLASMA"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard_linux314,代码行数:41,
示例9: setHandleAttribute/* * Set a attribute in a generic handle to string. * * Input: * env Java VM environment * attribVar points to a C string so as to set the value * jstr Java string for which to set the attrib * * Output: * attribVar points to a new C string with content from jstr */void setHandleAttribute(JNIEnv *env, char **attribVar, jstring jstr){ const char *cstr = NULL; if (*attribVar != NULL) {// RelinquishMagickMemory((void**)attribVar); } cstr = (*env)->GetStringUTFChars(env, jstr, 0); *attribVar = (char *) AcquireString(cstr); (*env)->ReleaseStringUTFChars(env, jstr, cstr);}
开发者ID:271845221,项目名称:Android-ImageMagick,代码行数:21,
示例10: ThrowExceptionMagickExport void ThrowException(ExceptionInfo *exception, const ExceptionType severity,const char *reason,const char *description){ assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); exception->severity=(ExceptionType) severity; MagickFreeMemory(exception->reason); if (reason) exception->reason= AcquireString(GetLocaleExceptionMessage(severity,reason)); MagickFreeMemory(exception->description); if (description) exception->description= AcquireString(GetLocaleExceptionMessage(severity,description)); exception->error_number=errno; MagickFreeMemory(exception->module); MagickFreeMemory(exception->function); exception->line=0UL; exception->signature=0UL; return;}
开发者ID:hank2015,项目名称:testCMS,代码行数:21,
示例11: RegisterMPEGImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r M P E G I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterMPEGImage() adds attributes for the MPEG 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 RegisterMPEGImage method is:%% RegisterMPEGImage(void)%*/ModuleExport void RegisterMPEGImage(void){ MagickInfo *entry; entry=SetMagickInfo("MPEG"); entry->decoder=(DecoderHandler *) ReadMPEGImage; entry->encoder=(EncoderHandler *) WriteMPEGImage; entry->magick=(MagickHandler *) IsMPEG; entry->blob_support=MagickFalse; entry->description=AcquireString("MPEG Video Stream"); entry->module=AcquireString("MPEG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("MPG"); entry->decoder=(DecoderHandler *) ReadMPEGImage; entry->encoder=(EncoderHandler *) WriteMPEGImage; entry->magick=(MagickHandler *) IsMPEG; entry->blob_support=MagickFalse; entry->description=AcquireString("MPEG Video Stream"); entry->module=AcquireString("MPEG"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("M2V"); entry->decoder=(DecoderHandler *) ReadMPEGImage; entry->encoder=(EncoderHandler *) WriteMPEGImage; entry->magick=(MagickHandler *) IsMPEG; entry->blob_support=MagickFalse; entry->description=AcquireString("MPEG Video Stream"); entry->module=AcquireString("MPEG"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:53,
示例12: RegisterRGBImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e g i s t e r R G B I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegisterRGBImage() adds attributes for the RGB 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:%% RegisterRGBImage(void)%*/ModuleExport void RegisterRGBImage(void){ MagickInfo *entry; entry=SetMagickInfo("RGB"); entry->decoder=(DecoderHandler *) ReadRGBImage; entry->encoder=(EncoderHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->description=AcquireString("Raw red, green, and blue samples"); entry->module=AcquireString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("RGBA"); entry->decoder=(DecoderHandler *) ReadRGBImage; entry->encoder=(EncoderHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->description=AcquireString("Raw red, green, blue, and alpha samples"); entry->module=AcquireString("RGB"); (void) RegisterMagickInfo(entry); entry=SetMagickInfo("RGBO"); entry->decoder=(DecoderHandler *) ReadRGBImage; entry->encoder=(EncoderHandler *) WriteRGBImage; entry->raw=MagickTrue; entry->endian_support=MagickTrue; entry->description=AcquireString("Raw red, green, blue, and opacity samples"); entry->module=AcquireString("RGB"); (void) RegisterMagickInfo(entry);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:53,
示例13: ThrowLoggedException/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% T h r o w L o g g e d E x c e p t i o n %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ThrowLoggedException() throws an exception with the specified severity code,% reason, optional description, source filename, function name, and line% number. If logging is enabled, the exception is also logged.%% The format of the ThrowLoggedException method is:%% void ThrowLoggedException(ExceptionInfo *exception,% const ExceptionType severity,const char *reason,% const char *description,const char *module,% const char *function,const unsigned long line%% A description of each parameter follows:%% o exception: The exception.%% o severity: The severity of the exception.%% o reason: The reason of the exception.%% o description: The exception description.%% o filename: The source module filename.%% o function: The function name.%% o line: The line number of the source module.%%*/MagickExport void ThrowLoggedException(ExceptionInfo *exception, const ExceptionType severity,const char *reason,const char *description, const char *module,const char *function,const unsigned long line){ assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); exception->severity=(ExceptionType) severity; MagickFreeMemory(exception->reason); if (reason) exception->reason= AcquireString(GetLocaleExceptionMessage(severity,reason)); MagickFreeMemory(exception->description); if (description) exception->description= AcquireString(GetLocaleExceptionMessage(severity,description)); exception->error_number=errno; MagickFreeMemory(exception->module); if (module) exception->module=AcquireString(module); MagickFreeMemory(exception->function); if (function) exception->function=AcquireString(function); exception->line=line; if (exception->reason) { if (exception->description) (void) LogMagickEvent(severity,module,function,line,"%.1024s (%.1024s)", exception->reason,exception->description ); else (void) LogMagickEvent(severity,module,function,line,"%.1024s", exception->reason); } else { (void) LogMagickEvent(severity,module,function,line, "exception contains no reason!"); } return;}
开发者ID:hank2015,项目名称:testCMS,代码行数:79,
示例14: CopyException/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% C o p y E x c e p t i o n %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CopyException() copies exception data from one ExceptionInfo structure% to another.%% The format of the CopyException method is:%% void CopyException(ExceptionInfo *copy, const ExceptionInfo *original)%% A description of each parameter follows:%% o copy: The exception to copy to.%% o original: The exception to copy from.%*/MagickExport void CopyException(ExceptionInfo *copy, const ExceptionInfo *original){ assert(copy != (ExceptionInfo *) NULL); assert(copy->signature == MagickSignature); assert(original != (ExceptionInfo *) NULL); assert(original->signature == MagickSignature); copy->severity=original->severity; MagickFreeMemory(copy->reason); if (original->reason) copy->reason=AcquireString(original->reason); MagickFreeMemory(copy->description); if (original->description) copy->description=AcquireString(original->description); copy->error_number=original->error_number; MagickFreeMemory(copy->module); if (original->module) copy->module=AcquireString(original->module); MagickFreeMemory(copy->function); if (original->function) copy->function=AcquireString(original->function); copy->line=original->line; return;}
开发者ID:hank2015,项目名称:testCMS,代码行数:48,
示例15: HHVM_METHODstatic bool HHVM_METHOD(ImagickDraw, setResolution, double x, double y) { auto wand = getDrawingWandResource(Object{this_}); std::ostringstream density; density << x << "x" << y; auto drawInfo = PeekDrawingWand(wand->getWand()); drawInfo->density = AcquireString(density.str().c_str()); auto drawWand = DrawAllocateWand(drawInfo, nullptr); if (drawWand == nullptr) { IMAGICKDRAW_THROW("Failed to allocate new DrawingWand structure"); } setWandResource(s_ImagickDraw, Object{this_}, drawWand); return true;}
开发者ID:facebook,项目名称:hhvm,代码行数:15,
示例16: getStringFieldValue/* * Retrieve the string value of the specified field. * * Input: * env Java VM environment. * obj Java object for which the value is to be retrieved. * fieldName name of the field to be retrieved. * fieldID if non-null, points to field ID. 0 to request retrieval. * * Output: * fieldID if non-null, will contain the field ID. * * Return: * The string value requested. The caller is responsible for * deallocating this string. */char* getStringFieldValue(JNIEnv *env, jobject obj, const char *fieldName, jfieldID *fieldID){ jclass objClass = 0; jfieldID objFieldID = 0; jobject stringObj = 0; char *stringVal = NULL; char *stringCpy = NULL; if (fieldID == NULL) { objClass = (*env)->GetObjectClass(env, obj); if (objClass == 0) { return NULL; } objFieldID = (*env)->GetFieldID(env, objClass, fieldName, "Ljava/lang/String;"); } else if (*fieldID == 0) { objClass = (*env)->GetObjectClass(env, obj); if (objClass == 0) { return NULL; } objFieldID = *fieldID = (*env)->GetFieldID(env, objClass, fieldName, "Ljava/lang/String;"); } else { objFieldID = *fieldID; } if (objFieldID == 0) { return NULL; } stringObj = (*env)->GetObjectField(env, obj, objFieldID); if (stringObj == NULL) { return NULL; } stringVal = (char *) (*env)->GetStringUTFChars(env, stringObj, 0); stringCpy = (char *) AcquireString(stringVal); (*env)->ReleaseStringUTFChars(env, stringObj, stringVal); return stringCpy;}
开发者ID:271845221,项目名称:Android-ImageMagick,代码行数:58,
示例17: MagickQueryConfigureOption/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% M a g i c k Q u e r y C o n f i g u r e O p t i o n %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MagickQueryConfigureOption() returns the value associated with the specified% configure option.%% The format of the MagickQueryConfigureOption function is:%% char *MagickQueryConfigureOption(const char *option)%% A description of each parameter follows:%% o option: the option name.%*/WandExport char *MagickQueryConfigureOption(const char *option){ char *value; const ConfigureInfo **configure_info; ExceptionInfo *exception; size_t number_options; exception=AcquireExceptionInfo(); configure_info=GetConfigureInfoList(option,&number_options,exception); exception=DestroyExceptionInfo(exception); if (configure_info == (const ConfigureInfo **) NULL) return((char *) NULL); value=AcquireString(configure_info[0]->value); configure_info=(const ConfigureInfo **) RelinquishMagickMemory((void *) configure_info); return(value);}
开发者ID:saitoha,项目名称:ImageMagick-V7-SIXEL,代码行数:47,
示例18: CloneMontageInfo/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% C l o n e M o n t a g e I n f o %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CloneMontageInfo() makes a copy of the given montage info structure. If% NULL is specified, a new image info structure is created initialized to% default values.%% The format of the CloneMontageInfo method is:%% MontageInfo *CloneMontageInfo(const ImageInfo *image_info,% const MontageInfo *montage_info)%% A description of each parameter follows:%% o image_info: the image info.%% o montage_info: the montage info.%*/MagickExport MontageInfo *CloneMontageInfo(const ImageInfo *image_info, const MontageInfo *montage_info){ MontageInfo *clone_info; clone_info=(MontageInfo *) AcquireMagickMemory(sizeof(*clone_info)); if (clone_info == (MontageInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetMontageInfo(image_info,clone_info); if (montage_info == (MontageInfo *) NULL) return(clone_info); if (montage_info->geometry != (char *) NULL) clone_info->geometry=AcquireString(montage_info->geometry); if (montage_info->tile != (char *) NULL) clone_info->tile=AcquireString(montage_info->tile); if (montage_info->title != (char *) NULL) clone_info->title=AcquireString(montage_info->title); if (montage_info->frame != (char *) NULL) clone_info->frame=AcquireString(montage_info->frame); if (montage_info->texture != (char *) NULL) clone_info->texture=AcquireString(montage_info->texture); if (montage_info->font != (char *) NULL) clone_info->font=AcquireString(montage_info->font); clone_info->pointsize=montage_info->pointsize; clone_info->border_width=montage_info->border_width; clone_info->shadow=montage_info->shadow; clone_info->fill=montage_info->fill; clone_info->stroke=montage_info->stroke; clone_info->background_color=montage_info->background_color; clone_info->border_color=montage_info->border_color; clone_info->matte_color=montage_info->matte_color; clone_info->gravity=montage_info->gravity; (void) CopyMagickString(clone_info->filename,montage_info->filename, MagickPathExtent); clone_info->debug=IsEventLogging(); return(clone_info);}
开发者ID:anorland,项目名称:ImageMagick,代码行数:65,
示例19: 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,
示例20: LoadTypeListstatic 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,
示例21: main//.........这里部分代码省略......... comment=GetXMLTreeChild(type,"comment"); if (comment != (XMLTreeInfo *) NULL) description=GetXMLTreeContent(comment); if (expanded_acronym != (XMLTreeInfo *) NULL) description=GetXMLTreeContent(expanded_acronym); magic=GetXMLTreeChild(type,"magic"); priority=(char *) NULL; match=(XMLTreeInfo *) NULL; if (magic != (XMLTreeInfo *) NULL) { priority=GetXMLTreeAttribute(magic,"priority"); match=GetXMLTreeChild(magic,"match"); } while (match != (XMLTreeInfo *) NULL) { value=(char *) NULL; match_type=(char *) NULL; mask=(char *) NULL; offset=(char *) NULL; if (match != (XMLTreeInfo *) NULL) { value=GetXMLTreeAttribute(match,"value"); match_type=GetXMLTreeAttribute(match,"type"); offset=GetXMLTreeAttribute(match,"offset"); mask=GetXMLTreeAttribute(match,"mask"); } (void) printf(" <mime"); if (mime_type != (const char *) NULL) (void) printf(" type=/"%s/"",mime_type); if (description != (const char *) NULL) (void) printf(" description=/"%s/"",description); if (match_type != (const char *) NULL) { data_type="string"; endian="undefined"; if (strncmp(match_type,"little",6) == 0) endian="LSB"; if (strncmp(match_type,"big",3) == 0) endian="MSB"; if (strcmp(match_type,"byte") == 0) data_type="byte"; if (strcmp(match_type+strlen(match_type)-2,"16") == 0) data_type="short"; if (strcmp(match_type+strlen(match_type)-2,"32") == 0) data_type="ssize_t"; (void) printf(" data-type=/"%s/"",data_type); if (strcmp(endian,"undefined") != 0) (void) printf(" endian=/"%s/"",endian); } if (offset != (const char *) NULL) (void) printf(" offset=/"%s/"",offset); if (mask != (const char *) NULL) (void) printf(" mask=/"%s/"",mask); if (value != (const char *) NULL) { char *magic; magic=AcquireString(value); SubstituteString(&magic,"<","<"); SubstituteString(&magic,">",">"); SubstituteString(&magic,"/"","""); (void) printf(" magic=/"%s/"",magic); magic=(char *) RelinquishWizardMemory(magic); } if (priority != (const char *) NULL) (void) printf(" priority=/"%s/"",priority); (void) printf(" />/n"); match=GetNextXMLTreeTag(match); } glob=GetXMLTreeChild(type,"glob"); while (glob != (XMLTreeInfo *) NULL) { pattern=GetXMLTreeAttribute(glob,"pattern"); value=(char *) NULL; if (match) value=GetXMLTreeAttribute(match,"value"); (void) printf(" <mime"); if (mime_type != (const char *) NULL) (void) printf(" type=/"%s/"",mime_type); if (acronym != (const char *) NULL) (void) printf(" acronym=/"%s/"",acronym); if (description != (const char *) NULL) (void) printf(" description=/"%s/"",description); (void) printf(" priority=/"100/""); if (pattern != (const char *) NULL) (void) printf(" pattern=/"%s/"",pattern); (void) printf(" />/n"); glob=GetNextXMLTreeTag(glob); } type=GetNextXMLTreeTag(type); } (void) printf("</mimemap>/n"); xml=XMLTreeInfoToXML(xml_info); (void) fprintf(stderr,"%s/n",xml); xml=(char *) RelinquishWizardMemory(xml); DestroyXMLTree(xml_info); exception=DestroyExceptionInfo(exception); return(0);}
开发者ID:ImageMagick,项目名称:WizardsToolkit,代码行数:101,
示例22: ReadLABELImage//.........这里部分代码省略......... 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); } } status=GetMultilineTypeMetrics(image,draw_info,&metrics); if (status == MagickFalse) { InheritException(exception,&image->exception); image=DestroyImageList(image); return((Image *) NULL); } if (image->columns == 0) image->columns=(size_t) (metrics.width+draw_info->stroke_width+1.5); if (image->columns == 0) image->columns=(size_t) (draw_info->pointsize+ draw_info->stroke_width+1.5); if (draw_info->gravity == UndefinedGravity) { (void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g", -metrics.bounds.x1+draw_info->stroke_width/2.0,metrics.ascent+ draw_info->stroke_width/2.0); draw_info->geometry=AcquireString(geometry); } if (image->rows == 0) image->rows=(size_t) floor(metrics.height+draw_info->stroke_width+0.5); if (image->rows == 0) image->rows=(size_t) floor(draw_info->pointsize+draw_info->stroke_width+ 0.5); if (SetImageBackgroundColor(image) == MagickFalse) { InheritException(exception,&image->exception); image=DestroyImageList(image); return((Image *) NULL); } (void) AnnotateImage(image,draw_info); if (image_info->pointsize == 0.0) { char pointsize[MaxTextExtent]; (void) FormatLocaleString(pointsize,MaxTextExtent,"%.20g", draw_info->pointsize); (void) SetImageProperty(image,"label:pointsize",pointsize); } draw_info=DestroyDrawInfo(draw_info); return(GetFirstImageInList(image));}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:101,
示例23: GetPageGeometry//.........这里部分代码省略......... { "a1", "1684x2384" }, { "a10", "73x105" }, { "a2", "1191x1684" }, { "a3", "842x1191" }, { "a4", "595x842" }, { "a4smaLL", "595x842" }, { "a5", "420x595" }, { "a6", "297x420" }, { "a7", "210x297" }, { "a8", "148x210" }, { "a9", "105x148" }, { "archa", "648x864" }, { "archb", "864x1296" }, { "archC", "1296x1728" }, { "archd", "1728x2592" }, { "arche", "2592x3456" }, { "b0", "2920x4127" }, { "b1", "2064x2920" }, { "b10", "91x127" }, { "b2", "1460x2064" }, { "b3", "1032x1460" }, { "b4", "729x1032" }, { "b5", "516x729" }, { "b6", "363x516" }, { "b7", "258x363" }, { "b8", "181x258" }, { "b9", "127x181" }, { "c0", "2599x3676" }, { "c1", "1837x2599" }, { "c2", "1298x1837" }, { "c3", "918x1296" }, { "c4", "649x918" }, { "c5", "459x649" }, { "c6", "323x459" }, { "c7", "230x323" }, { "executive", "540x720" }, { "flsa", "612x936" }, { "flse", "612x936" }, { "folio", "612x936" }, { "halfletter", "396x612" }, { "isob0", "2835x4008" }, { "isob1", "2004x2835" }, { "isob10", "88x125" }, { "isob2", "1417x2004" }, { "isob3", "1001x1417" }, { "isob4", "709x1001" }, { "isob5", "499x709" }, { "isob6", "354x499" }, { "isob7", "249x354" }, { "isob8", "176x249" }, { "isob9", "125x176" }, { "jisb0", "1030x1456" }, { "jisb1", "728x1030" }, { "jisb2", "515x728" }, { "jisb3", "364x515" }, { "jisb4", "257x364" }, { "jisb5", "182x257" }, { "jisb6", "128x182" }, { "ledger", "1224x792" }, { "legal", "612x1008" }, { "letter", "612x792" }, { "lettersmaLL", "612x792" }, { "quarto", "610x780" }, { "statement", "396x612" }, { "tabloid", "792x1224" }, { (char *) NULL, (char *) NULL } }; char *page; register ssize_t i; assert(page_geometry != (char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",page_geometry); page=AcquireString(page_geometry); for (i=0; *PageSizes[i] != (char *) NULL; i++) if (LocaleNCompare(PageSizes[i][0],page,strlen(PageSizes[i][0])) == 0) { RectangleInfo geometry; MagickStatusType flags; /* Replace mneumonic with the equivalent size in dots-per-inch. */ (void) CopyMagickString(page,PageSizes[i][1],MaxTextExtent); (void) ConcatenateMagickString(page,page_geometry+ strlen(PageSizes[i][0]),MaxTextExtent); flags=GetGeometry(page,&geometry.x,&geometry.y,&geometry.width, &geometry.height); if ((flags & GreaterValue) == 0) (void) ConcatenateMagickString(page,">",MaxTextExtent); break; } return(page);}
开发者ID:JasonGross,项目名称:characters,代码行数:101,
示例24: LoadMagicCache/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %+ L o a d M a g i c L i s t %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LoadMagicCache() loads the magic configurations which provides a mapping% between magic attributes and a magic name.%% The format of the LoadMagicCache method is:%% MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,% const char *xml,const char *filename,const size_t depth,% ExceptionInfo *exception)%% A description of each parameter follows:%% o xml: The magic list in XML format.%% o filename: The magic list filename.%% o depth: depth of <include /> statements.%% o exception: return any errors or warnings in this structure.%*/static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache, const char *xml,const char *filename,const size_t depth, ExceptionInfo *exception){ char keyword[MaxTextExtent], *token; const char *q; MagicInfo *magic_info; MagickStatusType status; /* Load the magic map file. */ (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), "Loading magic configure file /"%s/" ...",filename); if (xml == (char *) NULL) return(MagickFalse); status=MagickTrue; magic_info=(MagicInfo *) NULL; token=AcquireString(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); if (*token != '=') continue; GetMagickToken(q,&q,token); if (LocaleCompare(keyword,"file") == 0) { if (depth > 200)//.........这里部分代码省略.........
开发者ID:GalliumOS,项目名称:imagemagick,代码行数:101,
示例25: WriteUILImage//.........这里部分代码省略......... (void) SetImageType(image,PaletteType,exception); colors=image->colors; if (transparent != MagickFalse) { register Quantum *q; colors++; for (y=0; y < (ssize_t) image->rows; y++) { q=GetAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { if (matte_image[i] != 0) SetPixelIndex(image,(Quantum) image->colors,q); q+=GetPixelChannels(image); } } } if (matte_image != (unsigned char *) NULL) matte_image=(unsigned char *) RelinquishMagickMemory(matte_image); } /* Compute the character per pixel. */ characters_per_pixel=1; for (k=MaxCixels; (ssize_t) colors > k; k*=MaxCixels) characters_per_pixel++; /* UIL header. */ symbol=AcquireString(""); (void) WriteBlobString(image,"/* UIL *//n"); GetPathComponent(image->filename,BasePath,basename); (void) FormatLocaleString(buffer,MagickPathExtent, "value/n %s_ct : color_table(/n",basename); (void) WriteBlobString(image,buffer); GetPixelInfo(image,&pixel); for (i=0; i < (ssize_t) colors; i++) { /* Define UIL color. */ pixel=image->colormap[i]; pixel.colorspace=sRGBColorspace; pixel.depth=8; pixel.alpha=(double) OpaqueAlpha; GetColorTuple(&pixel,MagickTrue,name); if (transparent != MagickFalse) if (i == (ssize_t) (colors-1)) (void) CopyMagickString(name,"None",MagickPathExtent); /* Write UIL color. */ k=i % MaxCixels; symbol[0]=Cixel[k]; for (j=1; j < (int) characters_per_pixel; j++) { k=((i-k)/MaxCixels) % MaxCixels; symbol[j]=Cixel[k]; } symbol[j]='/0'; (void) SubstituteString(&symbol,"'","''"); if (LocaleCompare(name,"None") == 0)
开发者ID:JosephineWolff,项目名称:ImageMagick,代码行数:67,
示例26: LoadMimeCache//.........这里部分代码省略......... mime=GetXMLTreeChild(mime_map,"mime"); while (mime != (XMLTreeInfo *) NULL) { /* Process mime element. */ mime_info=(MimeInfo *) AcquireCriticalMemory(sizeof(*mime_info)); (void) ResetMagickMemory(mime_info,0,sizeof(*mime_info)); mime_info->path=ConstantString(filename); mime_info->signature=MagickCoreSignature; attribute=GetXMLTreeAttribute(mime,"data-type"); if (attribute != (const char *) NULL) mime_info->data_type=(DataType) ParseCommandOption(MagickDataTypeOptions, MagickTrue,attribute); attribute=GetXMLTreeAttribute(mime,"description"); if (attribute != (const char *) NULL) mime_info->description=ConstantString(attribute); attribute=GetXMLTreeAttribute(mime,"endian"); if (attribute != (const char *) NULL) mime_info->endian=(EndianType) ParseCommandOption(MagickEndianOptions, MagickTrue,attribute); attribute=GetXMLTreeAttribute(mime,"magic"); if (attribute != (const char *) NULL) { char *token; const char *p; register unsigned char *q; token=AcquireString(attribute); (void) SubstituteString((char **) &token,"<","<"); (void) SubstituteString((char **) &token,"&","&"); (void) SubstituteString((char **) &token,""","/""); mime_info->magic=(unsigned char *) AcquireString(token); q=mime_info->magic; for (p=token; *p != '/0'; ) { if (*p == '//') { p++; if (isdigit((int) ((unsigned char) *p)) != 0) { char *end; *q++=(unsigned char) strtol(p,&end,8); p+=(end-p); mime_info->length++; continue; } switch (*p) { case 'b': *q='/b'; break; case 'f': *q='/f'; break; case 'n': *q='/n'; break; case 'r': *q='/r'; break; case 't': *q='/t'; break; case 'v': *q='/v'; break; case 'a': *q='a'; break; case '?': *q='/?'; break; default: *q=(unsigned char) (*p); break; }
开发者ID:vcgato29,项目名称:ImageMagick,代码行数:67,
示例27: ReadINLINEImage/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% R e a d I N L I N E I m a g e %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ReadINLINEImage() reads base64-encoded inlines images.%% The format of the ReadINLINEImage method is:%% Image *ReadINLINEImage(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 *ReadINLINEImage(const ImageInfo *image_info, ExceptionInfo *exception){ Image *image; MagickBooleanType status; register size_t i; size_t quantum; ssize_t count; unsigned char *inline_image; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); if (LocaleCompare(image_info->magick,"DATA") == 0) { char *filename; Image *data_image; filename=AcquireString("data:"); (void) ConcatenateMagickString(filename,image_info->filename, MagickPathExtent); data_image=ReadInlineImage(image_info,filename,exception); filename=DestroyString(filename); return(data_image); } image=AcquireImage(image_info,exception); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { image=DestroyImageList(image); return((Image *) NULL); } quantum=MagickMin((size_t) GetBlobSize(image),MagickMaxBufferExtent); if (quantum == 0) quantum=MagickMaxBufferExtent; inline_image=(unsigned char *) AcquireQuantumMemory(quantum, sizeof(*inline_image)); count=0; for (i=0; inline_image != (unsigned char *) NULL; i+=count) { count=(ssize_t) ReadBlob(image,quantum,inline_image+i); if (count <= 0) { count=0; if (errno != EINTR) break; } if (~((size_t) i) < (quantum+1)) { inline_image=(unsigned char *) RelinquishMagickMemory(inline_image); break; } inline_image=(unsigned char *) ResizeQuantumMemory(inline_image,i+count+ quantum+1,sizeof(*inline_image));//.........这里部分代码省略.........
开发者ID:278443820,项目名称:ImageMagick,代码行数:101,
示例28: 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,
示例29: LoadCoderListstatic MagickBooleanType LoadCoderList(const char *xml,const char *filename, const unsigned long depth,ExceptionInfo *exception){ char keyword[MaxTextExtent], *q, *token; CoderInfo *coder_info = (CoderInfo *) NULL; MagickBooleanType status; /* Load the coder map file. */ (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), "Loading coder file /"%s/" ...",filename); if (xml == (const char *) NULL) return(MagickFalse); if (coder_list == (SplayTreeInfo *) NULL) { coder_list=NewSplayTree(CompareSplayTreeString,RelinquishMagickMemory, DestroyCoderNode); if (coder_list == (SplayTreeInfo *) NULL) { ThrowFileException(exception,ResourceLimitError, "MemoryAllocationFailed",filename); return(MagickFalse); } } status=MagickTrue; token=AcquireString(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); 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; 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) {//.........这里部分代码省略.........
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:101,
示例30: 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, *text; const char *gravity, *option; DrawInfo *draw_info; Image *image; MagickBooleanType split, status; register ssize_t i; size_t height, width; TypeMetric metrics; /* 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"); /* Format caption. */ option=GetImageOption(image_info,"filename"); if (option == (const char *) NULL) property=InterpretImageProperties(image_info,image,image_info->filename); else if (LocaleNCompare(option,"caption:",8) == 0) property=InterpretImageProperties(image_info,image,option+8); else property=InterpretImageProperties(image_info,image,option); (void) SetImageProperty(image,"caption",property); property=DestroyString(property); caption=ConstantString(GetImageProperty(image,"caption")); draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); (void) CloneString(&draw_info->text,caption); gravity=GetImageOption(image_info,"gravity"); if (gravity != (char *) NULL) draw_info->gravity=(GravityType) ParseCommandOption(MagickGravityOptions, MagickFalse,gravity); split=MagickFalse; status=MagickTrue; if (image->columns == 0) { text=AcquireString(caption); i=FormatMagickCaption(image,draw_info,split,&metrics,&text); (void) CloneString(&draw_info->text,text); text=DestroyString(text);//.........这里部分代码省略.........
开发者ID:INT2208-ST,项目名称:MyFriend,代码行数:101,
注:本文中的AcquireString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcquireVirtualCacheView函数代码示例 C++ AcquireSemaphoreInfo函数代码示例 |