CIImageAccess

The image access interface gives you the infromation that you need about an image in a publication.


CIImageAccess methods

PMXErr Setup( PMOBJ_REC* pObjRec, unsigned long options );

Prepares an object for CIImageAccess operations. You must call this method before using any of the other methods within the CIImageAccess interface.

void Finished();

Closes the object. Any CIImageAccess operations on the object must be done before this method is called.

PMXErr GetImageAttr( PMImageObjAttr* pImObjAttr );

Gets the attributes for the object that was selected with the Setup function. The format of the PMImageObjAttr structure can be found in the header file.

PMXErr SetImageRowDataOptions( unsigned long options );

Sets the image data options, according to the following table, the values may be combined using the bit-wise OR operator.



Data Options Description
kImageAttributeOnly Setup image for attributes access only, i.e. will not try to acces image pixel data. Use this option whenever image pixel data access will not be needed. This will speed up setup process.
If this is set then all option flags related to actual image data format will be ignored.
kKeepImageBitdepth

The pixel data returned will be in its original bitdepth. The default is to expand data to 8-bit samples. When data are expanded to 8-bit samples:

  • Contone data will be interpolated so that 0 is mapped to 0 and 15 is mapped to 255 for 4-bit data.
  • Indexed data kept their original values but data are returned as 8-bit samples.
kNoAlphaSamples
Pixels with alpha samples will be munged. At this point, only the first associated alpha sample is supported. Unassociated data and undefined extra samples are dropped when kNoAlphaSamples is set.
kMonoAsBlackZero All contone monochrome data are returned as Black Zero, i.e. 0 means black and (1<<x - 1) is white, where x is the original bitdepth.
kBWAsGray
1-bit B&W data is returned as gray data. That is 0 is mapped to 0 and 1 is mapped to 255.

PMXErr GetImageBitDepth( short *pBPS, short *pSPP );

Retrieves the bits per sample (pBPS) and samples per pixel (pSPP) for the image.

PMXErr GetImageRowData( unsigned long startCol, unsigned long startRow, unsigned long nCols, unsigned long nRows, char *pBuffer, unsigned long rowOffset );

Retrieves the specified image data, and fills the buffer (pointed to by pBuffer).
startCol The pixel column to start from. (Both rows and columns are zero based - the first column is 0.)
startRow The pixel row to start from.
nCols The number of pixel columns to read.
nRows The number of pixel rows to read.
pBuffer The buffer to copy the pixel data into.
rowOffset The number of bytes that each row will be offset from the previous. You can get this value from the number of pixels per row multiplied by the number of bytes per pixel.

PMXErr GetImageRowDataByPlane( short whichPlane, unsigned long startCol, unsigned long startRow, unsigned long nCols, unsigned long nRows, char *pBuffer, unsigned long rowOffset );

Retrieves the specified image data for a specific color plane. The argument list is the same as GetImageRowData above, with the addition of the whichPlane argument at the front of the list. whichPlane specifies which color plane the pixel data will represent (for an RGB image, use 0 to retrieve the Red plane, 1 to retrieve Green, and 2 to retrieve Blue.)

	

PMXErr GetImageFirstAlphaSamples( unsigned long startCol, unsigned long startRow, unsigned long nCols, unsigned long nRows, char *pBuffer, unsigned long rowOffset );

This method is used to get the alpha samples associated with the image (Unassociated alpha samples will not be returned.) The arguments in this method are used in the same way as those in the GetImageRowData method are used.

PMXErr GetImageColorMap( long *pSize, char *pColorMap );

Get the color map from the image. This method is really a dual purpose method, if you call the method with a 0 for the buffer size and a null pointer for the buffer, the method will return the size (in bytes) of the color map. The size value can then be used to allocate the buffer, and a second call would use the new size value and the new buffer. If the value in pSize is large enough for the color map, then the PageMaker application will fill the buffer with the color map. Full color images do not have a color map, and will return 0 for the size of the color map.

PMXErr GetImageProfile( long *pSize, char *pProfile );

Gets the ICC profile information. Like the GetImageColorMap method this method will give the size of the profile information if you call the mehtod with pSize value of 0 and a null pointer for the buffer pProfile. If the image does not have an ICC profile then the method will return a 0 for the buffer size. The information returned in the buffer is the profile information from within the ICC profile.

PMXErr GetImageIntrinsicInkAttr( long *pCount, char *pInkNames );

Gets the ink information from a hifi image. If the image is not a hifi image, the number of inks, pCount, will be returned a zero. pCount will return the number of inks, and pInkNames will return an array of ink names (as C strings.) The ink names in the array are in the same order as the color planes within the image ( so if you wanted to use the GetImageRowDataByPlane method to get the pixel information for the first ink listed in the array, you would use 0 for the value in the whichPlane argument.)

PMXErr SetImageMediaAndPluginTypes( char *mediaType, char *pluginType );

Set the media type and plug-in type for the image. The mediaType defines the type of media the image represents (ex: 'moov' for QuickTime movie). The pluginType defines the preferred plugin for double-click editing of the media image (ex: 'QTFP' for QuickTime Media Plugin). To NOT set one of the types, pass in a null pointer. The mediaType and pluginType must be either null or a pointer to a 4-byte character array.


Comments or suggestions? Contact Adobe Developer Support
Copyright © 1997 - 2001 Adobe Systems Incorporated. All rights reserved.
Legal notices and trademark attributions