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 DJEIJG16_H
00035 #define DJEIJG16_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 typedef struct jpeg_compress_struct * j_compress_ptr;
00045 struct jpeg_decompress_struct;
00046 typedef struct jpeg_decompress_struct * j_decompress_ptr;
00047 }
00048
00049 class DJCodecParameter;
00050
00051
00055 class DJCompressIJG16Bit: public DJEncoder
00056 {
00057 public:
00058
00064 DJCompressIJG16Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans);
00065
00067 virtual ~DJCompressIJG16Bit();
00068
00081 virtual OFCondition encode(
00082 Uint16 columns,
00083 Uint16 rows,
00084 EP_Interpretation interpr,
00085 Uint16 samplesPerPixel,
00086 Uint16 *image_buffer,
00087 Uint8 *&to,
00088 Uint32 &length);
00089
00102 virtual OFCondition encode(
00103 Uint16 columns,
00104 Uint16 rows,
00105 EP_Interpretation interpr,
00106 Uint16 samplesPerPixel,
00107 Uint8 *image_buffer,
00108 Uint8 *&to,
00109 Uint32 &length);
00110
00113 virtual Uint16 bytesPerSample() const { return 2; }
00114
00117 virtual Uint16 bitsPerSample() const { return 16; }
00118
00123 void initDestination(jpeg_compress_struct *cinfo);
00124
00129 int emptyOutputBuffer(jpeg_compress_struct *cinfo);
00130
00135 void termDestination(jpeg_compress_struct *cinfo);
00136
00141 virtual void outputMessage(void *arg) const;
00142
00143 private:
00144
00146 DJCompressIJG16Bit(const DJCompressIJG16Bit&);
00147
00149 DJCompressIJG16Bit& operator=(const DJCompressIJG16Bit&);
00150
00152 void cleanup();
00153
00155 const DJCodecParameter *cparam;
00156
00158 int psv;
00159
00161 int pt;
00162
00164 EJ_Mode modeofOperation;
00165
00167 OFList<unsigned char *> pixelDataList;
00168
00170 size_t bytesInLastBlock;
00171
00172 };
00173
00174 #endif
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191