GraphicsMagick

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

# import

## Import image pixels from common representations

Contents

- ImportImagePixelArea
- ImportViewPixelArea
- ImportPixelAreaOptionsInit

# ImportImagePixelArea

## Synopsis

    MagickPassFail ImportImagePixelArea( Image *image, const QuantumType quantum_type,
                                         const unsigned int quantum_size,
                                         const unsigned char *source,
                                         const ImportPixelAreaOptions *options,
                                         ImportPixelAreaInfo *import_info );

## Description

ImportImagePixelArea() transfers one or more pixel components from a user supplied buffer into the default image pixel cache view. By default, values are read in network (big-endian) byte/bit order. By setting the 'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values may be output as little (LSBEndian), big (MSBEndian), or host native (NativeEndian) endian values. This function is quite powerful in that besides common native CPU type sizes, it can support any integer bit depth from 1 to 32 (e.g. 13), 64-bits, as well as 32 and 64-bit float.

MagickPass is returned if the pixels are successfully transferred, otherwise MagickFail.

The format of the ImportImagePixelArea method is:

    MagickPassFail ImportImagePixelArea( Image *image, const QuantumType quantum_type,
                                         const unsigned int quantum_size,
                                         const unsigned char *source,
                                         const ImportPixelAreaOptions *options,
                                         ImportPixelAreaInfo *import_info );

status:
  Method PushImagePixels returns MagickPass if the pixels are successfully transferred, otherwise MagickFail.
image:
  The image.
quantum_type:
  Declare which pixel components to transfer (AlphaQuantum, BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, IndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum, RedQuantum, YellowQuantum)
quantum_size:
  Bits per quantum sample (range 1-32, and 64).
source:
  The pixel components are transferred from this buffer.
options:
  Additional options specific to quantum_type (may be NULL).
import_info :
  Populated with information regarding the pixels imported (may be NULL)

# ImportViewPixelArea

## Synopsis

    MagickPassFail ImportViewPixelArea( ViewInfo *view, const QuantumType quantum_type,
                                        const unsigned int quantum_size,
                                        const unsigned char *source,
                                        const ImportPixelAreaOptions *options,
                                        ImportPixelAreaInfo *import_info );

## Description

ImportViewPixelArea() transfers one or more pixel components from a user supplied buffer into the specified image pixel cache view of an image. By default, values are read in network (big-endian) byte/bit order. By setting the 'endian' member of ExportPixelAreaOptions, 16, 32 and 64-bit values may be output as little (LSBEndian), big (MSBEndian), or host native (NativeEndian) endian values. This function is quite powerful in that besides common native CPU type sizes, it can support any integer bit depth from 1 to 32 (e.g. 13), 64-bits, as well as 32 and 64-bit float.

MagickPass is returned if the pixels are successfully transferred, otherwise MagickFail.

The format of the ImportViewPixelArea method is:

    MagickPassFail ImportViewPixelArea( ViewInfo *view, const QuantumType quantum_type,
                                        const unsigned int quantum_size,
                                        const unsigned char *source,
                                        const ImportPixelAreaOptions *options,
                                        ImportPixelAreaInfo *import_info );

status:
  Method PushImagePixels returns MagickPass if the pixels are successfully transferred, otherwise MagickFail.
view:
  The pixel view to import pixels into.
quantum_type:
  Declare which pixel components to transfer (AlphaQuantum, BlackQuantum, BlueQuantum, CMYKAQuantum, CMYKQuantum, CyanQuantum, GrayAlphaQuantum, GrayQuantum, GreenQuantum, IndexAlphaQuantum, IndexQuantum, MagentaQuantum, RGBAQuantum, RGBQuantum, RedQuantum, YellowQuantum)
quantum_size:
  Bits per quantum sample (range 1-32, and 64).
source:
  The pixel components are transferred from this buffer.
options:
  Additional options specific to quantum_type (may be NULL).
import_info :
  Populated with information regarding the pixels imported (may be NULL)

# ImportPixelAreaOptionsInit

## Synopsis

    void ImportPixelAreaOptionsInit( ImportPixelAreaOptions *options );

## Description

ImportPixelAreaOptionsInit() initializes the options structure which is optionally passed to ImportPixelArea()

The format of the ImportPixelAreaOptionsInit method is:

    void ImportPixelAreaOptionsInit( ImportPixelAreaOptions *options );

A description of each parameter follows:

options:
  Options structure to initialize.