ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkJPEGImageIO_h 00019 #define __itkJPEGImageIO_h 00020 00021 00022 #include "itkImageIOBase.h" 00023 00024 namespace itk 00025 { 00034 class ITK_EXPORT JPEGImageIO:public ImageIOBase 00035 { 00036 public: 00038 typedef JPEGImageIO Self; 00039 typedef ImageIOBase Superclass; 00040 typedef SmartPointer< Self > Pointer; 00041 00043 itkNewMacro(Self); 00044 00046 itkTypeMacro(JPEGImageIO, ImageIOBase); 00047 00049 itkSetMacro(Quality, int); 00050 itkGetConstMacro(Quality, int); 00052 00054 itkSetMacro(Progressive, bool); 00055 itkGetConstMacro(Progressive, bool); 00057 00058 /*-------- This part of the interface deals with reading data. ------ */ 00059 00062 virtual bool CanReadFile(const char *); 00063 00065 virtual void ReadImageInformation(); 00066 00068 virtual void Read(void *buffer); 00069 00071 virtual void ReadVolume(void *buffer); 00072 00073 /*-------- This part of the interfaces deals with writing data. ----- */ 00074 00077 virtual bool CanWriteFile(const char *); 00078 00081 virtual void WriteImageInformation(); 00082 00085 virtual void Write(const void *buffer); 00086 00087 protected: 00088 JPEGImageIO(); 00089 ~JPEGImageIO(); 00090 void PrintSelf(std::ostream & os, Indent indent) const; 00091 00092 void WriteSlice(std::string & fileName, const void *buffer); 00093 00096 int m_Quality; 00097 00099 bool m_Progressive; 00100 private: 00101 JPEGImageIO(const Self &); //purposely not implemented 00102 void operator=(const Self &); //purposely not implemented 00103 }; 00104 } // end namespace itk 00106 00107 #endif // __itkJPEGImageIO_h 00108