您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AcquireExceptionInfo函数代码示例

51自学网 2021-06-01 19:40:14
  C++
这篇教程C++ AcquireExceptionInfo函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AcquireExceptionInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ AcquireExceptionInfo函数的具体用法?C++ AcquireExceptionInfo怎么用?C++ AcquireExceptionInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AcquireExceptionInfo函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ReadImages

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   R e a d I m a g e s                                                       %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ReadImages() reads one or more images and returns them as an image list.%%  The format of the ReadImage method is:%%      Image *ReadImages(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.%*/MagickExport Image *ReadImages(const ImageInfo *image_info,  ExceptionInfo *exception){  char    filename[MaxTextExtent];  Image    *image,    *images;  ImageInfo    *read_info;  /*    Read image list from a file.  */  assert(image_info != (ImageInfo *) NULL);  assert(image_info->signature == MagickSignature);  if (image_info->debug != MagickFalse)    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",      image_info->filename);  assert(exception != (ExceptionInfo *) NULL);  (void) InterpretImageFilename(image_info,(Image *) NULL,image_info->filename,    (int) image_info->scene,filename);  if (LocaleCompare(filename,image_info->filename) != 0)    {      ExceptionInfo        *sans;      ssize_t        extent,        scene;      /*        Images of the form image-%d.png[1-5].      */      read_info=CloneImageInfo(image_info);      sans=AcquireExceptionInfo();      (void) SetImageInfo(read_info,0,sans);      sans=DestroyExceptionInfo(sans);      (void) CopyMagickString(filename,read_info->filename,MaxTextExtent);      images=NewImageList();      extent=(ssize_t) (read_info->scene+read_info->number_scenes);      for (scene=(ssize_t) read_info->scene; scene < (ssize_t) extent; scene++)      {        (void) InterpretImageFilename(image_info,(Image *) NULL,filename,(int)          scene,read_info->filename);        image=ReadImage(read_info,exception);        if (image == (Image *) NULL)          continue;        AppendImageToList(&images,image);      }      read_info=DestroyImageInfo(read_info);      return(images);    }  return(ReadImage(image_info,exception));}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:81,


示例2: NewPixelIterator

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   N e w P i x e l I t e r a t o r                                           %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  NewPixelIterator() returns a new pixel iterator.%%  The format of the NewPixelIterator method is:%%      PixelIterator *NewPixelIterator(MagickWand *wand)%%  A description of each parameter follows:%%    o wand: the magick wand.%*/WandExport PixelIterator *NewPixelIterator(MagickWand *wand){  const char    *quantum;  ExceptionInfo    *exception;  Image    *image;  PixelIterator    *iterator;  size_t    depth;  CacheView    *view;  depth=MAGICKCORE_QUANTUM_DEPTH;  quantum=GetMagickQuantumDepth(&depth);  if (depth != MAGICKCORE_QUANTUM_DEPTH)    ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);  assert(wand != (MagickWand *) NULL);  image=GetImageFromMagickWand(wand);  if (image == (Image *) NULL)    return((PixelIterator *) NULL);  exception=AcquireExceptionInfo();  view=AcquireVirtualCacheView(image,exception);  if (view == (CacheView *) NULL)    return((PixelIterator *) NULL);  iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator));  if (iterator == (PixelIterator *) NULL)    ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",      GetExceptionMessage(errno));  (void) ResetMagickMemory(iterator,0,sizeof(*iterator));  iterator->id=AcquireWandId();  (void) FormatLocaleString(iterator->name,MaxTextExtent,"%s-%.20g",    PixelIteratorId,(double) iterator->id);  iterator->exception=exception;  iterator->view=view;  SetGeometry(image,&iterator->region);  iterator->region.width=image->columns;  iterator->region.height=image->rows;  iterator->region.x=0;  iterator->region.y=0;  iterator->pixel_wands=NewPixelWands(iterator->region.width);  iterator->y=0;  iterator->debug=IsEventLogging();  if (iterator->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);  iterator->signature=WandSignature;  return(iterator);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:77,


