VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkJPEGWriter.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00029 #ifndef __vtkJPEGWriter_h 00030 #define __vtkJPEGWriter_h 00031 00032 #include "vtkIOImageModule.h" // For export macro 00033 #include "vtkImageWriter.h" 00034 00035 class vtkUnsignedCharArray; 00036 class vtkImageData; 00037 00038 class VTKIOIMAGE_EXPORT vtkJPEGWriter : public vtkImageWriter 00039 { 00040 public: 00041 static vtkJPEGWriter *New(); 00042 vtkTypeMacro(vtkJPEGWriter,vtkImageWriter); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 virtual void Write(); 00047 00049 00050 vtkSetClampMacro(Quality, int, 0, 100); 00051 vtkGetMacro(Quality, int); 00053 00055 00056 vtkSetMacro(Progressive, unsigned int); 00057 vtkGetMacro(Progressive, unsigned int); 00058 vtkBooleanMacro(Progressive, unsigned int); 00060 00062 00063 vtkSetMacro(WriteToMemory, unsigned int); 00064 vtkGetMacro(WriteToMemory, unsigned int); 00065 vtkBooleanMacro(WriteToMemory, unsigned int); 00067 00069 00071 virtual void SetResult(vtkUnsignedCharArray*); 00072 vtkGetObjectMacro(Result, vtkUnsignedCharArray); 00074 00075 protected: 00076 vtkJPEGWriter(); 00077 ~vtkJPEGWriter(); 00078 00079 void WriteSlice(vtkImageData *data, int* uExtent); 00080 00081 private: 00082 int Quality; 00083 unsigned int Progressive; 00084 unsigned int WriteToMemory; 00085 vtkUnsignedCharArray *Result; 00086 FILE *TempFP; 00087 00088 private: 00089 vtkJPEGWriter(const vtkJPEGWriter&); // Not implemented. 00090 void operator=(const vtkJPEGWriter&); // Not implemented. 00091 }; 00092 00093 #endif 00094 00095