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 "vtkImageWriter.h" 00035 00036 class vtkImageData; 00037 class vtkUnsignedCharArray; 00038 00039 class VTK_IO_EXPORT vtkPNGWriter : public vtkImageWriter 00040 { 00041 public: 00042 static vtkPNGWriter *New(); 00043 vtkTypeMacro(vtkPNGWriter,vtkImageWriter); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 virtual void Write(); 00048 00050 00051 vtkSetMacro(WriteToMemory, unsigned int); 00052 vtkGetMacro(WriteToMemory, unsigned int); 00053 vtkBooleanMacro(WriteToMemory, unsigned int); 00055 00057 00059 virtual void SetResult(vtkUnsignedCharArray*); 00060 vtkGetObjectMacro(Result, vtkUnsignedCharArray); 00062 00063 protected: 00064 vtkPNGWriter(); 00065 ~vtkPNGWriter(); 00066 00067 void WriteSlice(vtkImageData *data); 00068 unsigned int WriteToMemory; 00069 vtkUnsignedCharArray *Result; 00070 FILE *TempFP; 00071 00072 private: 00073 vtkPNGWriter(const vtkPNGWriter&); // Not implemented. 00074 void operator=(const vtkPNGWriter&); // Not implemented. 00075 }; 00076 00077 #endif 00078 00079