示例3: NewPixelRegionIterator

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   N e w P i x e l R e g i o n I t e r a t o r                               %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  NewPixelRegionIterator() returns a new pixel iterator.%%  The format of the NewPixelRegionIterator method is:%%      PixelIterator NewPixelRegionIterator(MagickWand *wand,const long x,%        const long y,const unsigned long width,const unsigned long height)%%  A description of each parameter follows:%%    o wand: the magick wand.%%    o x,y,columns,rows:  These values define the perimeter of a region of%      pixels.%*/WandExport PixelIterator *NewPixelRegionIterator(MagickWand *wand,const long x,  const long y,const unsigned long width,const unsigned long height){  const char    *quantum;  Image    *image;  PixelIterator    *iterator;  unsigned long    depth;  CacheView    *view;  assert(wand != (MagickWand *) NULL);  depth=MAGICKCORE_QUANTUM_DEPTH;  quantum=GetMagickQuantumDepth(&depth);  if (depth != MAGICKCORE_QUANTUM_DEPTH)    ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);  if ((width == 0) || (width == 0))    ThrowWandFatalException(WandError,"ZeroRegionSize",quantum);  image=GetImageFromMagickWand(wand);  if (image == (Image *) NULL)    return((PixelIterator *) NULL);  view=AcquireCacheView(image);  if (view == (CacheView *) NULL)    return((PixelIterator *) NULL);  iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator));  if (iterator == (PixelIterator *) NULL)    ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",      wand->name);  (void) ResetMagickMemory(iterator,0,sizeof(*iterator));  iterator->id=AcquireWandId();  (void) FormatMagickString(iterator->name,MaxTextExtent,"%s-%lu",    PixelIteratorId,iterator->id);  iterator->exception=AcquireExceptionInfo();  iterator->view=view;  SetGeometry(image,&iterator->region);  iterator->region.width=width;  iterator->region.height=height;  iterator->region.x=x;  iterator->region.y=y;  iterator->pixel_wands=NewPixelWands(iterator->region.width);  iterator->y=0;  iterator->debug=IsEventLogging();  if (iterator->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);  iterator->signature=WandSignature;  return(iterator);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:80,


示例4: main

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%  M a i n                                                                    %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/int main(int argc,char **argv){  char    *option,    *text;  ExceptionInfo    *exception;  ImageInfo    *image_info;  MagickBooleanType    regard_warnings,    status;  register long    i;  MagickCoreGenesis(*argv,MagickTrue);  exception=AcquireExceptionInfo();  regard_warnings=MagickFalse;  for (i=1; i < (long) argc; i++)  {    option=argv[i];    if ((strlen(option) == 1) || ((*option != '-') && (*option != '+')))      continue;    if (LocaleCompare("debug",option+1) == 0)      (void) SetLogEventMask(argv[++i]);    if (LocaleCompare("regard-warnings",option+1) == 0)      regard_warnings=MagickTrue;  }  image_info=AcquireImageInfo();  text=(char *) NULL;  status=CompareImageCommand(image_info,argc,argv,&text,exception);  if ((status == MagickFalse) || (exception->severity != UndefinedException))    {      if ((exception->severity < ErrorException) &&          (regard_warnings == MagickFalse))        status=MagickTrue;      CatchException(exception);    }  if (text != (char *) NULL)    {      (void) fputs(text,stdout);      (void) fputc('/n',stdout);      text=DestroyString(text);    }  image_info=DestroyImageInfo(image_info);  exception=DestroyExceptionInfo(exception);  MagickCoreTerminus();  return(status == MagickFalse ? 1 : 0);}
开发者ID:vazexqi,项目名称:ParsecPipelineParallelism,代码行数:66,


