VTK-m  2.0
Public Member Functions | Protected Member Functions | Private Types | List of all members
vtkm::io::ImageWriterPNM Class Reference

Manages writing images using the PNM format. More...

#include <ImageWriterPNM.h>

Inheritance diagram for vtkm::io::ImageWriterPNM:
vtkm::io::ImageWriterBase

Public Member Functions

VTKM_CONT ~ImageWriterPNM () noexcept override
 
 ImageWriterPNM (const ImageWriterPNM &)=delete
 
ImageWriterPNMoperator= (const ImageWriterPNM &)=delete
 
VTKM_CONT void Write (vtkm::Id width, vtkm::Id height, const ColorArrayType &pixels) override
 Attempts to write the ImageDataSet to a PNM file. More...
 
- Public Member Functions inherited from vtkm::io::ImageWriterBase
VTKM_CONT ImageWriterBase (const char *filename)
 
VTKM_CONT ImageWriterBase (const std::string &filename)
 
virtual VTKM_CONT ~ImageWriterBase () noexcept
 
 ImageWriterBase (const ImageWriterBase &)=delete
 
ImageWriterBaseoperator= (const ImageWriterBase &)=delete
 
const VTKM_CONT std::string & GetFileName () const
 
VTKM_CONT void SetFileName (const std::string &filename)
 
virtual VTKM_CONT void WriteDataSet (const vtkm::cont::DataSet &dataSet, const std::string &colorField={})
 Write the color field of a data set to an image file. More...
 
VTKM_CONT PixelDepth GetPixelDepth () const
 
VTKM_CONT void SetPixelDepth (PixelDepth depth)
 

Protected Member Functions

template<typename PixelType >
VTKM_CONT void WriteToFile (vtkm::Id width, vtkm::Id height, const ColorArrayType &pixels)
 

Private Types

using Superclass = vtkm::io::ImageWriterBase
 

Additional Inherited Members

- Public Types inherited from vtkm::io::ImageWriterBase
enum  PixelDepth { PixelDepth::PIXEL_8, PixelDepth::PIXEL_16 }
 
using ColorArrayType = vtkm::cont::ArrayHandle< vtkm::Vec4f_32 >
 
- Protected Attributes inherited from vtkm::io::ImageWriterBase
std::string FileName
 
PixelDepth Depth = PixelDepth::PIXEL_8
 

Detailed Description

Manages writing images using the PNM format.

ImageWriterPNM extends ImageWriterBase, and implements writing images in a valid PNM format (for magic number P6). More details on the PNM format can be found here: http://netpbm.sourceforge.net/doc/ppm.html

When a file is writen the MaxColorValue found in the file is used to determine the PixelType required to stored PixelType is instead dependent upon the read MaxColorValue obtained from the file

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ ~ImageWriterPNM()

VTKM_CONT vtkm::io::ImageWriterPNM::~ImageWriterPNM ( )
overridenoexcept

◆ ImageWriterPNM()

vtkm::io::ImageWriterPNM::ImageWriterPNM ( const ImageWriterPNM )
delete

Member Function Documentation

◆ operator=()

ImageWriterPNM& vtkm::io::ImageWriterPNM::operator= ( const ImageWriterPNM )
delete

◆ Write()

VTKM_CONT void vtkm::io::ImageWriterPNM::Write ( vtkm::Id  width,
vtkm::Id  height,
const ColorArrayType pixels 
)
overridevirtual

Attempts to write the ImageDataSet to a PNM file.

The MaxColorValue set in the file with either be selected from the stored MaxColorValue member variable, or from the templated type if MaxColorValue hasn't been set from a read file.

Implements vtkm::io::ImageWriterBase.

◆ WriteToFile()

template<typename PixelType >
VTKM_CONT void vtkm::io::ImageWriterPNM::WriteToFile ( vtkm::Id  width,
vtkm::Id  height,
const ColorArrayType pixels 
)
protected

The documentation for this class was generated from the following file: