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 DJEIJG16_H
00030 #define DJEIJG16_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 DJCompressIJG16Bit: public DJEncoder
00051 {
00052 public:
00053
00059 DJCompressIJG16Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans);
00060
00062 virtual ~DJCompressIJG16Bit();
00063
00076 virtual OFCondition encode(
00077 Uint16 columns,
00078 Uint16 rows,
00079 EP_Interpretation interpr,
00080 Uint16 samplesPerPixel,
00081 Uint16 *image_buffer,
00082 Uint8 *&to,
00083 Uint32 &length);
00084
00097 virtual OFCondition encode(
00098 Uint16 columns,
00099 Uint16 rows,
00100 EP_Interpretation interpr,
00101 Uint16 samplesPerPixel,
00102 Uint8 *image_buffer,
00103 Uint8 *&to,
00104 Uint32 &length);
00105
00108 virtual Uint16 bytesPerSample() const { return 2; }
00109
00112 virtual Uint16 bitsPerSample() const { return 16; }
00113
00118 void initDestination(jpeg_compress_struct *cinfo);
00119
00124 int emptyOutputBuffer(jpeg_compress_struct *cinfo);
00125
00130 void termDestination(jpeg_compress_struct *cinfo);
00131
00137 virtual void emitMessage(void *arg, int msg_level) const;
00138
00139 private:
00140
00142 DJCompressIJG16Bit(const DJCompressIJG16Bit&);
00143
00145 DJCompressIJG16Bit& operator=(const DJCompressIJG16Bit&);
00146
00148 void cleanup();
00149
00151 const DJCodecParameter *cparam;
00152
00154 int psv;
00155
00157 int pt;
00158
00160 EJ_Mode modeofOperation;
00161
00163 OFList<unsigned char *> pixelDataList;
00164
00166 size_t bytesInLastBlock;
00167
00168 };
00169
00170 #endif
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193