GDCM  2.2.0
gdcmJPEGLSCodec.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMJPEGLSCODEC_H
15 #define GDCMJPEGLSCODEC_H
16 
17 #include "gdcmImageCodec.h"
18 
19 namespace gdcm
20 {
21 
22 class JPEGLSInternals;
31 {
32 public:
33  JPEGLSCodec();
34  ~JPEGLSCodec();
35  bool CanDecode(TransferSyntax const &ts) const;
36  bool CanCode(TransferSyntax const &ts) const;
37 
38  unsigned long GetBufferLength() const { return BufferLength; }
39  void SetBufferLength(unsigned long l) { BufferLength = l; }
40 
41  bool Decode(DataElement const &is, DataElement &os);
42  bool Decode(DataElement const &in, char* outBuffer, uint32_t inBufferLength,
43  uint32_t inXMin, uint32_t inXMax, uint32_t inYMin,
44  uint32_t inYMax, uint32_t inZMin, uint32_t inZMax);
45  bool Code(DataElement const &in, DataElement &out);
46 
47  bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
48 
49  void SetLossless(bool l);
50  bool GetLossless() const;
51 
52 /*
53  * test.acr can look pretty bad, even with a lossy error of 2. Explanation follows:
54  * I agree that the test image looks ugly. In this particular case I can
55  * explain though.
56  *
57  * The image is 8 bit, but it does not use the full 8 bit dynamic range. The
58  * black pixels have value 234 and the white 255. If you set allowed lossy
59  * error to 2, you allow an error of about 10% of the actual dynamic range.
60  * That is of course very visible.
61  */
63  void SetLossyError(int error);
64 
65 private:
66  unsigned long BufferLength;
67  bool Lossless;
68  int LossyError;
69 };
70 
71 } // end namespace gdcm
72 
73 #endif //GDCMJPEGLSCODEC_H

Generated on Wed Jun 13 2012 20:40:37 for GDCM by doxygen 1.8.1
SourceForge.net Logo