VTK-m
2.0
|
Manages writing, and loading data from images. More...
#include <ImageWriterBase.h>
Public Types | |
enum | PixelDepth { PixelDepth::PIXEL_8, PixelDepth::PIXEL_16 } |
using | ColorArrayType = vtkm::cont::ArrayHandle< vtkm::Vec4f_32 > |
Public Member Functions | |
VTKM_CONT | ImageWriterBase (const char *filename) |
VTKM_CONT | ImageWriterBase (const std::string &filename) |
virtual VTKM_CONT | ~ImageWriterBase () noexcept |
ImageWriterBase (const ImageWriterBase &)=delete | |
ImageWriterBase & | operator= (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 | |
virtual VTKM_CONT void | Write (vtkm::Id width, vtkm::Id height, const ColorArrayType &pixels)=0 |
Protected Attributes | |
std::string | FileName |
PixelDepth | Depth = PixelDepth::PIXEL_8 |
Manages writing, and loading data from images.
ImageWriterBase
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.
ImageWriterBase
can be constructed from a file, canvas, or ArrayHandle. It can also be empy constructed and filled in with a dataset later.
ImageWriterBase
implements virtual methods for writing files. Ideally, these methods will be overriden in various subclasses to implement specific functionality for writing data to specific image file-types.
|
strong |
VTKM_CONT vtkm::io::ImageWriterBase::ImageWriterBase | ( | const char * | filename | ) |
VTKM_CONT vtkm::io::ImageWriterBase::ImageWriterBase | ( | const std::string & | filename | ) |
|
virtualnoexcept |
|
delete |
|
inline |
|
inline |
You can specify the number of bits used by each color channel with the PixelDepth
.
|
delete |
|
inline |
|
inline |
You can specify the number of bits used by each color channel with the PixelDepth
.
|
protectedpure virtual |
Implemented in vtkm::io::ImageWriterPNM, vtkm::io::ImageWriterHDF5, and vtkm::io::ImageWriterPNG.
|
virtual |
Write the color field of a data set to an image file.
The DataSet
must have a 2D structured cell set.
The specified color field must be of type ColorArrayType
(a basic ArrayHandle
of vtkm::Vec4f_32
). If no color field name is given, the first point field that matches this criteria is written.
Reimplemented in vtkm::io::ImageWriterHDF5.
|
protected |
|
protected |