示例5: GenerateSecretKey

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   G e n e r a t e S e c r e t K e y                                         %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  GenerateSecretKey() returns WizardTrue if a key is generated and successfully%  added to the secret key ring.%%  The format of the GenerateSecretKey method is:%%      WizardBooleanType GenerateSecretKey(SecretInfo *secret_info,%        ExceptionInfo *exception)%%  A description of each parameter follows:%%    o secret_info: The secret info.%%    o exception: Return any errors or warnings in this structure.%*/WizardExport WizardBooleanType GenerateSecretKey(SecretInfo *secret_info,  ExceptionInfo *exception){  ExceptionInfo    *sans;  WizardBooleanType    status;  StringInfo    *key,    *phrase;  (void) LogWizardEvent(TraceEvent,GetWizardModule(),"...");  WizardAssert(AuthenticateDomain,secret_info != (SecretInfo *) NULL);  WizardAssert(AuthenticateDomain,secret_info->signature == WizardSignature);  WizardAssert(AuthenticateDomain,exception != (ExceptionInfo *) NULL);  if (secret_info->passphrase == (char *) NULL)    phrase=GetPassphrase(exception);  else    phrase=FileToStringInfo(secret_info->passphrase,~0,exception);  if (phrase == (StringInfo *) NULL)    return(WizardFalse);  sans=AcquireExceptionInfo();  do  {    if (secret_info->key != (StringInfo *) NULL)      secret_info->key=DestroyStringInfo(secret_info->key);    secret_info->key=GetRandomKey(secret_info->random_info,      secret_info->key_length/8);    ConstructHMAC(secret_info->hmac_info,phrase,secret_info->key);    if (secret_info->id != (StringInfo *) NULL)      secret_info->id=DestroyStringInfo(secret_info->id);    secret_info->id=CloneStringInfo(GetHMACDigest(secret_info->hmac_info));    SetKeyringId(secret_info->keyring_info,secret_info->id);    status=ExportKeyringKey(secret_info->keyring_info,sans);  } while (status != WizardFalse);  sans=DestroyExceptionInfo(sans);  SetKeyringKey(secret_info->keyring_info,secret_info->key);  SetKeyringNonce(secret_info->keyring_info,secret_info->nonce);  SetCipherKey(secret_info->cipher_info,phrase);  SetCipherNonce(secret_info->cipher_info,GetKeyringNonce(    secret_info->keyring_info));  key=CloneStringInfo(GetKeyringKey(secret_info->keyring_info));  (void) EncipherCipher(secret_info->cipher_info,key);  SetKeyringKey(secret_info->keyring_info,key);  status=ImportKeyringKey(secret_info->keyring_info,exception);  phrase=DestroyStringInfo(phrase);  key=DestroyStringInfo(key);  return(WizardTrue);}
开发者ID:ImageMagick,项目名称:WizardsToolkit,代码行数:77,


示例6: IsRightsAuthorized

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   I s R i g h t s A u t h o r i z e d                                       %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  IsRightsAuthorized() returns MagickTrue if the policy authorizes the%  requested rights for the specified domain.%%  The format of the IsRightsAuthorized method is:%%      MagickBooleanType IsRightsAuthorized(const PolicyDomain domain,%        const PolicyRights rights,const char *pattern)%%  A description of each parameter follows:%%    o domain: the policy domain.%%    o rights: the policy rights.%%    o pattern: the coder, delegate, filter, or path pattern.%*/MagickExport MagickBooleanType IsRightsAuthorized(const PolicyDomain domain,  const PolicyRights rights,const char *pattern){  const PolicyInfo    *policy_info;  ExceptionInfo    *exception;  MagickBooleanType    authorized;  register PolicyInfo    *p;  (void) LogMagickEvent(PolicyEvent,GetMagickModule(),    "Domain: %s; rights=%s; pattern=/"%s/" ...",    CommandOptionToMnemonic(MagickPolicyDomainOptions,domain),    CommandOptionToMnemonic(MagickPolicyRightsOptions,rights),pattern);  exception=AcquireExceptionInfo();  policy_info=GetPolicyInfo("*",exception);  exception=DestroyExceptionInfo(exception);  if (policy_info == (PolicyInfo *) NULL)    return(MagickTrue);  authorized=MagickTrue;  LockSemaphoreInfo(policy_semaphore);  ResetLinkedListIterator(policy_list);  p=(PolicyInfo *) GetNextValueInLinkedList(policy_list);  while ((p != (PolicyInfo *) NULL) && (authorized != MagickFalse))  {    if ((p->domain == domain) &&        (GlobExpression(pattern,p->pattern,MagickFalse) != MagickFalse))      {        if (((rights & ReadPolicyRights) != 0) &&            ((p->rights & ReadPolicyRights) == 0))          authorized=MagickFalse;        if (((rights & WritePolicyRights) != 0) &&            ((p->rights & WritePolicyRights) == 0))          authorized=MagickFalse;        if (((rights & ExecutePolicyRights) != 0) &&            ((p->rights & ExecutePolicyRights) == 0))          authorized=MagickFalse;      }    p=(PolicyInfo *) GetNextValueInLinkedList(policy_list);  }  UnlockSemaphoreInfo(policy_semaphore);  return(authorized);}
开发者ID:AlexiaChen,项目名称:ImageMagick_Cmake,代码行数:76,


