NAME

blob -


SYNOPSIS

Image * BlobToImage( const ImageInfo *image_info, const char *blob, const unsigned long length );

void CloseBlob( Image *image );

int EOFBlob( const Image *image );

int FlushBlob( const Image *image );

void GetBlobInfo( BlobInfo *blob_info );

char * GetStringBlob( Image *image, char *string );

char * ImageToBlob( const ImageInfo *image_info, Image *image, unsigned long *length );

unsigned long LSBFirstReadLong( Image *image );

unsigned short LSBFirstReadShort( Image *image );

unsigned long LSBFirstWriteLong( Image *image, const unsigned long value );

unsigned long LSBFirstWriteShort( Image *image, const unsigned short value );

void MSBFirstOrderLong( register char *p, const unsigned int length );

void MSBFirstOrderShort( register char *p, const unsigned int length );

unsigned long MSBFirstReadLong( Image *image );

unsigned short MSBFirstReadShort( Image *image );

unsigned long MSBFirstWriteLong( Image *image, const unsigned long value );

unsigned long MSBFirstWriteShort( Image *image, const unsigned short value );

unsigned int OpenBlob( const ImageInfo *image_info, Image *image, const char *type );

unsigned long ReadBlob( Image *image, const unsigned long number_bytes, char *data );

int ReadByte( Image *image );

int SeekBlob( Image *image, const long offset, const int whence );

void SetBlobQuantum( BlobInfo *blob_info, const unsigned long quantum );

int TellBlob( const Image *image );

unsigned long WriteBlob( Image *image, const unsigned long number_bytes, const char *data );

unsigned long WriteByte( Image *image, const char value );


FUNCTION DESCRIPTIONS


BlobToImage

Method BlobToImage implements direct to memory image formats. It returns the blob as an image.

The format of the BlobToImage method is:

Image *BlobToImage ( const ImageInfo *image_info, const char *blob, const unsigned long length );

A description of each parameter follows:

image:

Method BlobToImage returns an image from the supplied blob. If an error occurs NULL is returned.

image_info:

Specifies a pointer to an ImageInfo structure.

blob:

The address of a character stream in one of the image formats understood by ImageMagick.

length:

This unsigned integer reflects the length in bytes of the blob.


CloseBlob

Method CloseBlob closes a file associated with the image. If the filename prefix is '|', the file is a pipe and is closed with PipeClose.

The format of the CloseBlob method is:

void CloseBlob ( Image *image );

A description of each parameter follows:

image:

The address of a structure of type Image.


EOFBlob

Method EOFBlob returns a non-zero value when EOF has been detected reading from a blob or file.

The format of the EOFBlob method is:

int EOFBlob ( const Image *image );

A description of each parameter follows:

status:

Method EOFBlob returns 0 on success; otherwise, it returns -1 and set errno to indicate the error.

image:

The address of a structure of type Image.


FlushBlob

Method FlushBlob flushes the datastream if it is a file.

The format of the FlushBlob method is:

int FlushBlob ( const Image *image );

A description of each parameter follows:

status:

Method FlushBlob returns 0 on success; otherwise, it returns -1 and set errno to indicate the error.

image:

The address of a structure of type Image.


GetBlobInfo

Method GetBlobInfo initializes the BlobInfo structure.

The format of the GetBlobInfo method is:

void GetBlobInfo ( BlobInfo *blob_info );

A description of each parameter follows:

blob_info:

Specifies a pointer to a BlobInfo structure.


GetStringBlob

Method GetStringBlob reads characters from a blob or file until a newline character is read or an end-of-file condition is encountered. from a blob or file.

The format of the GetStringBlob method is:

char *GetStringBlob ( Image *image, char *string );

A description of each parameter follows:

status:

Method GetStringBlob returns the string on success, otherwise, a null is returned.

image:

The address of a structure of type Image.

string:

The address of a character buffer.


ImageToBlob

Method ImageToBlob implements direct to memory image formats. It returns the image as a blob and its length.

The format of the ImageToBlob method is:

char *ImageToBlob ( const ImageInfo *image_info, Image *image, unsigned long *length );

A description of each parameter follows:

blob:

