Functions > PegasusQuery |
The PegasusQuery function examines an image to determine image properties such as image size, dimensions, and format.
Copy Code | |
---|---|
BOOL PegasusQuery(PIC_PARM PICFAR* PicParm) |
Name | Description |
PicParm |
Specifies the image properties to be returned and specifies the input buffer containing at least the image header. The requested properties are also returned in PicParm. For additional information, see the description of the PIC_PARM structure in the General Structures section. Also see the description of the PEGQUERY structure in the Operation Structures section. |
The return value is TRUE if the function successfully determines the requested image properties. The image properties are returned in PicParm.
If FALSE is returned, first examine the PicParm‑>Status value. If Status is non-zero, it holds the error code. If Status is 0, then some of the requested image properties could not be returned. Examine the u.QRY.BitFlagsAck field to determine which image properties were returned.
Before calling PegasusQuery, the application zeros PicParm and initializes its ParmSize, ParmVer, and ParmVerMinor fields. If an image comment is desired, then the Comment and CommentSize fields are initialized to a buffer for the comment. The application allocates a buffer and initializes the Get queue fields. At least the image header must have been loaded into the buffer. PegasusQuery will treat this buffer as the start of the image file and will parse information from the image header and the image data if possible. The application must also have set one or more flags in u.QRY.BitFlagsReq indicating which image properties should be returned.
PegasusQuery returns TRUE or FALSE to indicate whether it could return all of the requested image properties. The bit flags in u.QRY.BitFlagsAck are set to indicate which image properties were returned. Information about the image is returned in the Head, ColorTable, Comment, CommentLen, and u.QRY areas. PegasusQuery may return image properties which were not requested by the BitFlagsReq field.
PegasusQuery cannot be called using PIC_PARM data which is currently in use by another Pegasus function (i.e., if PicParm‑>Reserved is not 0).
Note that PegasusQuery alters the contents of the PIC_PARM structure. Some care should therefore be taken when using a PegasusQuery PIC_PARM in a subsequent call to Pegasus. Specifically, since PegasusQuery changes the QRY data in the PIC_PARM operation-specific union, and since the Pegasus operation will use a different operation structure for accessing that same union, you will ordinarily zero QRY after retrieving the important image properties and before initializing the Pegasus operation structure.