InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IJPEGEncoder.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 // Defines the JPEG coder interface.
24 //
25 //========================================================================================
26 
27 #ifndef __IJPEGEncoder__
28 #define __IJPEGEncoder__
29 
30 #include "IPMUnknown.h"
31 #include "JPEGCodecID.h"
32 #include "IPMStream.h"
33 
36 typedef enum _JPEGEncoding // Match Photoshop defs: 0, 1, 2, 3
37 { // last two options not implemented
38  kJPEGBaseline,
39  kJPEGSequential,
40  kJPEGProgressive,
41  kJPEGLossless,
42  kJPEGHierarchical
43 } JPEGEncoding;
44 
48 typedef enum
49 {
50  kPoorQuality = -2,
51  kFairQuality = 0,
52  kGoodQuality = 1,
53  kVeryGoodQuality = 3,
54  kExcellentQuality = 6,
55  kGreatQuality = 8
56 } JPEGQuality;
57 
60 typedef enum
61 { // Match Photoshop defs
62  kFairScan = 1,
63  kGoodScan = 2,
64  // kVeryGoodScan= 4, // Yes, these are out of order
65  kExcellentScan = 3
66 } JPEGScanTabGroup;
67 
72 public:
74  xResolution(0),
75  yResolution(0),
76  xSize(0),
77  ySize(0),
78  colorType(0),
79  imageResources(nil),
80  imageResourcesSize(0UL),
81  jpegQuality(kFairQuality),
82  encoding(kJPEGBaseline),
83  customHuff(kFalse),
84  scanTabGroup(kFairScan),
85  iccProfileData(nil),
86  iccProfileDataLen(0UL)
87  {}
88 
89  short xResolution; // These two parameters are ignored if the image is CMYK
90  short yResolution; // and the resolution must then be stored in the image resources
91  uint16 xSize;
92  uint16 ySize;
93  short colorType; // 1 = Gray, 3 = RGB, 4 = CMYK
94  char* imageResources;
95  uint32 imageResourcesSize;
96  JPEGQuality jpegQuality;
97  JPEGEncoding encoding; // sequential, progressive...
98  bool16 customHuff; // whether to use custom Huff tables
99  JPEGScanTabGroup scanTabGroup; // what scan order to use for progressive encoding
100  uint8* iccProfileData;
101  uint32 iccProfileDataLen;
102 } ;
103 
106 class IJPEGEncoder : public IPMUnknown
107 {
108 
109 public:
116  virtual bool16 Open ( const JPEGWriteOptions& jpegWriteOptions,
117  IPMStream* iPMStream ) = 0;
118 
125  virtual bool16 WriteRows (char* rowBuffer, uint32 numberOfRows) = 0;
126 
130  virtual bool16 Close () = 0;
131 };
132 
133 
134 #endif