Method ImageToBlob returns a chunk of memory written in the desired image format (e.g. JPEG, GIF, etc.). If an error occurs NULL is returned.

image_info:

Specifies a pointer to an ImageInfo structure.

image:

The address of a structure of type Image.

length:

This pointer to an unsigned int sets the initial length of the blob. On return, it reflects the actual length of the blob.


LSBFirstReadLong

Method LSBFirstReadLong reads a long value as a 32 bit quantity in least-significant byte first order.

The format of the LSBFirstReadLong method is:

unsigned long LSBFirstReadLong ( Image *image );

A description of each parameter follows.

value:

Method LSBFirstReadLong returns an unsigned long read from the file.

image:

The address of a structure of type Image.


LSBFirstReadShort

Method LSBFirstReadShort reads a short value as a 16 bit quantity in least-significant byte first order.

The format of the LSBFirstReadShort method is:

unsigned short LSBFirstReadShort ( Image *image );

A description of each parameter follows.

value:

Method LSBFirstReadShort returns an unsigned short read from the file.

image:

The address of a structure of type Image.


LSBFirstWriteLong

Method LSBFirstWriteLong writes a long value as a 32 bit quantity in least-significant byte first order.

The format of the LSBFirstWriteLong method is:

unsigned long LSBFirstWriteLong ( Image *image, const unsigned long value );

A description of each parameter follows.

count:

Method LSBFirstWriteLong returns the number of unsigned longs written.

image:

The address of a structure of type Image.

value:

Specifies the value to write.


LSBFirstWriteShort

Method LSBFirstWriteShort writes a long value as a 16 bit quantity in least-significant byte first order.

The format of the LSBFirstWriteShort method is:

unsigned long LSBFirstWriteShort ( Image *image, const unsigned short value );

A description of each parameter follows.

count:

Method LSBFirstWriteShort returns the number of unsigned longs written.

image:

The address of a structure of type Image.

value:

Specifies the value to write.


MSBFirstOrderLong

Method MSBFirstOrderLong converts a least-significant byte first buffer of integers to most-significant byte first.

The format of the MSBFirstOrderLong method is:

void MSBFirstOrderLong ( register char *p, const unsigned int length );

A description of each parameter follows.

p:

Specifies a pointer to a buffer of integers.

length:

Specifies the length of the buffer.


MSBFirstOrderShort

Method MSBFirstOrderShort converts a least-significant byte first buffer of integers to most-significant byte first.

The format of the MSBFirstOrderShort method is:

void MSBFirstOrderShort ( register char *p, const unsigned int length );

A description of each parameter follows.

p:

Specifies a pointer to a buffer of integers.

length:

Specifies the length of the buffer.


MSBFirstReadShort

Method MSBFirstReadShort reads a short value as a 16 bit quantity in most-significant byte first order.

The format of the MSBFirstReadShort method is:

unsigned short MSBFirstReadShort ( Image *image );

A description of each parameter follows.

value:

Method MSBFirstReadShort returns an unsigned short read from the file.

image:

The address of a structure of type Image.


MSBFirstReadLong

Method MSBFirstReadLong reads a long value as a 32 bit quantity in most-significant byte first order.

The format of the MSBFirstReadLong method is:

unsigned long MSBFirstReadLong ( Image *image );

A description of each parameter follows.

value:

Method MSBFirstReadLong returns an unsigned long read from the file.

image:

The address of a structure of type Image.


MSBFirstWriteLong

Method MSBFirstWriteLong writes a long value as a 32 bit quantity in most-significant byte first order.

The format of the MSBFirstWriteLong method is:

unsigned long MSBFirstWriteLong ( Image *image, const unsigned long value );

A description of each parameter follows.

count:

Method MSBFirstWriteLong returns the number of unsigned longs written.

value:

Specifies the value to write.

image:

The address of a structure of type Image.


MSBFirstWriteShort

Method MSBFirstWriteShort writes a long value as a 16 bit quantity in most-significant byte first order.

The format of the MSBFirstWriteShort method is:

unsigned long MSBFirstWriteShort ( Image *image, const unsigned short value );

A description of each parameter follows.

value:

Specifies the value to write.

file:

Specifies the file to write the data to.


