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 DJEIJG12_H
00030 #define DJEIJG12_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 typedef struct jpeg_compress_struct * j_compress_ptr;
00040 struct jpeg_decompress_struct;
00041 typedef struct jpeg_decompress_struct * j_decompress_ptr;
00042 }
00043
00044 class DJCodecParameter;
00045
00046
00050 class DJCompressIJG12Bit: public DJEncoder
00051 {
00052 public:
00053
00059 DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality);
00060
00066 DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans);
00067
00069 virtual ~DJCompressIJG12Bit();
00070
00083 virtual OFCondition encode(
00084 Uint16 columns,
00085 Uint16 rows,
00086 EP_Interpretation interpr,
00087 Uint16 samplesPerPixel,
00088 Uint16 *image_buffer,
00089 Uint8 *&to,
00090 Uint32 &length);
00091
00104 virtual OFCondition encode(
00105 Uint16 columns,
00106 Uint16 rows,
00107 EP_Interpretation interpr,
00108 Uint16 samplesPerPixel,
00109 Uint8 *image_buffer,
00110 Uint8 *&to,
00111 Uint32 &length);
00112
00115 virtual Uint16 bytesPerSample() const { return 2; }
00116
00119 virtual Uint16 bitsPerSample() const { return 12; }
00120
00125 void initDestination(jpeg_compress_struct *cinfo);
00126
00131 int emptyOutputBuffer(jpeg_compress_struct *cinfo);
00132
00137 void termDestination(jpeg_compress_struct *cinfo);
00138
00144 virtual void emitMessage(void *arg, int msg_level) const;
00145
00146 private:
00147
00149 DJCompressIJG12Bit(const DJCompressIJG12Bit&);
00150
00152 DJCompressIJG12Bit& operator=(const DJCompressIJG12Bit&);
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
00198
00199
00200
00201
00202
00203