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 #ifndef DJEIJG8_H
00035 #define DJEIJG8_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/ofstd/oflist.h"
00039 #include "dcmtk/dcmjpeg/djencabs.h"
00040
00041 extern "C"
00042 {
00043 struct jpeg_compress_struct;
00044 }
00045
00046 class DJCodecParameter;
00047
00051 class DJCompressIJG8Bit: public DJEncoder
00052 {
00053 public:
00054
00060 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality);
00061
00067 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans);
00068
00070 virtual ~DJCompressIJG8Bit();
00071
00084 virtual OFCondition encode(
00085 Uint16 columns,
00086 Uint16 rows,
00087 EP_Interpretation interpr,
00088 Uint16 samplesPerPixel,
00089 Uint16 *image_buffer,
00090 Uint8 *&to,
00091 Uint32 &length);
00092
00105 virtual OFCondition encode(
00106 Uint16 columns,
00107 Uint16 rows,
00108 EP_Interpretation interpr,
00109 Uint16 samplesPerPixel,
00110 Uint8 *image_buffer,
00111 Uint8 *&to,
00112 Uint32 &length);
00113
00116 virtual Uint16 bytesPerSample() const { return 1; }
00117
00120 virtual Uint16 bitsPerSample() const { return 8; }
00121
00126 void initDestination(jpeg_compress_struct *cinfo);
00127
00132 int emptyOutputBuffer(jpeg_compress_struct *cinfo);
00133
00138 void termDestination(jpeg_compress_struct *cinfo);
00139
00144 virtual void outputMessage(void *arg) const;
00145
00146 private:
00147
00149 DJCompressIJG8Bit(const DJCompressIJG8Bit&);
00150
00152 DJCompressIJG8Bit& operator=(const DJCompressIJG8Bit&);
00153
00155 void cleanup();
00156
00158 const DJCodecParameter *cparam;
00159
00161 Uint8 quality;
00162
00164 int psv;
00165
00167 int pt;
00168
00170 EJ_Mode modeofOperation;
00171
00173 OFList<unsigned char *> pixelDataList;
00174
00176 size_t bytesInLastBlock;
00177
00178 };
00179
00180 #endif
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197