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

Reads images using the PNM format. More...

#include <ImageReaderPNM.h>

Inheritance diagram for vtkm::io::ImageReaderPNM:
vtkm::io::ImageReaderBase

Public Member Functions

 ~ImageReaderPNM () noexcept override
 
 ImageReaderPNM (const ImageReaderPNM &)=delete
 
ImageReaderPNMoperator= (const ImageReaderPNM &)=delete
 
- Public Member Functions inherited from vtkm::io::ImageReaderBase
 ImageReaderBase (const char *filename)
 
 ImageReaderBase (const std::string &filename)
 Construct a reader to load data from the given file. More...
 
virtual ~ImageReaderBase () noexcept
 
 ImageReaderBase (const ImageReaderBase &)=delete
 
ImageReaderBaseoperator= (const ImageReaderBase &)=delete
 
const vtkm::cont::DataSetReadDataSet ()
 Load data from the file and return it in a DataSet object. More...
 
const vtkm::cont::DataSetGetDataSet () const
 
const std::string & GetPointFieldName () const
 Get the name of the output field that will be created to hold color data. More...
 
void SetPointFieldName (const std::string &name)
 Set the name of the output field that will be created to hold color data. More...
 
const std::string & GetFileName () const
 
void SetFileName (const std::string &filename)
 

Protected Member Functions

void Read () override
 
template<typename PixelType >
void DecodeFile (std::ifstream &inStream, const vtkm::Id &width, const vtkm::Id &height)
 Reads image data from the provided inStream with the supplied width/height Stores the data in a vector of PixelType which is converted to an DataSet. More...
 
- Protected Member Functions inherited from vtkm::io::ImageReaderBase
void InitializeImageDataSet (const vtkm::Id &width, const vtkm::Id &height, const ColorArrayType &pixels)
 Resets the DataSet to hold the given pixels. More...
 

Private Types

using Superclass = ImageReaderBase
 

Additional Inherited Members

- Public Types inherited from vtkm::io::ImageReaderBase
using ColorArrayType = vtkm::cont::ArrayHandle< vtkm::Vec4f_32 >
 
- Protected Attributes inherited from vtkm::io::ImageReaderBase
std::string FileName
 
std::string PointFieldName = "color"
 
vtkm::cont::DataSet DataSet
 

Detailed Description

Reads images using the PNM format.

ImageReaderPNM is constructed with the name of the file to read. The data from the file is read by calling the ReadDataSet method.

Currently, ImageReaderPNM only supports files using the portable pixmap (PPM) format (with magic number `‘P6’'). These files are most commonly stored with a .ppm extension although the .pnm extension is also valid. More details on the PNM format can be found here at http://netpbm.sourceforge.net/doc/ppm.html

By default, the colors are stored in a field named "colors", but the name of the field can optionally be changed using the SetPointFieldName method.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ ~ImageReaderPNM()

vtkm::io::ImageReaderPNM::~ImageReaderPNM ( )
overridenoexcept

◆ ImageReaderPNM()

vtkm::io::ImageReaderPNM::ImageReaderPNM ( const ImageReaderPNM )
delete

Member Function Documentation

◆ DecodeFile()

template<typename PixelType >
void vtkm::io::ImageReaderPNM::DecodeFile ( std::ifstream &  inStream,
const vtkm::Id width,
const vtkm::Id height 
)
protected

Reads image data from the provided inStream with the supplied width/height Stores the data in a vector of PixelType which is converted to an DataSet.

◆ operator=()

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

◆ Read()

void vtkm::io::ImageReaderPNM::Read ( )
overrideprotectedvirtual

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