示例7: Color_Name_to_PixelPacket

/** * Convert a color name to a PixelPacket * * No Ruby usage (internal function) * * @param color the PixelPacket to modify * @param name_arg the coor name * @throw ArgumentError */static voidColor_Name_to_PixelPacket(PixelPacket *color, VALUE name_arg){    MagickBooleanType okay;    char *name;    ExceptionInfo *exception;    exception = AcquireExceptionInfo();    name = StringValuePtr(name_arg);    okay = QueryColorDatabase(name, color, exception);    (void) DestroyExceptionInfo(exception);    if (!okay)    {        rb_raise(rb_eArgError, "invalid color name %s", name);    }}
开发者ID:x3cion,项目名称:rmagick,代码行数:25,


示例8: ImageList_composite_layers

/** * Equivalent to convert's -layers composite option. * * Ruby usage: *   - @verbatim ImageList#composite_layers(images) @endverbatim *   - @verbatim ImageList#composite_layers(images,operator) @endverbatim * * Notes: *   - Default operator is OverCompositeOp * * @param argc number of input arguments * @param argv array of input arguments * @param self this object * @return a new imagelist * @see mogrify.c in ImageMagick */VALUEImageList_composite_layers(int argc, VALUE *argv, VALUE self){    VALUE source_images;    Image *dest, *source, *new_images;    RectangleInfo geometry;    CompositeOperator operator = OverCompositeOp;    ExceptionInfo *exception;    switch (argc)    {        case 2:            VALUE_TO_ENUM(argv[1], operator, CompositeOperator);        case 1:            source_images = argv[0];            break;        default:            rb_raise(rb_eArgError, "wrong number of arguments (expected 1 or 2, got %d)", argc);            break;    }    // Convert ImageLists to image sequences.    dest = images_from_imagelist(self);    new_images = clone_imagelist(dest);    rm_split(dest);    source = images_from_imagelist(source_images);    SetGeometry(new_images,&geometry);    (void) ParseAbsoluteGeometry(new_images->geometry, &geometry);    geometry.width  = source->page.width != 0 ? source->page.width : source->columns;    geometry.height = source->page.height != 0 ? source->page.height : source->rows;    GravityAdjustGeometry(new_images->page.width  != 0 ? new_images->page.width  : new_images->columns                        , new_images->page.height != 0 ? new_images->page.height : new_images->rows                        , new_images->gravity, &geometry);    exception = AcquireExceptionInfo();    CompositeLayers(new_images, operator, source, geometry.x, geometry.y, exception);    rm_split(source);    rm_check_exception(exception, new_images, DestroyOnError);    (void) DestroyExceptionInfo(exception);    RB_GC_GUARD(source_images);    return rm_imagelist_from_images(new_images);}
开发者ID:ABaumgaertner,项目名称:rmagick,代码行数:63,


示例9: ImageList_deconstruct

/** * Compare each image with the next in a sequence and returns the maximum * bounding region of any pixel differences it discovers. * * Ruby usage: *   - @verbatim ImageList#deconstruct @endverbatim * * @param self this object * @return a new imagelist */VALUEImageList_deconstruct(VALUE self){    Image *new_images, *images;    ExceptionInfo *exception;    images = images_from_imagelist(self);    exception = AcquireExceptionInfo();    new_images = DeconstructImages(images, exception);    rm_split(images);    rm_check_exception(exception, new_images, DestroyOnError);    (void) DestroyExceptionInfo(exception);    rm_ensure_result(new_images);    return rm_imagelist_from_images(new_images);}
开发者ID:ABaumgaertner,项目名称:rmagick,代码行数:27,


示例10: ImageList_montage

/** * Call MontageImages. * * Ruby usage: *   - @verbatim ImageList#montage <{parm block}> @endverbatim * * Notes: *   - Creates Montage object, yields to block if present in Montage object's *     scope. * * @param self this object * @return a new image list */VALUEImageList_montage(VALUE self){    VALUE montage_obj;    Montage *montage;    Image *new_images, *images;    ExceptionInfo *exception;    // Create a new instance of the Magick::Montage class    montage_obj = rm_montage_new();    if (rb_block_given_p())    {        // Run the block in the instance's context, allowing the app to modify the        // object's attributes.        (void) rb_obj_instance_eval(0, NULL, montage_obj);    }    Data_Get_Struct(montage_obj, Montage, montage);    images = images_from_imagelist(self);    // If app specified a non-default composition operator, use it for all images.    if (montage->compose != UndefinedCompositeOp)    {        Image *i;        for (i = images; i; i = GetNextImageInList(i))        {            i->compose = montage->compose;        }    }    exception = AcquireExceptionInfo();    // MontageImage can return more than one image.    new_images = MontageImages(images, montage->info, exception);    rm_split(images);    rm_check_exception(exception, new_images, DestroyOnError);    (void) DestroyExceptionInfo(exception);    rm_ensure_result(new_images);    RB_GC_GUARD(montage_obj);    return rm_imagelist_from_images(new_images);}
开发者ID:ABaumgaertner,项目名称:rmagick,代码行数:58,


示例11: ImageList_coalesce

/** * Call CoalesceImages. * * Ruby usage: *   - @verbatim ImageList#coalesce @endverbatim * * Notes: *   - Respects the delay, matte, and start_loop fields in each image. * * @param self this object * @return a new Image with the coalesced image sequence return stored in the * images array */VALUEImageList_coalesce(VALUE self){    Image *images, *new_images;    ExceptionInfo *exception;    // Convert the image array to an image sequence.    images = images_from_imagelist(self);    exception = AcquireExceptionInfo();    new_images = CoalesceImages(images, exception);    rm_split(images);    rm_check_exception(exception, new_images, DestroyOnError);    (void) DestroyExceptionInfo(exception);    rm_ensure_result(new_images);    return rm_imagelist_from_images(new_images);}
开发者ID:ABaumgaertner,项目名称:rmagick,代码行数:32,


示例12: CloneImageInfo

/** * Undo the image_to_str, above. * * No Ruby usage (internal function) * * Notes: *   - Returns NULL if the argument is Qnil * * @param str the Ruby string to convert * @return Image represented by str * @see image_to_str */staticImage *str_to_image(VALUE str){    Image *image = NULL;    Info *info;    ExceptionInfo *exception;    if (str != Qnil)    {        info = CloneImageInfo(NULL);        exception = AcquireExceptionInfo();        image = BlobToImage(info, RSTRING_PTR(str), RSTRING_LEN(str), exception);        DestroyImageInfo(info);        CHECK_EXCEPTION();        DestroyExceptionInfo(exception);    }    return image;}
开发者ID:Watson1978,项目名称:rmagick,代码行数:31,


示例13: ImageWrite

int ImageWrite( struct ImageLibrary *im, Image *img, File *rootDev, const char *path ){	FHandler *fh = rootDev->f_FSys;	File *rfp = (File *)fh->FileOpen( rootDev, path, "wb" );	if( rfp != NULL )	{		char *buffer = NULL;		size_t length = 0;				ExceptionInfo *ei=AcquireExceptionInfo();        ImageInfo *ii=CloneImageInfo((ImageInfo *) NULL);										buffer =  ImageToBlob( ii, img, &length, ei );				if( buffer == NULL )		{			ERROR("Cannot image to data/n");			DestroyExceptionInfo( ei );			DestroyImageInfo( ii );			fh->FileClose( rootDev, rfp );						return 2;		}		else		{			fh->FileWrite( rfp, buffer, length );		}				DestroyExceptionInfo( ei );		DestroyImageInfo( ii );				fh->FileClose( rootDev, rfp );	}	else	{		ERROR("Cannot open file: %s to write/n", path );		return 1;	}	return 0;}
开发者ID:nupfel,项目名称:friendup,代码行数:42,


示例14: CloneImageView

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   C l o n e I m a g e V i e w                                               %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  CloneImageView() makes a copy of the specified image view.%%  The format of the CloneImageView method is:%%      ImageView *CloneImageView(const ImageView *image_view)%%  A description of each parameter follows:%%    o image_view: the image view.%*/MagickExport ImageView *CloneImageView(const ImageView *image_view){  ImageView    *clone_view;  assert(image_view != (ImageView *) NULL);  assert(image_view->signature == MagickSignature);  clone_view=(ImageView *) AcquireMagickMemory(sizeof(*clone_view));  if (clone_view == (ImageView *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  (void) ResetMagickMemory(clone_view,0,sizeof(*clone_view));  clone_view->description=ConstantString(image_view->description);  clone_view->extent=image_view->extent;  clone_view->view=CloneCacheView(image_view->view);  clone_view->exception=AcquireExceptionInfo();  InheritException(clone_view->exception,image_view->exception);  clone_view->debug=image_view->debug;  clone_view->signature=MagickSignature;  return(clone_view);}
开发者ID:rickwangtw,项目名称:ImageMagick,代码行数:42,


示例15: LLVMFuzzerTestOneInput

/*  We use BlobToImage to load input as an image, if successful destroy image.  */extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) {  Image *image;  ImageInfo image_info;  ExceptionInfo *exception;  GetImageInfo(&image_info);  exception = AcquireExceptionInfo();  image = BlobToImage(&image_info, data, size, exception);  if (exception->severity != UndefinedException){    //CatchException(exception);        }  if(image != (Image *) NULL){    DestroyImage(image);  }    DestroyExceptionInfo(exception);  return 0;}
开发者ID:Andy10101,项目名称:libfuzzerfication,代码行数:23,


示例16: clone_imagelist

/** * Clone a list of images, handle errors. * * No Ruby usage (internal function) * * @param images the images * @return a new array of images */static Image *clone_imagelist(Image *images){    Image *new_imagelist = NULL, *image, *clone;    ExceptionInfo *exception;    exception = AcquireExceptionInfo();    image = GetFirstImageInList(images);    while (image)    {        clone = CloneImage(image, 0, 0, MagickTrue, exception);        rm_check_exception(exception, new_imagelist, DestroyOnError);        AppendImageToList(&new_imagelist, clone);        image = GetNextImageInList(image);    }    (void) DestroyExceptionInfo(exception);    return new_imagelist;}
开发者ID:ABaumgaertner,项目名称:rmagick,代码行数:28,


示例17: main

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%  M a i n                                                                    %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/int main(int argc,char **argv){  ExceptionInfo    *exception;  ImageInfo    *image_info;  MagickBooleanType    status;  MagickCoreGenesis(*argv,MagickTrue);  exception=AcquireExceptionInfo();  image_info=AcquireImageInfo();  status=MagickCommandGenesis(image_info,MogrifyImageCommand,argc,argv,    (char **) NULL,exception);  image_info=DestroyImageInfo(image_info);  exception=DestroyExceptionInfo(exception);  MagickCoreTerminus();  return(status);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:34,


示例18: GetLocaleMessage

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   G e t L o c a l e M e s s a g e                                           %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  GetLocaleMessage() returns a message in the current locale that matches the%  supplied tag.%%  The format of the GetLocaleMessage method is:%%      const char *GetLocaleMessage(const char *tag)%%  A description of each parameter follows:%%    o tag: Return a message that matches this tag in the current locale.%*/MagickExport const char *GetLocaleMessage(const char *tag){  char    name[MaxTextExtent];  const LocaleInfo    *locale_info;  ExceptionInfo    *exception;  if ((tag == (const char *) NULL) || (*tag == '/0'))    return(tag);  exception=AcquireExceptionInfo();  (void) FormatMagickString(name,MaxTextExtent,"%s/",tag);  locale_info=GetLocaleInfo_(name,exception);  exception=DestroyExceptionInfo(exception);  if (locale_info != (const LocaleInfo *) NULL)    return(locale_info->message);  return(tag);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:44,


示例19: NewMagickWand

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   N e w M a g i c k W a n d                                                 %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  NewMagickWand() returns a wand required for all other methods in the API.%%  The format of the NewMagickWand method is:%%      MagickWand *NewMagickWand(void)%*/WandExport MagickWand *NewMagickWand(void){  const char    *quantum;  MagickWand    *wand;  unsigned long    depth;  depth=QuantumDepth;  quantum=GetMagickQuantumDepth(&depth);  if (depth != QuantumDepth)    ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);  wand=(MagickWand *) AcquireMagickMemory(sizeof(*wand));  if (wand == (MagickWand *) NULL)    {      char        *message;      message=GetExceptionMessage(errno);      ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",        message);      message=DestroyString(message);    }  (void) ResetMagickMemory(wand,0,sizeof(*wand));  wand->id=AcquireWandId();  (void) FormatMagickString(wand->name,MaxTextExtent,"%s-%lu",MagickWandId,    wand->id);  wand->exception=AcquireExceptionInfo();  wand->image_info=AcquireImageInfo();  wand->quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);  wand->images=NewImageList();  wand->debug=IsEventLogging();  if (wand->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);  wand->signature=WandSignature;  return(wand);}
开发者ID:vazexqi,项目名称:ParsecPipelineParallelism,代码行数:58,


示例20: main

int main (int argc, char **argv) {  if (argc != 5) {    printf ("Usage: %s image_file scheme_file key_file layout_type/n",            argv[0]);    return (0);  }  char *ifile_name = argv[1];  char *ofile_name = argv[2];  char *key_name = argv[3];  SM_LayoutType layout_type = (SM_LayoutType)atoi(argv[4]);  MagickWandGenesis();  ExceptionInfo *exception = AcquireExceptionInfo();    MagickWand *image = NewMagickWand();  // Read an image.  printf("Proceeding file %s/n", ifile_name);  MagickReadImage(image, ifile_name);  SM_SchemeGenerator *generator = SM_CrossStitchSchemeGenerator_New();  SM_Scheme *scheme_base =       SM_SchemeGenerator_GenerateScheme(generator, image);  MagickWand *scheme =      SM_CrossStitch_Color_Draw(scheme_base, layout_type);  scheme_base->cell_info.square->width *= 2;  MagickWand *key =       SM_CrossStitch_Key_Draw(scheme_base, layout_type);  MagickWriteImage(scheme, ofile_name);  MagickWriteImage(key, key_name);  SM_SchemeGenerator_Delete(generator);  SM_Scheme_Delete(scheme_base);  DestroyMagickWand(image);  DestroyMagickWand(scheme);  exception = DestroyExceptionInfo(exception);  MagickWandTerminus();  printf("Done!/n");  return (0);}
开发者ID:adavydow,项目名称:scheme-maker-we,代码行数:40,


示例21: BufStringNew

Image *ImageRead( struct ImageLibrary *im, File *rootDev, const char *path ){	Image *img = NULL;	FHandler *fh = rootDev->f_FSys;	File *rfp = (File *)fh->FileOpen( rootDev, path, "rb" );	if( rfp != NULL )	{		BufString *bs = BufStringNew( );		char buffer[ 20048 ];		int len = 0;		while( ( len = fh->FileRead( rfp, buffer, 20048 ) ) > 0 )		{			BufStringAddSize( bs, buffer, len );		}				ExceptionInfo *ei=AcquireExceptionInfo();        ImageInfo *ii=CloneImageInfo((ImageInfo *) NULL);										img = BlobToImage( ii, bs->bs_Buffer, bs->bs_Size, ei );				if( img == NULL )		{			ERROR("Cannot convert file data to image/n");		}				DestroyExceptionInfo( ei );		DestroyImageInfo( ii );				BufStringDelete( bs );				fh->FileClose( rootDev, rfp );	}	else	{		ERROR("Cannot open file: %s to read/n", path );	}}
开发者ID:nupfel,项目名称:friendup,代码行数:38,


示例22: FResizeImage

int FResizeImage( struct ImageLibrary *im, Image **image, int w, int h ){	if( image != NULL )	{		ExceptionInfo *ei=AcquireExceptionInfo();				///filters are in resamples.h		Image* newImage = ResizeImage( *image, w, h, LanczosFilter, 1.0, ei );		if( newImage != NULL )		{			DeleteImage( *image );			*image = newImage;		}				DestroyExceptionInfo( ei );	}	else	{		ERROR("Cannot resize empty image/n");	}		return 0;}
开发者ID:nupfel,项目名称:friendup,代码行数:23,


示例23: 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:MaximOrlovsky,项目名称:unix-toolbox.js-imagemagick,代码行数:45,


示例24: 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,


示例25: MagickToMime

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %+  M a g i c k T o M i m e                                                    %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  MagickToMime() returns the officially registered (or de facto) MIME%  media-type corresponding to a magick string.  If there is no registered%  media-type, then the string "image/x-magick" (all lower case) is returned.%  The returned string must be deallocated by the user.%%  The format of the MagickToMime method is:%%      char *MagickToMime(const char *magick)%%  A description of each parameter follows.%%   o  magick:  ImageMagick format specification "magick" tag.%*/MagickExport char *MagickToMime(const char *magick){  char    filename[MagickPathExtent],    media[MagickPathExtent];  const MimeInfo    *mime_info;  ExceptionInfo    *exception;  (void) FormatLocaleString(filename,MagickPathExtent,"file.%s",magick);  LocaleLower(filename);  exception=AcquireExceptionInfo();  mime_info=GetMimeInfo(filename,(unsigned char *) " ",1,exception);  exception=DestroyExceptionInfo(exception);  if (mime_info != (const MimeInfo *) NULL)    return(ConstantString(GetMimeType(mime_info)));  (void) FormatLocaleString(media,MagickPathExtent,"image/x-%s",magick);  LocaleLower(media+8);  return(ConstantString(media));}
开发者ID:vcgato29,项目名称:ImageMagick,代码行数:48,


示例26: ImageList_mosaic

/** * Merge all the images into a single image. * * Ruby usage: *   - @verbatim ImageList#mosaic @endverbatim * * @param self this object * @return the new image */VALUEImageList_mosaic(VALUE self){    Image *images, *new_image;    ExceptionInfo *exception;    exception = AcquireExceptionInfo();    images = images_from_imagelist(self);#if defined(HAVE_ENUM_MOSAICLAYER)    new_image = MergeImageLayers(images, MosaicLayer, exception);#else    new_image = MosaicImages(images, exception);#endif    rm_split(images);    rm_check_exception(exception, new_image, DestroyOnError);    (void) DestroyExceptionInfo(exception);    rm_ensure_result(new_image);    return rm_image_new(new_image);}
开发者ID:ABaumgaertner,项目名称:rmagick,代码行数:32,


示例27: 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 policy_info:  The policy info.%*/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:AlexiaChen,项目名称:ImageMagick_Cmake,代码行数:45,


示例28: magickminify

void* magickminify(void* src, ssize_t src_len, ssize_t* dst_len){  Image *image, *resize;  ImageInfo image_info;  ExceptionInfo *exception;  size_t len;  void *ans;  GetImageInfo(&image_info);  exception = AcquireExceptionInfo();  image = BlobToImage(&image_info, src, src_len, exception);  if (exception->severity != UndefinedException)    CatchException(exception);  if (image == (Image *) NULL) {    printf("image not obtained by BlobToImage./n");    exit(1);  }  resize = MinifyImage(image, exception);  if (exception->severity != UndefinedException)    CatchException(exception);  if (resize == (Image *) NULL)    exit(1);  ans = ImageToBlob(&image_info, resize, &len, exception);    if(dst_len != NULL)    *dst_len = len;  DestroyImage(image);  DestroyImage(resize);  DestroyExceptionInfo(exception);  return ans;}
开发者ID:AchuCherukuri,项目名称:CS8803_Projects,代码行数:37,


示例29: 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,



注:本文中的AcquireExceptionInfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ AcquireImage函数代码示例
C++ AcquireAuthenticCacheView函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。