InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CImageReadFormat Class Reference
Inheritance diagram for CImageReadFormat:
IImageReadFormatIPMUnknown

Public Member Functions

virtual bool16 Open (IPMStream *)
 
virtual bool16 GetImageAttributes (IImageAttributes *)
 
virtual bool16 GetGraphicLayerInfo (IGraphicLayerInfo *)
 
virtual bool16 Close ()
 
virtual bool16 CanRead (IPMStream *)
 
virtual bool16 SetFormatOption (uint32, uint32 &)
 
virtual bool16 ReadData (ImageStreamRecord &)
 

Additional Inherited Members

- Public Types inherited from IImageReadFormat
enum  { kOptionSetImage = 1, kOptionSetLayer = 2 }
 
enum  { kOptionUseFullRes = kMaxInt32, kOptionUseSmallestRes = 0 }
 

Member Function Documentation

virtual bool16 CImageReadFormat::CanRead (IPMStreamiPMStream)
inlinevirtual

Called to determine if this reader can process the data in the given stream.

This can be the first call to the image format reader. It does not take place after the Open call. CanRead is the filter's oppurtunity to determine if it in fact can read the stream of data.

Parameters
iPMStreamIN The stream of data
Returns
kTrue if the reader can process the data in the stream, else kFalse
See Also
IPMStream

Implements IImageReadFormat.

virtual bool16 CImageReadFormat::Close ()
inlinevirtual

Closes this reader.

Returns
kTrue if the method succeeds, else kFalse

Implements IImageReadFormat.

virtual bool16 CImageReadFormat::GetGraphicLayerInfo (IGraphicLayerInfoiLayerInfo)
inlinevirtual

Retrieves the graphic layer information for the current image.

GetGraphicLayerInfo will return kFalse if Open has not been called.

Note: May return kTrue even if layers do not exist.

Parameters
iLayerInfoOUT The IGraphicLayerInfo object to which the layer information is written
Returns
kTrue if the method succeeds, else kFalse
See Also
IGraphicLayerInfo

Implements IImageReadFormat.

virtual bool16 CImageReadFormat::GetImageAttributes (IImageAttributesiImageAttributes)
inlinevirtual

Retrieves the image attributes for the current image (there may be only one; see note below about multiple images).

GetImageAttributes will return kFalse if Open has not been called.

GetAttributes is a separate method so that IImageReadFormat users can cache the information.

IMPORTANT: If the format supports more than one image per file and there is another image, then the attributes returned are those for the currently set image (via the SetFormatOption call).

Parameters
iImageAttributesOUT The IImageAttributes object to which the attributes are written
Returns
kTrue if the method succeeds, else kFalse
See Also
IImageAttributes

Implements IImageReadFormat.

virtual bool16 CImageReadFormat::Open (IPMStreamiPMStream)
inlinevirtual

Open is the initial call made to the image format reader (after the optional CanRead call, however). The image format reader should do any initialization and check the stream to make sure it really understands the data.

Parameters
iPMStreamIN The stream to read
Returns
kTrue if the reader can process the data in the given stream, else kFalse

Implements IImageReadFormat.

virtual bool16 CImageReadFormat::ReadData (ImageStreamRecordoutRecord)
inlinevirtual

Reads data from the image. The data copied into outRecord.buffer is expected to be in the format described by the image attributes.

Note: For 1-bit data each row is bit-padded to a byte boundary.

Parameters
outRecordIN/OUT Describes the data to be read and holds pointer to the caller-provided buffer to which data is copied
See Also
IImageStream

Implements IImageReadFormat.

virtual bool16 CImageReadFormat::SetFormatOption (uint32 formatOption,
uint32 & formatData 
)
inlinevirtual

Sets an additional format option. It allows the caller to request a particular resolution of image or a specific layer in a multi-layer image, if the IImageReadFormat instance supports the options. Returns kTrue if the reader supports the option and the image contains sufficient data to satisify the request, otherwise kFalse.

Inputs are as follows:

formatOption = kOptionSetImage, formatData = kOptionUseFullRes. The resolution of the main image will be returned in formatData.

formatOption = kOptionSetImage, formatData = kOptionUseSmallestRes. If there are multiple images then the resolution of the smallest subsampled version of the main image will be returned in formatData.

formatOption = kOptionSetImage, formatData = desired resolution. If there are multiple images then the closest resolution which is greater than or equal to the desired resolution will be returned in formatData.

formatOption = kOptionSetLayer, formatData = zero based index of desired layer. Sets the index of the layer to use. No return value will be placed in formatData.

Note: This call must be made after the call to Open().

Parameters
formatOptionIN The selector for the format to use
formatDataIN/OUT The data to use with the specified selector on input; various on output
Returns
kTrue if the method succeeds, else kFalse

Implements IImageReadFormat.