InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IImageAttributes.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: jargast
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IImageAttributes__
25 #define __IImageAttributes__
26 
27 #include "IPMUnknown.h"
28 #include "ImageTypes.h"
29 #include "ImageID.h"
30 #include "UIDList.h"
31 
37 {
38 public:
39  enum { kDefaultIID = IID_IIMAGEATTRIBUTES};
40 
49  typedef enum {
50  kPMTagDefault = 0, // If not one of the Tags enumerated below, then treat as bytes
51  kPMTagByte = 1, // 8-bit quantity
52  kPMTagWord = 2, // 16-bit integer
53  kPMTagLong = 3, // 32-bit integer
54  kPMTagFixed = 4 // 32-bit quantity containing the integer part in the
55  // high order word and the fractional part in the low order
56  // word. Divide by 65536.0 to convert to float
57  } ImageTagTypes;
58 
68  enum {
69  kOPIExtraTIFFASCIITagPrefix = 0x17000000
70  };
71 
78  enum
79  {
80  kPMTagImageWidth = 100, //R TYPE: uint32
81  kPMTagImageHeight = 101, //R TYPE: uint32
82  kPMTagBitsPerChannel = 102, //R TYPE: uint32 1, 2, 4, 6, and 8 are supported.
83  kPMTagColorSpace = 103, //R TYPE: uint32 One of the defined PM image color spaces
84  kPMTagDocumentName = 104, // TYPE: array null terminated string
85  kPMTagImageDescription = 105, // TYPE: array null terminated strings
86  kPMTagChannelsPerPixel = 106, //R TYPE: uint32 Number of channels (including extra samples) in image
87  kPMTagNumberOfLayers = 107, // TYPE: uint32 default 1, but for Photoshop format images could be more
88  kPMTagXResolution = 108, //R TYPE: UFixed32 X resolution in DPI (UNSIGNED 32-bit quantity containing the integer part in the
89  // high order word and the fractional part in the low order word).
90  kPMTagYResolution = 109, //R TYPE: UFixed32 Y resolution in DPI (UNSIGNED 32-bit quantity containing the integer part in the
91  // high order word and the fractional part in the low order word).
92  kPMTagPlanarConfig = 110, //R TYPE: uint32 kPMChunky or kPMPlanar.
93  kPMTagColorMap = 111, // TYPE: array Arranged in interleaved order, 1 >> numBits entries.
94  kPMTagOptimalTileWidth = 112, // TYPE: uint32 Gives the width in pixels of the best tile size to ask for
95  kPMTagOptimalTileHeight = 113, // TYPE: uint32 Gives the height in pixels of the best tile size to ask for
96  kPMTagChannelNames = 114, // TYPE: array null terminated strings. There should be SamplesPerPixel names
97  kPMTagChannelInfo = 115, // TYPE: array TODO: set of channel descriptions. Primary, mask, assocatied, unassociated?
98  kPMTagLayerInfo = 116, // TYPE: array TODO: layer info. Required if num layers > 1
99  kPMTagTIFFClipPath = 117, // TYPE: array TIFF clipping path data.
100  kPMTagTIFFXClipPathUnits = 118, // TYPE: uint32
101  kPMTagTIFFYClipPathUnits = 119, // TYPE: uint32
102  kPMTagOPIProxy = 120, // TYPE: uint8 0 = not proxy, 1 = proxy: high-res image is given by kPMTagOPIImageID
103  kPMTagOPIImageID = 121, // TYPE: array Full path name of original high-res image
104  kPMTagICCProfileData = 122, // TYPE: array black box inter color 3.0 profile
105  kPMTagWhiteIsZero = 123, // TYPE: uint8 For bilevel and grayscale images: True: indicates 0 is imaged as white, False: indicates 0 is imaged as black.
106  // If no tag value is set, then 1-bit images will be treated as 1 and non-1-bit grayscale images will be treated as 0
107  // by the ImageStreamManager.
108  kPMTagAlphaType_obsolete = 124, // TYPE: uint32 depreciated - replaced by kPMTagChannelTypeArray
109  kPMTagTIFFClipPathName = 125, // TYPE: array Name of the Photoshop clipping path which identifies the resource.
110  kPMTagNoOPIGeneration = 126, // TYPE: uint8 If non-zero, InDesign will not generate OPI comments for this image.
111  kPMTagNeverOmit = 127, // TYPE: uint8 If non-zero, InDesign will never Omit this image.
112  kPMTagPhotoshop8BIM = 128, // TYPE: array PhotoShop's Image Resource Block field
113  kPMTagTransparencyMask = 129, // TYPE: uint8 zero-based index with respect to the first extra channel of the channel
114  // to use as a kPMUnassociatedTransparency mask.
115  kPMTagAlphaPacking = 130, // TYPE: uint32 kPMAlphaPackingPreOrder or kPMAlphaPackingPostOrder -- PostOrder is preferred. PreOrder may not
116  // be supported by Write filters.
117  kPMTagNumberOfVisibleLayers = 131, // TYPE: uint32 number of visible layers
118  kPMTagVisibleLayerInfo = 132, // TYPE: array if num visible layers exists and is > 0, array of name strings
119  kPMTagXMPData = 133, // TYPE: array A block of XMP data.
120  kPMTagChannelTypeArray = 134, // TYPE: array one of kPMAlphaAssociated, kPMAlphaUnassociated or kPMSpotChannel. Default is kPMAlphaUnassociated.
121  // kPMAlphaAssociated indicates a transparency mask where the alpha has been pre-multiplied into
122  // the color values. To use a kPMAlphaUnassociated alpha as a transparency mask, set the
123  // kPMTagTransparencyMask tag to the zero based index of the alpha to use. Note: Currently, InDesign 2.0
124  // only supports an index of 0 but in the future we will allow the client to specify any channel and we
125  // will automatically un-pre-multiply any existing Associated alpha channel if necessary.
126  kPMTagChannelNameArray = 135, // TYPE: array names associated with the channels in the kPMTagChannelTypeArray tag. Each name is null terminated.
127  // If there is no name (i.e. for kPMAlphaAssociated alpha channel), there will only be a null to
128  // represent the name.
129  kPMTagEPSProxySource = 136, // TYPE: uint32 This tag is only present in the proxy image for an EPS. The tag value tells us if the proxy
130  // was created from a PICT preview, TIFF preview or from rendering the PostScript. PICT based proxies
131  // are the least trust worthy because they do not usually have transparency data.
132  kPMTagHavePSDComposite = 137, // TYPE: uint8 Non-zero value indicates that we have a PSD image which was saved from Photoshop with
133  // Maximize Backwards Compatibility turned on.
134  kPMAttributesAreSynthetic = 138, // TYPE: uint8 Non-zero value indicates that attributes are synthetic and not based on actual image attributes
135  // This will be true if image is a temporary created by scripting code and import is still pending
136  kPMTagHaveICCProfileData = 139, // TYPE: uint8 Large profiles end up getting deleted from the IImageAttributes to avoid bloat. Therefore, to
137  // get the profile data, we have to re-read the IImageAttributes from the linked image. To avoid
138  // unnecessary disk access, this tag can be used as a cache to indicate whether or not there is
139  // an embedded profile. If the tag does not exist, then we do not know if the profile exists or not.
140  kPMTagImageAttributeRev = 140, // TYPE: uint32 This tag holds the revision of the filter when the attributes were initialized via GetImageAttributes.
141  // It is in the form 0xAAAABBBB where AAAA = filter major version, BBBB = filter minor version.
142  kPMTagMetaDataRotation = 141, // TYPE: int16 This holds the angle that was read out of the meta data tiff:orientation tag, so we can undo the
143  // rotation when the image is replaced.
144  kPMTagJPEG_EXIF_Resolution = 142, // TYPE: UFixed32 Same as kPMTagXResolution except that this resolution value came from the EXIF structure of a JPEG (camera raw) image.
145  kPMTagPrivate_Thumbnail = 143, // TYPE: array Private.
146  kPMTagOrientation = 144, // TYPE: int16 Corresponds to TIFF tag #274
147  kPMTagUseAIDEforPng = 145, // TYPE: uint32 This tag holds the revision of the filter when the attributes were initialized via GetImageAttributes.
148  };
149 
150  enum {
151  kFirstImageAttributeTag = kPMTagImageWidth,
152  kLastImageAttributeTag = kPMTagEPSProxySource // Any tag greater than this value will require an ImageTagTypes passed to SetTag
153  };
154 
157  enum
158  {
159  kEPSPICTProxy = 0, // The proxy was generated from a PICT preview
160  kEPSTIFFProxy = 1, // The proxy was generated from a TIFF preview
161  kEPSPSProxy = 2 // The proxy was generated by rendering the PostScript into a raster port
162  };
163 
166  enum {
167  kPMPlanarDefault = kPMChunky
168  };
169 
181  virtual uint32 GetTagSize (uint32 tagID) const = 0;
182 
188  virtual const char* GetTag (uint32 tagID, void* imageTagData) const = 0;
189 
192  virtual ImageTagTypes GetTagType (uint32 tagID) const = 0;
193 
198  virtual bool16 SetTag (uint32 tagID, uint32 imageTagSize, const void* imageTagData, ImageTagTypes type = kPMTagDefault) = 0;
199 
204  virtual bool16 DeleteTag (uint32 tagID) = 0;
205 
209  virtual bool16 TagExists (uint32 tagID) const = 0;
210 
213  virtual bool16 CopyTags (const IImageAttributes* copy) = 0;
214 
215 
219  virtual uint32 GetTagCount() const = 0;
220 
223  virtual uint32 GetNthTagSize (uint32 n) const = 0;
224 
228  virtual uint32 GetNthTagID (uint32 n) const = 0;
229 
233  virtual ImageTagTypes GetNthTagType (uint32 n) const = 0;
234 
238  virtual const char* GetNthTag (uint32 n) const = 0;
239 
244  virtual const UIDList* CreateUsedColorUIDList(const UIDList* pUIDList) = 0;
245  virtual const UIDList* GetUsedColorUIDList() const = 0;
246 
247 };
248 
249 #endif