VTK
dox/IO/Image/vtkPNGWriter.h
Go to the documentation of this file.
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 
00055   vtkSetClampMacro(CompressionLevel, int, 0, 9);
00056   vtkGetMacro(CompressionLevel, int);
00058 
00060 
00061   vtkSetMacro(WriteToMemory, unsigned int);
00062   vtkGetMacro(WriteToMemory, unsigned int);
00063   vtkBooleanMacro(WriteToMemory, unsigned int);
00065 
00067 
00069   virtual void SetResult(vtkUnsignedCharArray*);
00070   vtkGetObjectMacro(Result, vtkUnsignedCharArray);
00072 
00073 protected:
00074   vtkPNGWriter();
00075   ~vtkPNGWriter();
00076 
00077   void WriteSlice(vtkImageData *data, int* uExtent);
00078   int CompressionLevel;
00079   unsigned int WriteToMemory;
00080   vtkUnsignedCharArray *Result;
00081   FILE *TempFP;
00082 
00083 private:
00084   vtkPNGWriter(const vtkPNGWriter&);  // Not implemented.
00085   void operator=(const vtkPNGWriter&);  // Not implemented.
00086 };
00087 
00088 #endif
00089 
00090