1 // 2 // (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. 3 // 4 5 6 #ifndef CHARLS_HEADER 7 #define CHARLS_HEADER 8 9 #include "dcmtk/ofstd/ofmem.h" 10 #undef NEAR 11 #include "streams.h" 12 13 #define JPEG_SOI 0xD8 14 #define JPEG_EOI 0xD9 15 #define JPEG_SOS 0xDA 16 17 #define JPEG_SOF 0xF7 18 #define JPEG_LSE 0xF8 19 #define JPEG_DNL 0xDC 20 #define JPEG_DRI 0xDD 21 #define JPEG_RSTm 0xD0 22 #define JPEG_COM 0xFE 23 #define JPEG_APP0 0xE0 // JFIF 24 #define JPEG_APP7 0xE7 // colorspace 25 #define JPEG_APP8 0xE8 // colorXForm 26 27 28 29 // Default bin sizes for JPEG-LS statistical modeling. Can be overridden at compression time, however this is rarely done. 30 const int BASIC_T1 = 3; 31 const int BASIC_T2 = 7; 32 const int BASIC_T3 = 21; 33 34 const LONG BASIC_RESET = 64; 35 36 class JLSOutputStream; 37 38 39 template<class STRATEGY> 40 class JlsCodecFactory 41 { 42 public: 43 OFrvalue<OFunique_ptr<STRATEGY> > GetCodec(const JlsParameters& info, const JlsCustomParameters&); 44 private: 45 STRATEGY* GetCodecImpl(const JlsParameters& info); 46 }; 47 48 JLS_ERROR CheckParameterCoherent(const JlsParameters* pparams); 49 50 JlsCustomParameters ComputeDefault(LONG MAXVAL, LONG NEAR); 51 52 // 53 // JpegSegment 54 // 55 class JpegSegment 56 { 57 protected: JpegSegment()58 JpegSegment() {} 59 public: ~JpegSegment()60 virtual ~JpegSegment() {} 61 virtual void Write(JLSOutputStream* pstream) = 0; 62 }; 63 64 #endif 65