VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPNGWriter.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 =========================================================================*/ 00031 #ifndef __vtkPNGWriter_h 00032 #define __vtkPNGWriter_h 00033 00034 #include "vtkIOImageModule.h" // For export macro 00035 #include "vtkImageWriter.h" 00036 00037 class vtkImageData; 00038 class vtkUnsignedCharArray; 00039 00040 class VTKIOIMAGE_EXPORT vtkPNGWriter : public vtkImageWriter 00041 { 00042 public: 00043 static vtkPNGWriter *New(); 00044 vtkTypeMacro(vtkPNGWriter,vtkImageWriter); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 00048 virtual void Write(); 00049 00051 00052 vtkSetMacro(WriteToMemory, unsigned int); 00053 vtkGetMacro(WriteToMemory, unsigned int); 00054 vtkBooleanMacro(WriteToMemory, unsigned int); 00056 00058 00060 virtual void SetResult(vtkUnsignedCharArray*); 00061 vtkGetObjectMacro(Result, vtkUnsignedCharArray); 00063 00064 protected: 00065 vtkPNGWriter(); 00066 ~vtkPNGWriter(); 00067 00068 void WriteSlice(vtkImageData *data, int* uExtent); 00069 unsigned int WriteToMemory; 00070 vtkUnsignedCharArray *Result; 00071 FILE *TempFP; 00072 00073 private: 00074 vtkPNGWriter(const vtkPNGWriter&); // Not implemented. 00075 void operator=(const vtkPNGWriter&); // Not implemented. 00076 }; 00077 00078 #endif 00079 00080