OpenBlob

Method OpenBlob open a file associated with the image. A file name of '-' sets the file to stdin for type 'r' and stdout for type 'w'. If the filename suffix is '.gz' or '.Z', the image is decompressed for type 'r' and compressed for type 'w'. If the filename prefix is '|', it is piped to or from a system command.

The format of the OpenBlob method is:

unsigned int OpenBlob ( const ImageInfo *image_info, Image *image, const char *type );

A description of each parameter follows:

status:

Method OpenBlob returns True if the file is successfully opened otherwise False.

image_info:

Specifies a pointer to an ImageInfo structure.

image:

The address of a structure of type Image.

type:

'r' for reading; 'w' for writing.


ReadBlob

Method ReadBlob reads data from the blob or image file and returns it. It returns the number of bytes read.

The format of the ReadBlob method is:

unsigned long ReadBlob ( Image *image, const unsigned long number_bytes, char *data );

A description of each parameter follows:

count:

Method ReadBlob returns the number of items read.

image:

The address of a structure of type Image.

number_bytes:

Specifies an integer representing the number of bytes to read from the file.

data:

Specifies an area to place the information requested from the file.


ReadByte

Method ReadByte reads a single byte from the image file and returns it.

The format of the ReadByte method is:

int ReadByte ( Image *image );

A description of each parameter follows.

value:

Method ReadByte returns an integer read from the file.

image:

The address of a structure of type Image.


ReadDataBlock

Method ReadBlobBlock reads data from the image file and returns it. The amount of data is determined by first reading a count byte. The number or bytes read is returned.

The format of the ReadBlobBlock method is:

    unsigned long ReadBlobBlock(Image *image,char *data)

A description of each parameter follows:

count:

Method ReadBlobBlock returns the number of bytes read.

image:

The address of a structure of type Image.

data:

Specifies an area to place the information requested from the file.


SeekBlob

Method SeekBlob sets the offset in bytes from the beginning of a blob or file.

The format of the SeekBlob method is:

int SeekBlob ( Image *image, const long offset, const int whence );

A description of each parameter follows:

status:

Method SeekBlob returns 0 on success; otherwise, it returned -1 and set errno to indicate the error.

image:

The address of a structure of type Image.

offset:

Specifies an integer representing the offset in bytes.

whence:

Specifies an integer representing how the offset is treated relative to the beginning of the blob as follows:

      SEEK_SET  Set position equal to offset bytes.
      SEEK_CUR  Set position to current location plus offset.
      SEEK_END  Set position to EOF plus offset.
=head2 SetBlobQuantum

Method SetBlobQuantum set the current value of the blob quantum. This is the size in bytes to add to a blob when writing to a blob exceeds its current length.

The format of the SetBlobQuantum method is:

void SetBlobQuantum ( BlobInfo *blob_info, const unsigned long quantum );

A description of each parameter follows:

blob_info:

A pointer to a BlobInfo structure.

quantum:

An unsigned long that reflects the number of bytes to increase a blob.


TellBlob

Method TellBlob obtains the current value of the blob or file position.

The format of the TellBlob method is:

int TellBlob ( const Image *image );

A description of each parameter follows:

status:

Method TellBlob returns 0 on success; otherwise, it returned -1 and set errno to indicate the error.

image:

The address of a structure of type Image.


WriteBlob

Method WriteBlob writes data to a blob or image file. It returns the number of items written.

The format of the WriteBlob method is:

unsigned long WriteBlob ( Image *image, const unsigned long number_bytes, const char *data );

A description of each parameter follows:

status:

Method WriteBlob returns True if all the data requested is obtained without error, otherwise False.

image:

The address of a structure of type Image.

size:

Specifies an integer representing the length of an individual item to be written to the file.

number_items:

Specifies an integer representing the number of items to write to the file.

data:

The address of the data to write to the blob or file.


WriteByte

Method WriteByte write an integer to a file. It returns the number of bytes written (either 0 or 1);

The format of the WriteByte method is:

unsigned long WriteByte ( Image *image, const char value );

A description of each parameter follows.

count:

Method WriteByte returns the number of bytes written.

image:

The address of a structure of type Image.

value:

Specifies the value to write.