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

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

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

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

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

示例1: _imageInfo

Magick::Options::Options(void)  : _imageInfo(static_cast<ImageInfo*>(AcquireMagickMemory(      sizeof(ImageInfo)))),    _quantizeInfo(static_cast<QuantizeInfo*>(AcquireMagickMemory(      sizeof(QuantizeInfo)))),    _drawInfo(static_cast<DrawInfo*>(AcquireMagickMemory(sizeof(DrawInfo)))),    _quiet(false){  // Initialize image info with defaults  GetImageInfo(_imageInfo);  // Initialize quantization info  GetQuantizeInfo(_quantizeInfo);  // Initialize drawing info  GetDrawInfo(_imageInfo,_drawInfo);}
开发者ID:ImageMagick,项目名称:ImageMagick,代码行数:17,


示例2: 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 ssize_t x,%        const ssize_t y,const size_t width,const size_t 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 ssize_t x,const ssize_t y,const size_t width,const size_t height){  CacheView    *view;  const char    *quantum;  ExceptionInfo    *exception;  Image    *image;  PixelIterator    *iterator;  size_t    depth;  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);  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",      wand->name);  (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=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,代码行数:84,


示例3: ExportStart

MAGICK_NET_EXPORT unsigned short *PixelCollection_ToShortArray(const CacheView *instance, const size_t x, const size_t y, const size_t width, const size_t height, const char *mapping, ExceptionInfo **exception){  ExportStart(unsigned short);  result = AcquireMagickMemory(length);  MAGICK_NET_GET_EXCEPTION;  ExportImagePixels(GetCacheViewImage(instance), x, y, width, height, mapping, ShortPixel, result, exceptionInfo);  MAGICK_NET_SET_EXCEPTION;  return result;}
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:9,


示例4: AcquireQuantumMemory

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e Q u a n t u m M e m o r y                                   %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireQuantumMemory() returns a pointer to a block of memory at least%  count * quantum bytes suitably aligned for any use.%%  The format of the AcquireQuantumMemory method is:%%      void *AcquireQuantumMemory(const size_t count,const size_t quantum)%%  A description of each parameter follows:%%    o count: the number of quantum elements to allocate.%%    o quantum: the number of bytes in each quantum.%*/MagickExport void *AcquireQuantumMemory(const size_t count,const size_t quantum){  size_t    extent;  if (CheckMemoryOverflow(count,quantum) != MagickFalse)    return((void *) NULL);  extent=count*quantum;  return(AcquireMagickMemory(extent));}
开发者ID:DINKIN,项目名称:ImageMagick,代码行数:35,


