[
About ImageMagick
] [ Command-line Tools Processing Options Usage Program Interfaces MagickWand MagickCore PerlMagick Magick++ Architecture ] [ Install from Source Unix Windows Binary Releases Unix Mac OS X Windows Resources ] [ Download ] [ Site Map Links ] [ Sponsors: ] |
AcquireImagePixels() obtains a pixel region for read-only access. If the region is successfully accessed, a pointer to it is returned, otherwise NULL is returned. The returned pointer may point to a temporary working copy of the pixels or it may point to the original pixels in memory. Performance is maximized if the selected region is part of one row, or one or more full rows, since there is opportunity to access the pixels in-place (without a copy) if the image is in RAM, or in a memory-mapped file. The returned pointer should *never* be deallocated by the user. Pixels accessed via the returned pointer represent a simple array of type PixelPacket. If the image type is CMYK or the storage class is PseudoClass, call GetIndexes() after invoking GetImagePixels() to access the black color component or to obtain the colormap indexes (of type IndexPacket) corresponding to the region. If you plan to modify the pixels, use GetImagePixels() instead. Note, the AcquireImagePixels() and GetImagePixels() methods are not thread- safe. In a threaded environment, use AcquireCacheViewPixels() or GetCacheViewPixels() instead. The format of the AcquireImagePixels() method is: const PixelPacket *AcquireImagePixels(const Image *image,const long x, const long y,const unsigned long columns,const unsigned long rows, ExceptionInfo *exception) A description of each parameter follows: imagethe image. x,y,columns,rowsThese values define the perimeter of a region of pixels. exceptionReturn any errors or warnings in this structure. AcquireIndexes() returns the black channel or the colormap indexes associated with the last call to SetImagePixels() or AcquireImagePixels(). NULL is returned if the black channel or colormap indexes are not available. The format of the AcquireIndexes() method is: const IndexPacket *AcquireIndexes(const Image *image) A description of each parameter follows: indexesAcquireIndexes() returns the indexes associated with the last call to SetImagePixels() or AcquireImagePixels(). imagethe image. AcquireOneMagickPixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOnePixel() instead. The format of the AcquireOneMagickPixel() method is: MagickPixelPacket AcquireOneMagickPixel(const Image image,const long x, const long y,ExceptionInfo exception) A description of each parameter follows: pixelsAcquireOneMagickPixel() returns a pixel at the specified (x,y) location. imagethe image. x,yThese values define the location of the pixel to return. exceptionReturn any errors or warnings in this structure. AcquireOnePixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOnePixel() instead. The format of the AcquireOnePixel() method is: PixelPacket AcquireOnePixel(const Image image,const long x, const long y,ExceptionInfo exception) A description of each parameter follows: pixelsAcquireOnePixel() returns a pixel at the specified (x,y) location. imagethe image. x,yThese values define the location of the pixel to return. exceptionReturn any errors or warnings in this structure. AcquireOneVirtualPixel() returns a single pixel at the specified (x,y) location as defined by specified pixel method. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOnePixel() instead. The format of the AcquireOneVirtualPixel() method is: PixelPacket AcquireOneVirtualPixel(const Image image, const VirtualPixelMethod virtual_pixel_method,const long x, const long y,ExceptionInfo exception) A description of each parameter follows: pixelsAcquireOneVirtualPixel() returns a pixel at the specified (x,y) location. virtual_pixel_methodthe virtual pixel method. imagethe image. x,yThese values define the location of the pixel to return. exceptionReturn any errors or warnings in this structure. DestroyCacheInfo() deallocates memory associated with the pixel cache. The format of the DestroyCacheInfo() method is: Cache DestroyCacheInfo(Cache cache) A description of each parameter follows: cachethe pixel cache. DestroyImagePixels() deallocates memory associated with the pixel cache. The format of the DestroyImagePixels() method is: void DestroyImagePixels(Image *image) A description of each parameter follows: imagethe image. GetCacheVirtualPixelMethod() gets the "virtual pixels" method for the pixel cache. A virtual pixel is any pixel access that is outside the boundaries of the image cache. The format of the GetCacheVirtualPixelMethod() method is: VirtualPixelMethod GetCacheVirtualPixelMethod(const Image *image) A description of each parameter follows: imagethe image. GetImagePixels() obtains a pixel region for read/write access. If the region is successfully accessed, a pointer to a PixelPacket array representing the region is returned, otherwise NULL is returned. The returned pointer may point to a temporary working copy of the pixels or it may point to the original pixels in memory. Performance is maximized if the selected region is part of one row, or one or more full rows, since then there is opportunity to access the pixels in-place (without a copy) if the image is in RAM, or in a memory-mapped file. The returned pointer should *never* be deallocated by the user. Pixels accessed via the returned pointer represent a simple array of type PixelPacket. If the image type is CMYK or if the storage class is PseduoClass, call GetIndexes() after invoking GetImagePixels() to obtain the black color component or colormap indexes (of type IndexPacket) corresponding to the region. Once the PixelPacket (and/or IndexPacket) array has been updated, the changes must be saved back to the underlying image using SyncImagePixels() or they may be lost. The format of the GetImagePixels() method is: PixelPacket *GetImagePixels(Image *image,const long x,const long y, const unsigned long columns,const unsigned long rows) A description of each parameter follows: imagethe image. x,y,columns,rowsThese values define the perimeter of a region of pixels. GetIndexes() returns the black channel or the colormap indexes associated with the last call to SetImagePixels() or AcquireImagePixels(). NULL is returned if the black channel or colormap indexes are not available. The format of the GetIndexes() method is: IndexPacket *GetIndexes(const Image *image) A description of each parameter follows: indexesGetIndexes() returns the indexes associated with the last call to SetImagePixels() or GetImagePixels(). imagethe image. GetOnePixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs. The format of the GetOnePixel() method is: PixelPacket GetOnePixel(const Image image,const long x,const long y) A description of each parameter follows: imagethe image. x,yThese values define the location of the pixel to return. GetPixels() returns the pixels associated with the last call to SetImagePixels() or GetImagePixels(). The format of the GetPixels() method is: PixelPacket *GetPixels(const Image image) A description of each parameter follows: pixelsGetPixels() returns the pixels associated with the last call to SetImagePixels() or GetImagePixels(). imagethe image. ReferenceCache() increments the reference count associated with the pixel cache returning a pointer to the cache. The format of the ReferenceCache method is: Cache ReferenceCache(Cache cache_info) A description of each parameter follows: cache_infothe pixel cache. SetCacheVirtualPixelMethod() sets the "virtual pixels" method for the pixel cache and returns the previous setting. A virtual pixel is any pixel access that is outside the boundaries of the image cache. The format of the SetCacheVirtualPixelMethod() method is: VirtualPixelMethod SetCacheVirtualPixelMethod(const Image *image, const VirtualPixelMethod virtual_pixel_method) A description of each parameter follows: imagethe image. virtual_pixel_methodchoose the type of virtual pixel. SetImagePixels() initializes a pixel region for write-only access. If the region is successfully intialized a pointer to a PixelPacket array representing the region is returned, otherwise NULL is returned. The returned pointer may point to a temporary working buffer for the pixels or it may point to the final location of the pixels in memory. Write-only access means that any existing pixel values corresponding to the region are ignored. This is useful while the initial image is being created from scratch, or if the existing pixel values are to be completely replaced without need to refer to their pre-existing values. The application is free to read and write the pixel buffer returned by SetImagePixels() any way it pleases. SetImagePixels() does not initialize the pixel array values. Initializing pixel array values is the application's responsibility. Performance is maximized if the selected region is part of one row, or one or more full rows, since then there is opportunity to access the pixels in-place (without a copy) if the image is in RAM, or in a memory-mapped file. The returned pointer should *never* be deallocated by the user. Pixels accessed via the returned pointer represent a simple array of type PixelPacket. If the image type is CMYK or the storage class is PseudoClass, call GetIndexes() after invoking GetImagePixels() to obtain the black color component or the colormap indexes (of type IndexPacket) corresponding to the region. Once the PixelPacket (and/or IndexPacket) array has been updated, the changes must be saved back to the underlying image using SyncImagePixels() or they may be lost. The format of the SetImagePixels() method is: PixelPacket *SetImagePixels(Image *image,const long x,const long y, const unsigned long columns,const unsigned long rows) A description of each parameter follows: pixelsSetImagePixels returns a pointer to the pixels if they are transferred, otherwise a NULL is returned. imagethe image. x,y,columns,rowsThese values define the perimeter of a region of pixels. SyncImagePixels() saves the image pixels to the in-memory or disk cache. The method returns MagickTrue if the pixel region is synced, otherwise MagickFalse. The format of the SyncImagePixels() method is: MagickBooleanType SyncImagePixels(Image *image) A description of each parameter follows: imagethe image. |