ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkJPEGImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkJPEGImageIO_h
19 #define __itkJPEGImageIO_h
20 
21 
22 #include "itkImageIOBase.h"
23 
24 namespace itk
25 {
34 class ITK_EXPORT JPEGImageIO:public ImageIOBase
35 {
36 public:
38  typedef JPEGImageIO Self;
41 
43  itkNewMacro(Self);
44 
46  itkTypeMacro(JPEGImageIO, ImageIOBase);
47 
49  itkSetMacro(Quality, int);
50  itkGetConstMacro(Quality, int);
52 
54  itkSetMacro(Progressive, bool);
55  itkGetConstMacro(Progressive, bool);
57 
58  /*-------- This part of the interface deals with reading data. ------ */
59 
62  virtual bool CanReadFile(const char *);
63 
65  virtual void ReadImageInformation();
66 
68  virtual void Read(void *buffer);
69 
71  virtual void ReadVolume(void *buffer);
72 
73  /*-------- This part of the interfaces deals with writing data. ----- */
74 
77  virtual bool CanWriteFile(const char *);
78 
81  virtual void WriteImageInformation();
82 
85  virtual void Write(const void *buffer);
86 
87 protected:
88  JPEGImageIO();
89  ~JPEGImageIO();
90  void PrintSelf(std::ostream & os, Indent indent) const;
91 
92  void WriteSlice(std::string & fileName, const void *buffer);
93 
96  int m_Quality;
97 
100 
101 private:
102  JPEGImageIO(const Self &); //purposely not implemented
103  void operator=(const Self &); //purposely not implemented
104 };
105 } // end namespace itk
106 
107 #endif // __itkJPEGImageIO_h
108