00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkPNGWriter.h,v $ 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 =========================================================================*/ 00028 #ifndef __vtkPNGWriter_h 00029 #define __vtkPNGWriter_h 00030 00031 #include "vtkImageWriter.h" 00032 00033 class vtkImageData; 00034 class vtkUnsignedCharArray; 00035 00036 class VTK_IO_EXPORT vtkPNGWriter : public vtkImageWriter 00037 { 00038 public: 00039 static vtkPNGWriter *New(); 00040 vtkTypeRevisionMacro(vtkPNGWriter,vtkImageWriter); 00041 void PrintSelf(ostream& os, vtkIndent indent); 00042 00044 virtual void Write(); 00045 00047 00048 vtkSetMacro(WriteToMemory, unsigned int); 00049 vtkGetMacro(WriteToMemory, unsigned int); 00050 vtkBooleanMacro(WriteToMemory, unsigned int); 00052 00054 00056 virtual void SetResult(vtkUnsignedCharArray*); 00057 vtkGetObjectMacro(Result, vtkUnsignedCharArray); 00059 00060 protected: 00061 vtkPNGWriter(); 00062 ~vtkPNGWriter(); 00063 00064 void WriteSlice(vtkImageData *data); 00065 unsigned int WriteToMemory; 00066 vtkUnsignedCharArray *Result; 00067 FILE *TempFP; 00068 00069 private: 00070 vtkPNGWriter(const vtkPNGWriter&); // Not implemented. 00071 void operator=(const vtkPNGWriter&); // Not implemented. 00072 }; 00073 00074 #endif 00075 00076