00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #ifndef INC_COPLFILR
00101 #define INC_COPLFILR
00102
00103
00104 #include "colcomp.h"
00105 #include "impcol.h"
00106
00107 #include "vector3d.h"
00108
00109 class String_64;
00110 class SGDisplayLibColGroup;
00111
00112
00113
00114
00115
00116 typedef enum
00117 {
00118 PalettePrefix_None = 0,
00119 PalettePrefix_Pantone,
00120 PalettePrefix_PantoneSpot,
00121 PalettePrefix_Focoltone,
00122 PalettePrefix_Trumatch,
00123 PalettePrefix_RGB,
00124 } PalettePrefix;
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 class PaletteFilter : public Filter
00136 {
00137 CC_DECLARE_DYNAMIC(PaletteFilter);
00138
00139 public:
00140 PaletteFilter();
00141 ~PaletteFilter();
00142
00143
00144 public:
00145 virtual BOOL IsDefaultDocRequired(const TCHAR* pcszPathName);
00146
00147 virtual BOOL DoImport(SelOperation*, CCLexFile*, Document*, BOOL AutoChosen = FALSE,
00148 ImportPosition *Pos = NULL,
00149 KernelBitmap** ppImportedBitmap = NULL,
00150 DocCoord* pPosTranslate = NULL, String_256* = NULL);
00151 BOOL DoExport(Operation*, CCLexFile*, PathName*, Document*, BOOL);
00152
00153 inline static double ClampZeroToOne(const double input) { return (input < 0 ? 0 : (input > 1 ? 1 : input)); }
00154
00155
00156 public:
00157 static void ConvertLABToRGB(const Vector3D& icol, Vector3D* ocol);
00158 protected:
00159 static void ConvertCIEtoXYZ(const Vector3D& icol, Vector3D& ocol);
00160 static void ConvertLABtoXYZ(const Vector3D& white, const Vector3D& icol, Vector3D& ocol);
00161 static void ConvertXYZToRGB(const Vector3D& icol, Vector3D& ocol);
00162
00163
00164 protected:
00165 virtual BOOL PreImport() = 0;
00166 virtual BOOL ImportPalette() = 0;
00167 virtual BOOL PostImport() = 0;
00168
00169 BOOL StartPercentage(INT32 UpTo = -1);
00170 BOOL SetPercentage(INT32 GotTo = -1);
00171 BOOL ProcessRGBColour(double Red, double Green, double Blue, const StringBase* pColName = NULL);
00172 BOOL ProcessCMYKColour(double Cyan, double Magenta, double Yellow, double Key, const StringBase* pColName = NULL);
00173 BOOL ProcessHSVColour(double Hue, double Sat, double Value, const StringBase* pColName = NULL);
00174 BOOL ProcessLabColour(double Luminance, double A, double B, const StringBase* pColName = NULL);
00175 BOOL ProcessGreyColour(double Intensity, const StringBase* pColName = NULL);
00176 BOOL NameRGBColour(ColourRGBT* pColour, StringBase* pName);
00177 BOOL NameCMYKColour(ColourCMYK* pColour, StringBase* pName);
00178 BOOL NameHSVColour(ColourHSVT* pColour, StringBase* pName);
00179 BOOL NameGreyColour(ColourGreyT* pColour, StringBase* pName);
00180 BOOL UsePercentageColour();
00181
00182 protected:
00183 BOOL AddColourToGallery(PalettePrefix Prefix, String_64 *Name,
00184 ColourGeneric *Definition, ColourModel Model,
00185 BOOL NewlineAfter = FALSE, BOOL IsSpotColour = FALSE);
00186
00187
00188 private:
00189 BOOL PrepareForImport();
00190 BOOL FinishImport(BOOL Success);
00191
00192 protected:
00193 ImportedColours* m_pNewColours;
00194 SelOperation* m_pImportOp;
00195 CCLexFile* m_pImportFile;
00196 Document* m_pImportDoc;
00197
00198 BOOL ImportIntoGallery;
00199 SGDisplayLibColGroup *CurrentGalleryGroup;
00200 };
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210 class MSPaletteFilter : public PaletteFilter
00211 {
00212 CC_DECLARE_DYNAMIC(MSPaletteFilter);
00213
00214 public:
00215 MSPaletteFilter();
00216 ~MSPaletteFilter();
00217
00218
00219 BOOL Init();
00220 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00221
00222
00223 public:
00224 virtual BOOL PreImport();
00225 virtual BOOL ImportPalette();
00226 virtual BOOL PostImport();
00227
00228 protected:
00229 UINT32 m_NumToImport;
00230 };
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240 class PaintShopProPaletteFilter : public PaletteFilter
00241 {
00242 CC_DECLARE_DYNAMIC(PaintShopProPaletteFilter);
00243
00244 public:
00245 PaintShopProPaletteFilter();
00246 ~PaintShopProPaletteFilter();
00247
00248
00249 BOOL Init();
00250 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00251
00252
00253 public:
00254 virtual BOOL PreImport();
00255 virtual BOOL ImportPalette();
00256 virtual BOOL PostImport();
00257
00258 protected:
00259 UINT32 m_NumToImport;
00260 };
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270 class AdobeColourTableFilter : public PaletteFilter
00271 {
00272 CC_DECLARE_DYNAMIC(AdobeColourTableFilter);
00273
00274 public:
00275 AdobeColourTableFilter();
00276 ~AdobeColourTableFilter();
00277
00278
00279 BOOL Init();
00280 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00281
00282
00283 public:
00284 virtual BOOL PreImport();
00285 virtual BOOL ImportPalette();
00286 virtual BOOL PostImport();
00287 };
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298 class AdobeColourSwatchFilter : public PaletteFilter
00299 {
00300 CC_DECLARE_DYNAMIC(AdobeColourSwatchFilter);
00301
00302 public:
00303 AdobeColourSwatchFilter();
00304 ~AdobeColourSwatchFilter();
00305
00306
00307 BOOL Init();
00308 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00309
00310
00311 public:
00312 virtual BOOL PreImport();
00313 virtual BOOL ImportPalette();
00314 virtual BOOL PostImport();
00315
00316 protected:
00317 WORD ReverseWord(WORD Orig);
00318
00319 protected:
00320 UINT32 m_NumToImport;
00321 BOOL m_MetUnknownModel;
00322 };
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334 class CorelPaletteFilter : public PaletteFilter
00335 {
00336 CC_DECLARE_DYNAMIC(CorelPaletteFilter);
00337
00338 public:
00339 CorelPaletteFilter();
00340
00341
00342 public:
00343 BOOL Init();
00344 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00345
00346
00347 public:
00348 virtual BOOL PreImport();
00349 virtual BOOL ImportPalette();
00350 virtual BOOL PostImport();
00351
00352 protected:
00353 INT32 HowCompatible4(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00354 INT32 HowCompatible5(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00355 BOOL DoImport4();
00356 BOOL DoImport5();
00357
00358
00359 protected:
00360 INT32 m_FileVersion;
00361 };
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375 class JCWColourFilter : public PaletteFilter
00376 {
00377 CC_DECLARE_DYNAMIC(JCWColourFilter);
00378
00379 public:
00380 JCWColourFilter();
00381 ~JCWColourFilter();
00382
00383
00384 BOOL Init();
00385 INT32 HowCompatible(PathName& Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize);
00386
00387
00388 public:
00389 virtual BOOL PreImport();
00390 virtual BOOL ImportPalette();
00391 virtual BOOL PostImport();
00392
00393 protected:
00394 UINT32 m_NumToImport;
00395 BOOL m_ColoursAreSpots;
00396 };
00397
00398 #endif // INC_COPLFILR