InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IColorConverter.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Matt Phillips
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 __IColorConverter__
25 #define __IColorConverter__
26 
27 #include "IPMUnknown.h"
28 #include "ICMSSettings.h"
29 #include "ICMSProfile.h"
30 #include "IGraphicsPort.h"
31 
32 #include "ColorMgmtID.h"
33 #include "BravoForwardDecl.h"
34 
35 class IColorData;
36 class IDocument;
37 
38 
39 /*
40  Structure used in Convert call below
41  */
43 {
44  uint16 bitsPerPixel;
45  uint16 bitsPerComponent;
46  void* data;
47  uint16 numComps;
48 };
49 
51 {
52 public:
53  enum { kDefaultIID = IID_ICOLORCONVERTER };
54 
55  virtual bool8 Begin(ICMSProfile *srcProfile, ICMSProfile *destProfile, ICMSSettings::renderingIntent intent) = 0;
56  //This sets up the color converter for conversion. In this way, you can call "Convert" multiple times using the same
57  //transform and render intent. You MUST bracket this with a call to "End".
58 
59  virtual bool8 Begin(AGMColorSpace* srcColorSpace, ICMSProfile *destProfile, ICMSSettings::renderingIntent intent) = 0;
60  //This sets up the color converter for conversion. In this way, you can call "Convert" multiple times using the same
61  //transform and render intent. You MUST bracket this with a call to "End".
62 
63  virtual bool8 Begin(AGMColorSpace* srcColorSpace, AGMColorSpace *destColorSpace, ICMSSettings::renderingIntent intent) = 0;
64  //This sets up the color converter for conversion. In this way, you can call "Convert" multiple times using the same
65  //transform and render intent. You MUST bracket this with a call to "End".
66 
67  virtual bool8 Begin(IDocument *doc, ICMSProfile::profileCategory categorySrc, ICMSProfile::profileCategory categoryDest, ICMSSettings::renderingIntent intent) = 0;
68  //This sets up the color converter for conversion using categories (e.g., RGB source, CMYK separations).
69  //As with the other Begins, you MUST bracket this with a call to "End".
70 
71  virtual bool8 Begin(int32 cstypeSrc, int32 cstypeDst) = 0;
72  //This sets up the color converter for conversion using UNCALIBRATED METHODS. Do NOT use this unless you know
73  //that you want an uncalibrated conversion. As with the other Begins, you MUST bracket this with a call to "End".
74 
75  virtual bool8 End() = 0;
76  //This lets the converter know you are done converting. This will release any transforms and/or memory it allocated.
77  //You MUST bracket this with a call to "Begin".
78 
79  virtual bool8 Convert(ColorConverterData *dataIn, ColorConverterData *dataOut, int32 numPixels) = 0;
80  //Converts the dataIn structure using the preestablished profiles and render intent setup with a call to "Begin". Puts the
81  //result in dataOut. Converts only "numPixels" worth of data, and assumes that dataIn holds at least that amount of info.
82 
83  virtual bool8 Convert(float *compsIn, float *compsOut) = 0;
84  //Converts the colorIn using the preestablished profiles and render intent setup with a call to "Begin". Puts the
85  //result in compsOut.
86 
87  virtual bool8 Convert(IColorData *colorIn, IColorData *colorOut) = 0;
88  //Converts the colorIn using the preestablished profiles and render intent setup with a call to "Begin". Puts the
89  //result in colorOut. NOTE: This interface is DISAPPEARING soon (sept 98). Don't use this in new code. -MJP
90 
91  // Get the number of components in the source or destination color space according
92  // to the current Begin() context.
93  virtual int32 GetNumSourceComponents() const = 0;
94  virtual int32 GetNumDestinationComponents() const = 0;
95 
108  virtual void SetColorConvertOptions
109  (
110  AGMColorProfile* defRGBProfile,
111  AGMColorProfile* defCMYKProfile,
112  bool32 idealizedBlack,
113  bool32 oppBlending,
114  bool32 fastXforms,
115  IGraphicsPort::RenderingIntent defaultRI = IGraphicsPort::kRelative
116  ) = 0;
117 
127  virtual void SetColorConvertOptions(IGraphicsPort* iPort) = 0;
128 
135  virtual void SetColorConvertOptions
136  (
137  void* opts,
139  ) = 0;
140 };
141 
142 #endif
143