GraphicsMagick

- Home
- Project
- Download
- Install
- Source
- News
- Utilities
- Programming
- Reference

# deprecate

## Methods which should no longer be used

Contents

- AcquireCacheView
- AcquireMemory
- CloneMemory
- GetCacheView
- LiberateMemory
- PopImagePixels
- PushImagePixels
- ReacquireMemory
- SetCacheView
- SyncCacheView

# AcquireCacheView

## Synopsis

    const PixelPacket *AcquireCacheView( const ViewInfo *view, const long x, const long y,
                                         const unsigned long columns, const unsigned long rows,
                                         ExceptionInfo *exception );

## Description

Method AcquireCacheView gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters for read-only access. A pointer to the pixels is returned if the pixels are transferred, otherwise NULL is returned.

The format of the AcquireCacheView method is:

    const PixelPacket *AcquireCacheView( const ViewInfo *view, const long x, const long y,
                                         const unsigned long columns, const unsigned long rows,
                                         ExceptionInfo *exception );

pixels:
  Method AcquireCacheView returns a null pointer if an error occurs, otherwise a pointer to the view pixels.
view:
  The address of a structure of type ViewInfo.
x,y,columns,rows:
  These values define the perimeter of a region of pixels.
exception:
  Return any errors or warnings in this structure.

# AcquireMemory

## Synopsis

    void *AcquireMemory( const size_t size );

## Description

AcquireMemory() returns a pointer to a block of memory of at least size bytes suitably aligned for any use. NULL is returned if insufficient memory is available or the requested size is zero.

The format of the AcquireMemory method is:

    void *AcquireMemory( const size_t size );

A description of each parameter follows:

size:
  The size of the memory in bytes to allocate.

# CloneMemory

## Synopsis

    void *CloneMemory( void *destination, const void *source, const size_t size );

## Description

CloneMemory() copies size bytes from memory area source to the destination. Copying between objects that overlap will take place correctly. It returns destination.

The format of the CloneMemory method is:

    void *CloneMemory( void *destination, const void *source, const size_t size );

A description of each parameter follows:

size:
  The size of the memory in bytes to allocate.

# GetCacheView

## Synopsis

    PixelPacket *GetCacheView( ViewInfo *view, const long x, const long y,
                               const unsigned long columns, const unsigned long rows );

## Description

GetCacheView() gets writeable pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

The format of the GetCacheView method is:

    PixelPacket *GetCacheView( ViewInfo *view, const long x, const long y,
                               const unsigned long columns, const unsigned long rows );

pixels:
  Method GetCacheView returns a null pointer if an error occurs, otherwise a pointer to the view pixels.
view:
  The address of a structure of type ViewInfo.
x,y,columns,rows:
  These values define the perimeter of a region of pixels.

# LiberateMemory

## Synopsis

    void LiberateMemory( void ** memory );

## Description

LiberateMemory() frees memory that has already been allocated, and NULLs the pointer to it.

The format of the LiberateMemory method is:

    void LiberateMemory( void ** memory );

A description of each parameter follows:

memory:
  A pointer to a block of memory to free for reuse.

# PopImagePixels

## Synopsis

    unsigned int PopImagePixels( const Image *, const QuantumType quantum,
                                 unsigned char *destination );

## Description

PopImagePixels() transfers one or more pixel components from the image pixel cache to a user supplied buffer. True is returned if the pixels are successfully transferred, otherwise False.

The format of the PopImagePixels method is:

    unsigned int PopImagePixels( const Image *, const QuantumType quantum,
                                 unsigned char *destination );

status:
  Method PopImagePixels returns True if the pixels are successfully transferred, otherwise False.
image:
  The image.
quantum:
  Declare which pixel components to transfer (RGB, RGBA, etc).
destination:
  The components are transferred to this buffer.

# PushImagePixels

## Synopsis

    unsigned int PushImagePixels( Image *image, const QuantumType quantum_type,
                                  const unsigned char *source );

## Description

PushImagePixels() transfers one or more pixel components from a user supplied buffer into the image pixel cache of an image. It returns True if the pixels are successfully transferred, otherwise False.

The format of the PushImagePixels method is:

    unsigned int PushImagePixels( Image *image, const QuantumType quantum_type,
                                  const unsigned char *source );

status:
  Method PushImagePixels returns True if the pixels are successfully transferred, otherwise False.
image:
  The image.
quantum_type:
  Declare which pixel components to transfer (red, green, blue, opacity, RGB, or RGBA).
source:
  The pixel components are transferred from this buffer.

# ReacquireMemory

## Synopsis

    void ReacquireMemory( void ** memory, const size_t size );

## Description

ReacquireMemory() 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 ReacquireMemory method is:

    void ReacquireMemory( void ** memory, const size_t size );

A description of each parameter follows:

memory:
  A pointer to a memory allocation. On return the pointer may change but the contents of the original allocation will not.
size:
  The new size of the allocated memory.

# SetCacheView

## Synopsis

    PixelPacket *SetCacheView( ViewInfo *view, const long x, const long y,
                               const unsigned long columns, const unsigned long rows );

## Description

SetCacheView() gets pixels from the in-memory or disk pixel cache as defined by the geometry parameters. A pointer to the pixels is returned if the pixels are transferred, otherwise a NULL is returned.

The format of the SetCacheView method is:

    PixelPacket *SetCacheView( ViewInfo *view, const long x, const long y,
                               const unsigned long columns, const unsigned long rows );

view:
  The address of a structure of type ViewInfo.
x,y,columns,rows:
  These values define the perimeter of a region of pixels.

# SyncCacheView

## Synopsis

    MagickPassFail SyncCacheView( ViewInfo *view );

## Description

SyncCacheView() saves the view pixels to the in-memory or disk cache. The method returns MagickPass if the pixel region is synced, otherwise MagickFail.

The format of the SyncCacheView method is:

    MagickPassFail SyncCacheView( ViewInfo *view );

A description of each parameter follows:

view:
  The address of a structure of type ViewInfo.