![]() | InDesign SDK 20.5 |
#include <IImageUtils.h>

Public Types | |
| enum | { kDefaultIID = IID_IIMAGEUTILS } |
| enum | { kUseFirstAlpha = kMaxUInt32 } |
Public Member Functions | |
| virtual bool16 | IsEmbeddedImage (const IPMUnknown *boss)=0 |
| virtual IPMStream * | GetImageStream (const UIDRef &imageRef)=0 |
| virtual uint8 * | GetPlatformSystemClut (void)=0 |
| virtual bool16 | IsGraphic (const IPMUnknown *boss)=0 |
| virtual bool16 | IsGraphic (const UIDRef &imageRef)=0 |
| virtual bool16 | IsRasterImage (const IPMUnknown *boss)=0 |
| virtual bool16 | IsRasterImage (const UIDRef &imageRef)=0 |
| virtual bool16 | IsVectorGraphic (const IPMUnknown *boss)=0 |
| virtual bool16 | IsVectorGraphic (const UIDRef &imageRef)=0 |
| virtual void | GetDuplicateProxy (const IPMStream &stream, const UIDRef &srcPageItem, UID *dupPageItemUID, UID *dupProxyUID)=0 |
| virtual AGMColorSpace * | GetAGMColorProfileFromImage (UIDRef imageOrProxyRef)=0 |
| virtual bool16 | ITGAlphaExists (const IImageAttributes *iImageAttributes)=0 |
| virtual uint32 | ITGAlphaType (const IImageAttributes *iImageAttributes, uint32 index=kUseFirstAlpha)=0 |
| virtual uint32 | ITGNumberOfChannels (const IImageAttributes *iImageAttributes)=0 |
| virtual uint32 | ITGNumberOfAlphaChannels (const IImageAttributes *iImageAttributes)=0 |
| virtual uint32 | ITGNumberOfSpotChannels (const IImageAttributes *iImageAttributes)=0 |
| virtual uint32 | ITGNumberOfLayers (const IImageAttributes *iImageAttributes)=0 |
| virtual uint32 | ITGGetChannelNames (const IImageAttributes *iImageAttributes, K2Vector< PMString > &channelNames)=0 |
| virtual uint32 | ITGGetChannelTypes (const IImageAttributes *iImageAttributes, K2Vector< uint32 > &channelTypes)=0 |
| virtual ICopyableInMemoryCache * | QueryDuplicateCache (const UIDRef &srcPageItem)=0 |
| virtual bool32 | GetPhotoshopThumbnail (const IImageAttributes *iImageAttributes, uint8 *prevBaseaddr, uint32 *prevWidth, uint32 *prevHeight, bool32 bDoJustify, bool32 bLongAlign=kFalse)=0 |
| virtual CAGMColorSpace | GetDuotoneColorSpace (IPMUnknown *imageObject)=0 |
| virtual ErrorCode | GetMetaDataOrientation (const UIDRef &uidRef, int16 *metaDataOrientation)=0 |
| virtual ErrorCode | GetMetaDataOrientation (IImageAttributes *iImageAttributes, int16 *metaDataOrientation)=0 |
| virtual bool32 | RotateThumbnailImage (const IImageAttributes *iImageAttributes, uint8 *imageBuffer, int32 *imageWidth, int32 *imageHeight, const int16 imageChannels, const int16 rotation, const bool32 bDoJustify=kTrue, const bool32 bReorient=kFalse)=0 |
| virtual bool16 | WriteJPEGToStream (char *data, uint32 width, uint32 height, IPMStream *outStream)=0 |
| virtual IImageAttributes * | QueryImageAttributes (const UIDRef &itemRef)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Utility methods designed to quickly obtain information about a given raster based image. Some of these utils are designed to work with PDF, EPS, AI, WMF, DCS and PICT images but most are designed to work with pure raster formats such as TIFF, JPEG, etc.
Utils<IImageUtils>()->IsEmbeddedImage( ... );
| pure virtual |
looks in the IImageAttributes of the provided imageRef or proxyRef for the kPMTagICCProfileData tag and converts the data within the tag, if present, to an AGMColorSpace*. This routine was written for raster formats.
| imageOrProxyRef | reference to image or a proxy |
| pure virtual |
If the image is a native duotone image (i.e. it has an IDuotoneInfo interface with a non-zero number inks), then return the CAGMColorSpace to apply to the grayscale image to get the proper effect. If the returned colorspace has an IsValid result of false, then this image is not a duotone.
| imageObject | [IN]: a pointer to the page item (presumably a kImageItem). |
| pure virtual |
Returns the UID of the proxy and the page item for a page item with a link which matches the link from which the given stream was created. This utility allows the client to avoid creating a duplicate proxy when the same image is placed multiple times.
| stream | |
| srcPageItem | |
| dupPageItemUID | [OUT] |
| dupProxyUID | [OUT] |
Image reading utility. This routine constructs a read stream to the image data associated with imageRef. If the image was embedded at place time, then the stream will point to the embedded data rather than the linked image on disk.
| imageRef |
| pure virtual |
For the image refered to by the UIDRef, attempt to read out the tiff:Orientation meta data information, and return the angle in metaDataOrientation. This API will only return kSuccess for TIFF orientations of 1 (top left) [returns angle 0]; 3 (bottom right) [returns 180]; 6 (right top) [returns 90] and 8 (left bottom) [returns -90]
| uidRef | [IN]: a UIDRef of the image item. |
| metaDataOrientation | [OUT]: the orientation out of the meta data, either 0, 90, -90 or 180. Note: we return kFailure for any orientation that involves a flip. |
| pure virtual |
For the image attributes refered to by the IImageAttributes pointer, attempt to read out the tiff:Orientation meta data information, and return the angle in metaDataOrientation. This API will only return kSuccess for TIFF orientations of 1 (top left) [returns angle 0]; 3 (bottom right) [returns 180]; 6 (right top) [returns 90] and 8 (left bottom) [returns -90].
| iImageAttributes | [IN]: a pointer to the IImageAttributes of the image item. |
| metaDataOrientation | [OUT]: the orientation out of the meta data, either 0, 90, -90 or 180. Note: we return kFailure for any orientation that involves a flip. |
| pure virtual |
Images created with Photoshop often have an RGB thumbnail embedded in its 8BIM data resource, which is stored in the images "tags." This method attempts to extract the thumbnail from the 8BIM tag of the main image item's IImageAttributes and copy it to the prevBaseaddr. It is assumed that the output buffer pointed to by prevBaseaddr is big enough to hold the image. Note that if bLongAlign is true, then the output will be padded if necessary to ensure that each scanline has a multiple of 4 bytes.
| iImageAttributes | [IN]: A pointer to the IImageAttributes, presumably from a kImageItem, containing the attributes of the source image. |
| prevBaseaddr | [IN/OUT]: A pointer to the output buffer where RGB data will be copied. |
| prevWidth | [IN/OUT]: On entry, the number of pixels wide the output buffer is prepared to hold. If bDoJustify is kFalse, then on return, prevWidth will contain the pixel width of the returned thumbnail. If bDoJustify is kTrue, then on return, prevWidth will contain the same value as on entry and the thumbnail will be centered within the input width. Note that the returned value will never be larger than the value on entry. |
| prevHeight | [IN/OUT]: On entry, the number of scanlines the output buffer is prepared to hold. If bDoJustify is kFalse, then on return, prevHeight will contain the pixel height of the returned thumbnail. If bDoJustify is kTrue, then on return, prevHeight will contain the same value as on entry and the thumbnail will be centered within the input height. Note that the returned value will never be larger than the value on entry. |
| bDoJustify | [IN]: If kTrue, then center the thumbnail within the provided bitmap buffer and do not change the prevWidth and prevHeight. If kFalse, then align the thumbnail with the upper left of the provided bitmap buffer and change the values of prevWidth and prevHeight to match the actual thumbnail size. In either case, the aspect ratio of the thumbnail is preserved. |
| bLongAlign | [IN]: If kTrue, then pad each row of image data to ensure a multiple of 4 row bytes. |
| pure virtual |
Get a platform specific, 256 color RGB color map. Caller is responsible for deleting the result.
| pure virtual |
IsEmbeddedImage is a routine for pure raster images which returns true if the image was embedded. Note, it the image was embedded as a side effect of a place (as would happen for small images which are wholly embedded rather than represented by a proxy) this routine returns false. If you need to determine whether the image is embedded in the links panel, test IDataLink::GetStoredState. This routine was written for raster image formats.
| boss |
| pure virtual |
Determine if item is a raster or a vector graphic, or some other kind.
| boss |
| pure virtual |
Determine if item is a raster or a vector graphic, or some other kind.
| imageRef |
| pure virtual |
Determine if item is a raster image (For example TIFF, JPEG, PCX, BMP, PNG, GIF, Scitex CT)
| boss | of the item to check its type. |
| pure virtual |
Determine if item is a raster image (For example TIFF, JPEG, PCX, BMP, PNG, GIF, Scitex CT)
| imageRef,UIDRef | of the item to check its type. |
| pure virtual |
Determine if item is a vector graphic (For example PDF, EPS, WMF, PICT)
| boss | of the item to check its type. |
| pure virtual |
Determine if item is a vector graphic (For example PDF, EPS, WMF, PICT)
| imageRef | UIDRef of the item to check its type. |
| pure virtual |
Image Tag Utils... Here are all of the ImageTag Get (ITG) functions that have default values when the tag doesn't exist. These functions are provided for convenience.Helper method to access kPMTagChannelTypeArray tag information. Checks if there is an alpha channel defined in the channel info array
| iImageAttributes |
| pure virtual |
Helper method to access kPMTagChannelTypeArray tag information tries to get the alpha type of the given index
| iImageAttributes | |
| index | [IN] - if kUseFirstAlpha passed in, look for the first alpha (skipping over any spot channels) and return it. Otherwise, treat index as a zero-based index into the array of alphas and spots. |
| pure virtual |
helper method to access kPMTagChannelNameArray tag information
| iImageAttributes | |
| channelNames | [OUT] returns the channel names in the K2Vector passed in |
| pure virtual |
Helper method to access kPMTagChannelTypeArray tag information
| iImageAttributes | |
| channelTypes | [OUT] returns the channel types (i.e. kPMAlphaAssociated) stored in the K2Vector passed in |
| pure virtual |
helper method to access kPMTagChannelTypeArray tag information
| iImageAttributes |
| pure virtual |
helper method to access kPMTagChannelTypeArray tag information
| iImageAttributes |
| pure virtual |
Helper method to access kPMTagNumberOfLayers tag information (method moved from ImageTagUtils.cpp)
| iImageAttributes |
| pure virtual |
helper method to access kPMTagChannelTypeArray tag information
| iImageAttributes |
| pure virtual |
If the linked content associated with the specified source page item has a duplicate somewhere else in the document, and that has a 'full' in memory cache, then return it. the ICopyableInMemoryCache can be used to copy the in-memory contents from the source page item to a duplicate destination page item. Although the interface allows implementations for any page item, it currently (InDesign 3.0) only has implementations for vector image types (e.g. EPS, PDF, WMF, PICT) and not raster.
| srcPageItem |
| pure virtual |
Returns the Image attributes.
| itemRef[IN],: | a UIDRef of the image item. |
| pure virtual |
Rotates the image data in right angle (90 degree) increments. A pointer to the image data along with metrics are passed in and the resulting image returned in the same buffer. If bJustify is set true, the resulting image will be centered. If bReorient is set true, the rotated image's height and width are returned as well.
| iImageAttributes | [IN]: A pointer to the IImageAttributes, presumably from a kImageItem, containing the attributes of the source image. |
| imageBuffer | [IN/OUT]: A pointer to the image data buffer containing the source image data. This buffer will also contain the rotated image upon return. |
| imageWidth | [IN/OUT]: On entry, the number of pixels wide the image buffer holds. If bReorient is kFalse, then on return, width will be unchanged. If bReorient is kTrue, then on return, width will contain the number of pixels of width of the rotated image. |
| imageHeight | [IN/OUT]: On entry, the number of scanlines the image buffer holds. If bReorient is kFalse, then on return, height will be unchanged. If bReorient is kTrue, then on return, height will contain the number of scanlines of the rotated image. |
| imageChannels | [IN]: The value for the number of channels each image pixel contains. |
| rotation | [IN]: The value for the rotation. Acceptable values are 0, 90, -90, & 180. |
| bReorient | [IN]: If set to true, this flag will cause the image height and width to be swapped if necessary. |
| pure virtual |
Writes JPEG data to the supplied IPMStream.
| data | is the JPEG data in RGB layout. |
| width | is the width of the image. |
| height | is the height of the image. |
| outStream | is the stream in which the JPEG will be written. |