示例5: AcquireVirtualMemory

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e V i r t u a l M e m o r y                                   %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireVirtualMemory() allocates a pointer to a block of memory at least size%  bytes suitably aligned for any use.%%  The format of the AcquireVirtualMemory method is:%%      MemoryInfo *AcquireVirtualMemory(const size_t count,const size_t quantum)%%  A description of each parameter follows:%%    o count: the number of quantum elements to allocate.%%    o quantum: the number of bytes in each quantum.%*/MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count,  const size_t quantum){  MemoryInfo    *memory_info;  size_t    length;  length=count*quantum;  if ((count == 0) || (quantum != (length/count)))    {      errno=ENOMEM;      return((void *) NULL);    }  memory_info=(MemoryInfo *) MagickAssumeAligned(AcquireAlignedMemory(1,    sizeof(*memory_info)));  if (memory_info == (MemoryInfo *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  (void) ResetMagickMemory(memory_info,0,sizeof(*memory_info));  memory_info->length=length;  memory_info->signature=MagickSignature;  memory_info->blob=AcquireMagickMemory(length);  if (memory_info->blob == NULL)    {      /*        Heap memory failed, try anonymous memory mapping.      */      memory_info->mapped=MagickTrue;      memory_info->blob=MapBlob(-1,IOMode,0,length);    }  if (memory_info->blob == NULL)    {      int        file;      /*        Anonymous memory mapping failed, try file-backed memory mapping.      */      file=AcquireUniqueFileResource(memory_info->filename);      file=open_utf8(memory_info->filename,O_RDWR | O_CREAT | O_BINARY | O_EXCL,        S_MODE);      if (file == -1)        file=open_utf8(memory_info->filename,O_RDWR | O_BINARY,S_MODE);      if (file != -1)        {          if ((lseek(file,length-1,SEEK_SET) >= 0) && (write(file,"",1) == 1))            memory_info->blob=MapBlob(file,IOMode,0,length);          (void) close(file);        }    }  if (memory_info->blob == NULL)    return(RelinquishVirtualMemory(memory_info));  return(memory_info);}
开发者ID:jrusnak92,项目名称:good_principles,代码行数:80,


示例6: AcquireTokenInfo

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e T o k e n I n f o                                           %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireTokenInfo() allocates the TokenInfo structure.%%  The format of the AcquireTokenInfo method is:%%      TokenInfo *AcquireTokenInfo()%*/MagickExport TokenInfo *AcquireTokenInfo(void){  TokenInfo    *token_info;  token_info=(TokenInfo *) AcquireMagickMemory(sizeof(*token_info));  if (token_info == (TokenInfo *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  token_info->signature=MagickCoreSignature;  return(token_info);}
开发者ID:riingo,项目名称:ImageMagick,代码行数:29,


示例7: return

MAGICK_NET_EXPORT GeometryInfo *MagickGeometry_Create(void){  GeometryInfo    *geometry_info;  geometry_info = (GeometryInfo *)AcquireMagickMemory(sizeof(*geometry_info));  if (geometry_info == (GeometryInfo *)NULL)    return (GeometryInfo *)NULL;  ResetMagickMemory(geometry_info, 0, sizeof(*geometry_info));  return geometry_info;}
开发者ID:modulexcite,项目名称:Magick.NET,代码行数:11,


示例8: 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 columns,const unsigned long rows,%        const MagickBooleanType modify)%%  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 columns,const unsigned long rows){  const char    *quantum;  Image    *image;  PixelIterator    *iterator;  unsigned long    depth;  ViewInfo    *view;  assert(wand != (MagickWand *) NULL);  depth=MAGICKCORE_QUANTUM_DEPTH;  quantum=GetMagickQuantumDepth(&depth);  if (depth != MAGICKCORE_QUANTUM_DEPTH)    ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);  if ((columns == 0) || (rows == 0))    ThrowWandFatalException(WandError,"ZeroRegionSize",quantum);  image=GetImageFromMagickWand(wand);  if (image == (Image *) NULL)    return((PixelIterator *) NULL);  view=OpenCacheView(image);  if (view == (ViewInfo *) 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=columns;  iterator->region.height=rows;  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:KiiCorp,项目名称:ImageMagick,代码行数:81,


示例9: MagickQueryMultilineFontMetrics

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   M a g i c k Q u e r y M u l t i l i n e F o n t M e t r i c s             %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  MagickQueryMultilineFontMetrics() returns a 7 element array representing the%  following font metrics:%%    Element Description%    -------------------------------------------------%          0 character width%          1 character height%          2 ascender%          3 descender%          4 text width%          5 text height%          6 maximum horizontal advance%%  This method is like MagickQueryFontMetrics() but it returns the maximum text%  width and height for multiple lines of text.%%  The format of the MagickQueryFontMetrics method is:%%      double *MagickQueryMultilineFontMetrics(MagickWand *wand,%        const DrawingWand *drawing_wand,const char *text)%%  A description of each parameter follows:%%    o wand: The Magick wand.%%    o drawing_wand: The drawing wand.%%    o text: The text.%*/WandExport double *MagickQueryMultilineFontMetrics(MagickWand *wand,  const DrawingWand *drawing_wand,const char *text){  double    *font_metrics;  DrawInfo    *draw_info;  MagickBooleanType    status;  TypeMetric    metrics;  assert(wand != (MagickWand *) NULL);  assert(wand->signature == MagickSignature);  if (wand->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);  assert(drawing_wand != (const DrawingWand *) NULL);  if (wand->images == (Image *) NULL)    {      (void) ThrowMagickException(&wand->exception,GetMagickModule(),WandError,        "ContainsNoImages","`%s'",wand->name);      return((double *) NULL);    }  font_metrics=(double *) AcquireMagickMemory(7*sizeof(*font_metrics));  if (font_metrics == (double *) NULL)    return((double *) NULL);  draw_info=PeekDrawingWand(drawing_wand);  if (draw_info == (DrawInfo *) NULL)    {      font_metrics=(double *) RelinquishMagickMemory(font_metrics);      return((double *) NULL);    }  (void) CloneString(&draw_info->text,text);  (void) ResetMagickMemory(&metrics,0,sizeof(metrics));  status=GetMultilineTypeMetrics(wand->images,draw_info,&metrics);  draw_info=DestroyDrawInfo(draw_info);  if (status == MagickFalse)    {      InheritException(&wand->exception,&wand->images->exception);      font_metrics=(double *) RelinquishMagickMemory(font_metrics);      return((double *) NULL);    }  font_metrics[0]=metrics.pixels_per_em.x;  font_metrics[1]=metrics.pixels_per_em.y;  font_metrics[2]=metrics.ascent;  font_metrics[3]=metrics.descent;  font_metrics[4]=metrics.width;  font_metrics[5]=metrics.height;  font_metrics[6]=metrics.max_advance;  return(font_metrics);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:95,


示例10: magick_malloc

void *magick_malloc(const size_t size){    void *ptr;    ptr = AcquireMagickMemory(size);    if (!ptr)    {        rb_raise(rb_eNoMemError, "not enough memory to continue");    }    return ptr;}
开发者ID:r-project,项目名称:BS,代码行数:12,


示例11: MagickCreateThreadKey

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   M a g i c k C r e a t e T h r e a d K e y                                 %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  MagickCreateThreadKey() creates a thread key and returns it.%%  The format of the MagickCreateThreadKey method is:%%      MagickThreadKey MagickCreateThreadKey(MagickThreadKey *key)%*/MagickExport MagickBooleanType MagickCreateThreadKey(MagickThreadKey *key){#if defined(MAGICKCORE_THREAD_SUPPORT)  return(pthread_key_create(key,NULL) == 0 ? MagickTrue : MagickFalse);#elif defined(MAGICKCORE_HAVE_WINTHREADS)  *key=TlsAlloc();  return(*key != TLS_OUT_OF_INDEXES ? MagickTrue : MagickFalse);#else  *key=AcquireMagickMemory(sizeof(key));  return(*key != (void *) NULL ? MagickTrue : MagickFalse);#endif}
开发者ID:brightinteractive,项目名称:debian-imagemagick,代码行数:30,


示例12: ResizeMagickMemory

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   R e s i z e M a g i c k M e m o r y                                       %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ResizeMagickMemory() changes the size of the memory and returns a pointer to%  the (possibly moved) block.  The contents will be unchanged up to the%  lesser of the new and old sizes.%%  The format of the ResizeMagickMemory method is:%%      void *ResizeMagickMemory(void *memory,const size_t size)%%  A description of each parameter follows:%%    o memory: A pointer to a memory allocation.  On return the pointer%      may change but the contents of the original allocation will not.%%    o size: The new size of the allocated memory.%%*/WandExport void *ResizeMagickMemory(void *memory,const size_t size){  void    *allocation;  if (memory == (void *) NULL)    return(AcquireMagickMemory(size));  allocation=realloc(memory,size);  if (allocation == (void *) NULL)    (void) RelinquishMagickMemory(memory);  return(allocation);}
开发者ID:CliffsDover,项目名称:graphicsmagick,代码行数:40,


示例13: AcquireExceptionInfo

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e E x c e p t i o n I n f o                                   %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireExceptionInfo() allocates the ExceptionInfo structure.%%  The format of the AcquireExceptionInfo method is:%%      ExceptionInfo *AcquireExceptionInfo(void)%*/MagickExport ExceptionInfo *AcquireExceptionInfo(void){  ExceptionInfo    *exception;  exception=(ExceptionInfo *) AcquireMagickMemory(sizeof(*exception));  if (exception == (ExceptionInfo *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  GetExceptionInfo(exception);  exception->relinquish=MagickTrue;  return(exception);}
开发者ID:Distrotech,项目名称:ImageMagick,代码行数:30,


示例14: switch

void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_,  const ::ssize_t y_,const size_t width_,const size_t height_,  std::string map_,const StorageType type_){  size_t    size;  _data=(void *) NULL;  _length=0;  _size=0;  if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) ||      (x_ > image_.columns()) || ((width_ + x_) > image_.columns())      || (y_ > image_.rows()) || ((height_ + y_) > image_.rows())      || (map_.length() == 0))    return;  switch(type_)  {    case CharPixel:      size=sizeof(unsigned char);      break;    case DoublePixel:      size=sizeof(double);      break;    case FloatPixel:      size=sizeof(float);      break;    case IntegerPixel:    case LongPixel:      size=sizeof(unsigned int);      break;    case QuantumPixel:      size=sizeof(Quantum);      break;    case ShortPixel:      size=sizeof(unsigned short);      break;    default:      throwExceptionExplicit(OptionError,"Invalid type");      return;  }  _length=width_*height_*map_.length();  _size=_length*size;  _data=AcquireMagickMemory(_size);  GetPPException;  MagickCore::ExportImagePixels(image_.constImage(),x_,y_,width_,height_,    map_.c_str(),type_,_data,exceptionInfo);  if (exceptionInfo->severity != UndefinedException)    relinquish();  ThrowPPException(image_.quiet());}
开发者ID:CamiloBenavides,项目名称:SnoutPoint-Web,代码行数:53,


示例15: AcquireQuantumMemory

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e Q u a n t u m M e m o r y                                   %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireQuantumMemory() returns a pointer to a block of memory at least%  count * quantum bytes suitably aligned for any use.%%  The format of the AcquireQuantumMemory method is:%%      void *AcquireQuantumMemory(const size_t count,const size_t quantum)%%  A description of each parameter follows:%%    o count: the number of quantum elements to allocate.%%    o quantum: the number of bytes in each quantum.%*/MagickExport void *AcquireQuantumMemory(const size_t count,const size_t quantum){  size_t    size;  size=count*quantum;  if ((count == 0) || (quantum != (size/count)))    {      errno=ENOMEM;      return((void *) NULL);    }  return(AcquireMagickMemory(size));}
开发者ID:CamiloBenavides,项目名称:SnoutPoint-Web,代码行数:38,


示例16: CloneExceptionInfo

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   C l o n e E x c e p t i o n I n f o                                       %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  CloneExceptionInfo() clones the ExceptionInfo structure.%%  The format of the CloneExceptionInfo method is:%%      ExceptionInfo *CloneException(ExceptionInfo *exception)%%  A description of each parameter follows:%%    o exception: the exception info.%*/MagickExport ExceptionInfo *CloneExceptionInfo(ExceptionInfo *exception){  ExceptionInfo    *clone_exception;  clone_exception=(ExceptionInfo *) AcquireMagickMemory(sizeof(*exception));  if (clone_exception == (ExceptionInfo *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  GetExceptionInfo(clone_exception);  InheritException(clone_exception,exception);  exception->relinquish=MagickTrue;  return(exception);}
开发者ID:Distrotech,项目名称:ImageMagick,代码行数:35,


示例17: AcquireTimerInfo

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e T i m e r I n f o                                           %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireTimerInfo() initializes the TimerInfo structure.  It effectively%  creates a stopwatch and starts it.%%  The format of the AcquireTimerInfo method is:%%      TimerInfo *AcquireTimerInfo(void)%*/MagickExport TimerInfo *AcquireTimerInfo(void){  TimerInfo    *timer_info;  timer_info=(TimerInfo *) AcquireMagickMemory(sizeof(*timer_info));  if (timer_info == (TimerInfo *) NULL)    ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");  (void) ResetMagickMemory(timer_info,0,sizeof(*timer_info));  timer_info->signature=MagickSignature;  GetTimerInfo(timer_info);  return(timer_info);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:32,


示例18: 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;  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);  view=AcquireCacheView(image);  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) FormatMagickString(iterator->name,MaxTextExtent,"%s-%.20g",    PixelIteratorId,(double) iterator->id);  iterator->exception=AcquireExceptionInfo();  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,代码行数:73,


示例19: AcquireScriptTokenInfo

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   A c q u i r e S c r i p t T o k e n I n f o                               %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  AcquireScriptTokenInfo() allocated, initializes and opens the given%  file stream from which tokens are to be extracted.%%  The format of the AcquireScriptTokenInfo method is:%%     ScriptTokenInfo *AcquireScriptTokenInfo(char *filename)%%  A description of each parameter follows:%%    o filename   the filename to open  ("-" means stdin)%*/WandExport ScriptTokenInfo *AcquireScriptTokenInfo(char *filename){  ScriptTokenInfo    *token_info;  token_info=(ScriptTokenInfo *) AcquireMagickMemory(sizeof(*token_info));  if (token_info == (ScriptTokenInfo *) NULL)    return token_info;  (void) ResetMagickMemory(token_info,0,sizeof(*token_info));  token_info->opened=MagickFalse;  if ( LocaleCompare(filename,"-") == 0 ) {    token_info->stream=stdin;    token_info->opened=MagickFalse;  }  else if ( LocaleNCompare(filename,"fd:",3) == 0 ) {    token_info->stream=fdopen(StringToLong(filename+3),"r");    token_info->opened=MagickFalse;  }  else {    token_info->stream=fopen_utf8(filename, "r");  }  if ( token_info->stream == (FILE *)NULL ) {    token_info=(ScriptTokenInfo *) RelinquishMagickMemory(token_info);    return(token_info);  }  token_info->curr_line=1;  token_info->length=INITAL_TOKEN_LENGTH;  token_info->token=(char *) AcquireMagickMemory(token_info->length);  token_info->status=(token_info->token != (char *)NULL)                      ? TokenStatusOK : TokenStatusMemoryFailed;  token_info->signature=WandSignature;  return token_info;}
开发者ID:Ladeira,项目名称:ImageMagick,代码行数:60,


示例20: RelinquishMagickMemory

void Magick::Options::strokeDashArray(const double *strokeDashArray_){  _drawInfo->dash_pattern=(double *) RelinquishMagickMemory(    _drawInfo->dash_pattern);  if(strokeDashArray_)    {      size_t        x;      // Count elements in dash array      for (x=0; strokeDashArray_[x]; x++) ;      // Allocate elements      _drawInfo->dash_pattern=static_cast<double*>(AcquireMagickMemory((x+1)*        sizeof(double)));      // Copy elements      memcpy(_drawInfo->dash_pattern,strokeDashArray_,(x+1)*sizeof(double));    }}
开发者ID:riingo,项目名称:ImageMagick,代码行数:18,


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


示例22: ThrowException

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   T h r o w E x c e p t i o n                                               %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ThrowException() throws an exception with the specified severity code,%  reason, and optional description.%%  The format of the ThrowException method is:%%      MagickBooleanType ThrowException(ExceptionInfo *exception,%        const ExceptionType severity,const char *reason,%        const char *description)%%  A description of each parameter follows:%%    o exception: the exception info.%%    o severity: the severity of the exception.%%    o reason: the reason for the exception.%%    o description: the exception description.%*/MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception,  const ExceptionType severity,const char *reason,const char *description){  register ExceptionInfo    *p;  assert(exception != (ExceptionInfo *) NULL);  assert(exception->signature == MagickSignature);  LockSemaphoreInfo(exception->semaphore);  p=(ExceptionInfo *) GetLastValueInLinkedList((LinkedListInfo *)    exception->exceptions);  if ((p != (ExceptionInfo *) NULL) && (p->severity == severity) &&      (LocaleCompare(exception->reason,reason) == 0) &&      (LocaleCompare(exception->description,description) == 0))    {      UnlockSemaphoreInfo(exception->semaphore);      return(MagickTrue);    }  p=(ExceptionInfo *) AcquireMagickMemory(sizeof(*p));  if (p == (ExceptionInfo *) NULL)    {      UnlockSemaphoreInfo(exception->semaphore);      ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");    }  (void) ResetMagickMemory(p,0,sizeof(*p));  p->severity=severity;  if (reason != (const char *) NULL)    p->reason=ConstantString(reason);  if (description != (const char *) NULL)    p->description=ConstantString(description);  p->signature=MagickSignature;  (void) AppendValueToLinkedList((LinkedListInfo *) exception->exceptions,p);  if (p->severity >= exception->severity)    {      exception->severity=p->severity;      exception->reason=p->reason;      exception->description=p->description;    }  UnlockSemaphoreInfo(exception->semaphore);  return(MagickTrue);}
开发者ID:Distrotech,项目名称:ImageMagick,代码行数:72,


示例23: AcquireMagickMemory

MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,  Image *image){  MagickBooleanType    status;  QuantumInfo    *quantum_info;  quantum_info=(QuantumInfo *) AcquireMagickMemory(sizeof(*quantum_info));  if (quantum_info == (QuantumInfo *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  quantum_info->signature=MagickSignature;  GetQuantumInfo(image_info,quantum_info);  if (image == (const Image *) NULL)    return(quantum_info);  status=SetQuantumDepth(image,quantum_info,image->depth);  if (status == MagickFalse)    quantum_info=DestroyQuantumInfo(quantum_info);  return(quantum_info);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:21,


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


示例25: CloneCacheView

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   C l o n e C a c h e V i e w                                               %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  CloneCacheView()  makes an exact copy of the specified cache view.%%  The format of the CloneCacheView method is:%%      CacheView *CloneCacheView(const CacheView *cache_view)%%  A description of each parameter follows:%%    o cache_view: the cache view.%*/MagickExport CacheView *CloneCacheView(const CacheView *cache_view){  CacheView    *clone_view;  assert(cache_view != (CacheView *) NULL);  assert(cache_view->signature == MagickSignature);  if (cache_view->debug != MagickFalse)    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",      cache_view->image->filename);  clone_view=(CacheView *) AcquireMagickMemory(sizeof(*clone_view));  if (clone_view == (CacheView *) NULL)    ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");  (void) ResetMagickMemory(clone_view,0,sizeof(*clone_view));  clone_view->image=ReferenceImage(cache_view->image);  clone_view->number_threads=cache_view->number_threads;  clone_view->nexus_info=AcquirePixelCacheNexus(cache_view->number_threads);  clone_view->virtual_pixel_method=cache_view->virtual_pixel_method;  clone_view->debug=cache_view->debug;  clone_view->signature=MagickSignature;  return(clone_view);}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:44,


示例26: RelinquishMagickMemory

void Magick::Options::strokeDashArray(const double *strokeDashArray_){  _drawInfo->dash_pattern=(double *) RelinquishMagickMemory(    _drawInfo->dash_pattern);  if(strokeDashArray_)    {      size_t        x;      // Count elements in dash array      for (x=0; strokeDashArray_[x]; x++) ;      // Allocate elements      _drawInfo->dash_pattern=static_cast<double*>(AcquireMagickMemory((x+1)*        sizeof(double)));      if (!_drawInfo->dash_pattern)        throwExceptionExplicit(MagickCore::ResourceLimitError,          "Unable to allocate dash-pattern memory");      // Copy elements      memcpy(_drawInfo->dash_pattern,strokeDashArray_,(x+1)*sizeof(double));      _drawInfo->dash_pattern[x]=0.0;    }}
开发者ID:ImageMagick,项目名称:ImageMagick,代码行数:22,


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


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



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


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