VTK-m  2.2
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkm::io::ImageReaderBase Class Referenceabstract

Manages reading, and loading data from images. More...

#include <ImageReaderBase.h>

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

Public Types

using ColorArrayType = vtkm::cont::ArrayHandle< vtkm::Vec4f_32 >
 

Public Member Functions

 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

virtual void Read ()=0
 
void InitializeImageDataSet (const vtkm::Id &width, const vtkm::Id &height, const ColorArrayType &pixels)
 Resets the DataSet to hold the given pixels. More...
 

Protected Attributes

std::string FileName
 
std::string PointFieldName = "color"
 
vtkm::cont::DataSet DataSet
 

Detailed Description

Manages reading, and loading data from images.

ImageReaderBase implements methods for loading imaging data from a canvas or ArrayHandle and storing that data in a vtkm::cont::DataSet. Image RGB values are represented as a point field in a 2D uniform dataset.

ImageReaderBase implements virtual methods for reading files. Ideally, these methods will be overriden in various subclasses to implement specific functionality for reading data to specific image file-types.

Member Typedef Documentation

◆ ColorArrayType

Constructor & Destructor Documentation

◆ ImageReaderBase() [1/3]

vtkm::io::ImageReaderBase::ImageReaderBase ( const char *  filename)
explicit

◆ ImageReaderBase() [2/3]

vtkm::io::ImageReaderBase::ImageReaderBase ( const std::string &  filename)
explicit

Construct a reader to load data from the given file.

◆ ~ImageReaderBase()

virtual vtkm::io::ImageReaderBase::~ImageReaderBase ( )
virtualnoexcept

◆ ImageReaderBase() [3/3]

vtkm::io::ImageReaderBase::ImageReaderBase ( const ImageReaderBase )
delete

Member Function Documentation

◆ GetDataSet()

const vtkm::cont::DataSet& vtkm::io::ImageReaderBase::GetDataSet ( ) const
inline

◆ GetFileName()

const std::string& vtkm::io::ImageReaderBase::GetFileName ( ) const
inline

◆ GetPointFieldName()

const std::string& vtkm::io::ImageReaderBase::GetPointFieldName ( ) const
inline

Get the name of the output field that will be created to hold color data.

◆ InitializeImageDataSet()

void vtkm::io::ImageReaderBase::InitializeImageDataSet ( const vtkm::Id width,
const vtkm::Id height,
const ColorArrayType pixels 
)
protected

Resets the DataSet to hold the given pixels.

◆ operator=()

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

◆ Read()

virtual void vtkm::io::ImageReaderBase::Read ( )
protectedpure virtual

◆ ReadDataSet()

const vtkm::cont::DataSet& vtkm::io::ImageReaderBase::ReadDataSet ( )

Load data from the file and return it in a DataSet object.

◆ SetFileName()

void vtkm::io::ImageReaderBase::SetFileName ( const std::string &  filename)
inline

◆ SetPointFieldName()

void vtkm::io::ImageReaderBase::SetPointFieldName ( const std::string &  name)
inline

Set the name of the output field that will be created to hold color data.

Member Data Documentation

◆ DataSet

vtkm::cont::DataSet vtkm::io::ImageReaderBase::DataSet
protected

◆ FileName

std::string vtkm::io::ImageReaderBase::FileName
protected

◆ PointFieldName

std::string vtkm::io::ImageReaderBase::PointFieldName = "color"
protected

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