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 #ifndef DJEIJG8_H
00030 #define DJEIJG8_H
00031
00032 #include "dcmtk/config/osconfig.h"
00033 #include "dcmtk/ofstd/oflist.h"
00034 #include "dcmtk/dcmjpeg/djencabs.h"
00035
00036 extern "C"
00037 {
00038 struct jpeg_compress_struct;
00039 }
00040
00041 class DJCodecParameter;
00042
00046 class DJCompressIJG8Bit: public DJEncoder
00047 {
00048 public:
00049
00055 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality);
00056
00062 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans);
00063
00065 virtual ~DJCompressIJG8Bit();
00066
00079 virtual OFCondition encode(
00080 Uint16 columns,
00081 Uint16 rows,
00082 EP_Interpretation interpr,
00083 Uint16 samplesPerPixel,
00084 Uint16 *image_buffer,
00085 Uint8 *&to,
00086 Uint32 &length);
00087
00100 virtual OFCondition encode(
00101 Uint16 columns,
00102 Uint16 rows,
00103 EP_Interpretation interpr,
00104 Uint16 samplesPerPixel,
00105 Uint8 *image_buffer,
00106 Uint8 *&to,
00107 Uint32 &length);
00108
00111 virtual Uint16 bytesPerSample() const { return 1; }
00112
00115 virtual Uint16 bitsPerSample() const { return 8; }
00116
00121 void initDestination(jpeg_compress_struct *cinfo);
00122
00127 int emptyOutputBuffer(jpeg_compress_struct *cinfo);
00128
00133 void termDestination(jpeg_compress_struct *cinfo);
00134
00140 virtual void emitMessage(void *arg, int msg_level) const;
00141
00142 private:
00143
00145 DJCompressIJG8Bit(const DJCompressIJG8Bit&);
00146
00148 DJCompressIJG8Bit& operator=(const DJCompressIJG8Bit&);
00149
00151 void cleanup();
00152
00154 const DJCodecParameter *cparam;
00155
00157 Uint8 quality;
00158
00160 int psv;
00161
00163 int pt;
00164
00166 EJ_Mode modeofOperation;
00167
00169 OFList<unsigned char *> pixelDataList;
00170
00172 size_t bytesInLastBlock;
00173
00174 };
00175
00176 #endif
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199