GDCM  2.2.4
gdcmJPEGCodec.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 GDCMJPEGCODEC_H
15 #define GDCMJPEGCODEC_H
16 
17 #include "gdcmImageCodec.h"
18 
19 namespace gdcm
20 {
21 
22 class PixelFormat;
23 class TransferSyntax;
41 {
42 friend class ImageRegionReader;
43 public:
44  JPEGCodec();
45  ~JPEGCodec();
46  bool CanDecode(TransferSyntax const &ts) const;
47  bool CanCode(TransferSyntax const &ts) const;
48  bool Decode(DataElement const &is, DataElement &os);
49  void SetPixelFormat(PixelFormat const &pf);
50 
52  void ComputeOffsetTable(bool b);
53 
55  bool Code(DataElement const &in, DataElement &out);
56 
57  virtual bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
58 
59  //void SetReversible(bool res);
60 
61  void SetQuality(double q);
62  double GetQuality() const;
63 
64  void SetLossless(bool l);
65  bool GetLossless() const;
66 
67 protected:
68  bool DecodeExtent(
69  char *buffer,
70  unsigned int xmin, unsigned int xmax,
71  unsigned int ymin, unsigned int ymax,
72  unsigned int zmin, unsigned int zmax,
73  std::istream & is
74  );
75 
76  bool DecodeByStreams(std::istream &is, std::ostream &os);
77  bool IsValid(PhotometricInterpretation const &pi);
78 
79 protected:
80  // Internal method called by SetPixelFormat
81  // Instantiate the right jpeg codec (8, 12 or 16)
82  void SetBitSample(int bit);
83 
84  virtual bool IsStateSuspension() const;
85 
86 protected:
87  int BitSample;
88  bool Lossless;
89  int Quality;
90 
91 private:
92  void SetupJPEGBitCodec(int bit);
93  JPEGCodec *Internal;
94 };
95 
96 } // end namespace gdcm
97 
98 #endif //GDCMJPEGCODEC_H
int Quality
Definition: gdcmJPEGCodec.h:89
bool Lossless
Definition: gdcmJPEGCodec.h:88
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
ImageCodec.
Definition: gdcmImageCodec.h:30
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
int BitSample
Definition: gdcmJPEGCodec.h:87
Class to manipulate Transfer Syntax.
Definition: gdcmTransferSyntax.h:39
Class to represent an PhotometricInterpretation.
Definition: gdcmPhotometricInterpretation.h:28
ImageRegionReader.
Definition: gdcmImageRegionReader.h:29
PixelFormat.
Definition: gdcmPixelFormat.h:36
JPEG codec Class to do JPEG (8bits, 12bits, 16bits lossy & lossless). It redispatch in between the di...
Definition: gdcmJPEGCodec.h:40

Generated on Sat Nov 16 2013 18:10:55 for GDCM by doxygen 1.8.5
SourceForge.net Logo