Graphics Importers

QPix accomplishes most of its functionality with the help of QuickTime's graphics import components, aka "graphics importers".

High-level QPix commands dealing with image files and plug-in areas use graphics importers internally, but hide potentially confusing details. However, in order to provide the most of QuickTime's capabilities and flexibility, QPix also includes a set of low-level commands for directly working with graphics importers.

Graphics importers are code modules. Each importer "knows" all the details of a specific graphic file format and provides specific services to the client software. Graphics importers have the following properties:

Type (String4) (In pure IM terms, this is the component subtype field)

Flags (Longint)

Name (String255)

The files supported by a graphics importer are specified by the importer's type in conjunction with bit #12 of the flags property. If bit #12 is off, the importer's type is the Mac file type of the supported files. If bit #12 is on, it is a filename extension.

Examples

This is the Photoshop importer. It supports files of type '8BPS' (0x40000000 bit #12 is false).

This importer knows how to handle GIF files. It supports files with the .GIF filename extension (0x40001200 bit #12 is true).

Notes

1. Some terms and concepts are paraphrased in this chapter in an attempt to better match 4D's terminology and way of doing things. For reference material, check QuickTime Developer's Documentation.

2. When working with graphics importers, you will need to create an importer instance, work with it, and destroy it when no longer needed.

Commands

QPx_NewImporterForFile Create a graphics importer instance for the image stored in a file
QPx_NewImporterForData Create a graphics importer instance for the image data stored in a BLOB
QPx_NewImporterForURL Create a graphics importer from a URL
QPx_NewImporterForPict Create a graphics importer instance for the image data in a picture variable
QPx_NewImporter Create a graphics importer instance without image data
QPx_FreeImporter Destroy an existing importer instance
QPx_SetImporterFile Assign an image file to a graphics importer
QPx_GetImporterFile Get the path of the file associated with a graphics importer
QPx_SetImporterData Assign image data from a BLOB to a graphics importer
QPx_GetImporterData Get the image data associated with a graphics importer
QPx_SetImporterOffsetAndLimit Specify start and end of data within the image source
QPx_GetImporterOffsetAndLimit Get the start and end of data within the image source container
QPx_ValidateImporter Ask importer to test its image data
QPx_GetImporterImageSize Get the dimensions of the image associated with an importer
QPx_GetImporterImageRes Get the resolution of the image associated with an importer
QPx_GetImporterImageDepth Get the pixel depth of the image associated with an importer
QPx_GetImporterInfo Get information about an importer
QPx_GetImporterColorSpace Get the color space of the image associated with an importer
QPx_GetImporterColorProfile Get the color profile of the image associated with an importer
QPx_GetImporterEmbeddedThumb Get the embedded thumbnail from an image
QPx_CreateImporterThumbnail Create high-quality thumbnail from image data associated with an importer
QPx_ReadImporterImageInPict Read the image associated with an importer into a 4D picture variable
QPx_ExportImporterImage Export the image associated with an importer to file in a specified format
QPx_ExportImporterImageToBLOB Export the image associated with an importer to a BLOB in a specified format
QPx_GetImporterTagContainer Extract the tag container from the image associated with an importer
QPx_CountImporterFrames Get the number of frames of a multi-frame image
QPx_SetImporterFrameIndex Set the current frame in a multi-frame image
QPx_GetImporterFrameIndex Get the current frame of a multi-image image
QPx_GetImporterFrameType Get the type of a frame in a multi-frame image