NAME

blob -


SYNOPSIS

image=BlobToImage(blob,length)

CloseBlob(image)

status=EOFBlob(image)

status=FlushBlob(image)

GetBlobInfo(blob_info)

status=GetStringBlob(image,string)

blob=ImageToBlob(image_info,image,length)

status=OpenBlob(image_info,image,type)

count=ReadBlob(image,number_bytes,data);

status=SeekBlob(image,offset,whence)

status=SetBlobQuantum(blob_info,quantum)

status=TellBlob(image)

count=WriteBlob(image,size,number_items,data)


FUNCTION DESCRIPTIONS


BlobToImage

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

The format of the BlobToImage routine is:

        image=BlobToImage(blob,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 routine is:

        CloseBlob(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 routine is:

        status=EOFBlob(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 routine is:

        status=FlushBlob(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 routine is:

        GetBlobInfo(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 routine is:

        status=GetStringBlob(image,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 routine is:

        blob=ImageToBlob(image_info,image,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.


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 routine is:

        status=OpenBlob(image_info,image,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 routine is:

        count=ReadBlob(image,number_bytes,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.


SeekBlob

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

The format of the SeekBlob routine is:

        status=SeekBlob(image,offset,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.


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 routine is:

        status=SetBlobQuantum(blob_info,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 routine is:

        status=TellBlob(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 routine is:

        count=WriteBlob(image,size,number_items,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.