VTK-m  2.1
Classes | Typedefs | Enumerations | Functions
vtkm::io Namespace Reference

VTK-m File input and output classes. More...

Classes

class  BasePixel
 Base type for more complex pixels (RGB, Greyscale, etc) that describes various values such as bit-depth, channel width, bytes per pixel, and how various data should be polled. More...
 
class  BOVDataSetReader
 
struct  ComponentTypeFromSize
 
struct  ComponentTypeFromSize< size, typename std::enable_if<(size==16)>::type >
 
struct  ComponentTypeFromSize< size, typename std::enable_if<(size==8)>::type >
 
class  ErrorIO
 This class is thrown when VTK-m encounters an error with the file system. More...
 
class  GreyPixel
 
class  ImageReaderBase
 Manages reading, and loading data from images. More...
 
class  ImageReaderHDF5
 Reading images using HDF5 Image format. More...
 
class  ImageReaderPNG
 Reads images using the PNG format. More...
 
class  ImageReaderPNM
 Reads images using the PNM format. More...
 
class  ImageWriterBase
 Manages writing, and loading data from images. More...
 
class  ImageWriterHDF5
 Writing images using HDF5 Image format. More...
 
class  ImageWriterPNG
 Writes images using the PNG format. More...
 
class  ImageWriterPNM
 Writes images using the PNM format. More...
 
class  RGBPixel
 
class  VTKDataSetReader
 Reads a legacy VTK file. More...
 
class  VTKDataSetReaderBase
 
class  VTKDataSetWriter
 Reads a legacy VTK file. More...
 
class  VTKPolyDataReader
 
class  VTKRectilinearGridReader
 
class  VTKStructuredGridReader
 
class  VTKStructuredPointsReader
 
class  VTKUnstructuredGridReader
 
class  VTKVisItFileReader
 Reader for ".visit" files, a simple file format for partioned data sets. More...
 

Typedefs

using RGBPixel_8 = RGBPixel< 8 >
 
using RGBPixel_16 = RGBPixel< 16 >
 
using GreyPixel_16 = GreyPixel< 16 >
 
using GreyPixel_8 = GreyPixel< 8 >
 

Enumerations

enum  FileType { FileType::ASCII, FileType::BINARY }
 

Functions

vtkm::UInt32 DecodePNG (std::vector< unsigned char > &out_image, unsigned long &image_width, unsigned long &image_height, const unsigned char *in_png, std::size_t in_size)
 Decodes a PNG file buffer in memory, into a raw pixel buffer Output is RGBA 32-bit (8 bit per channel) color format no matter what color type the original PNG image had. More...
 
vtkm::UInt32 EncodePNG (std::vector< unsigned char > const &image, unsigned long width, unsigned long height, unsigned char *out_png, std::size_t out_size)
 
vtkm::UInt32 SavePNG (std::string const &filename, std::vector< unsigned char > const &image, unsigned long width, unsigned long height)
 
bool EndsWith (const std::string &value, const std::string &ending)
 Checks if a provided string ends with a specific substring. More...
 
std::string Filename (const std::string &filePath)
 Returns the filename component of a filePath string. More...
 
std::string ParentPath (const std::string &filePath)
 Returns the directory component of a filePath string. More...
 
bool CreateDirectoriesFromFilePath (const std::string &filePath)
 Creates all the directories found in a given filePath component if they don't exist. More...
 
std::string MergePaths (const std::string &filePathPrefix, const std::string &filePathSuffix)
 Merges two filepath strings together using the correct system filepath seperator EX: MergePaths("path/to/merge", "some/filename.txt") = "path/to/merge/some/filename.txt" EX: MergePaths("path/to/merge/", "/some/filename.txt") = "path/to/merge/some/filename.txt". More...
 
std::string PrefixStringToFilename (const std::string &filePath, const std::string &prefix)
 Takes the supplied prefix and prepends it to the filename for the provided filePath EX: PrefixStringToFilename("/some/path/to/filename.txt", "prefix-") = "/some/path/to/prefix-filename.txt". More...
 
char GetWindowsPathSeperator (const std::string &filePath)
 determine which path separator to use for windows given a provided path Should return one of either '\' or '/' depending on what the provided path uses. More...
 
void WriteImageFile (const vtkm::cont::DataSet &dataSet, const std::string &fullPath, const std::string &fieldName)
 
vtkm::cont::DataSet ReadImageFile (const std::string &fullPath, const std::string &fieldName)
 

Detailed Description

VTK-m File input and output classes.

vtkm::io defines API for basic reading of VTK files. Intended to be used for examples and testing.

Typedef Documentation

◆ GreyPixel_16

using vtkm::io::GreyPixel_16 = typedef GreyPixel<16>

◆ GreyPixel_8

using vtkm::io::GreyPixel_8 = typedef GreyPixel<8>

◆ RGBPixel_16

using vtkm::io::RGBPixel_16 = typedef RGBPixel<16>

◆ RGBPixel_8

using vtkm::io::RGBPixel_8 = typedef RGBPixel<8>

Enumeration Type Documentation

◆ FileType

enum vtkm::io::FileType
strong
Enumerator
ASCII 
BINARY 

Function Documentation

◆ CreateDirectoriesFromFilePath()

bool vtkm::io::CreateDirectoriesFromFilePath ( const std::string &  filePath)

Creates all the directories found in a given filePath component if they don't exist.

Only returns true if directories are actually created.

◆ DecodePNG()

vtkm::UInt32 vtkm::io::DecodePNG ( std::vector< unsigned char > &  out_image,
unsigned long &  image_width,
unsigned long &  image_height,
const unsigned char *  in_png,
std::size_t  in_size 
)

Decodes a PNG file buffer in memory, into a raw pixel buffer Output is RGBA 32-bit (8 bit per channel) color format no matter what color type the original PNG image had.

This gives predictable, usable data from any random input PNG.

◆ EncodePNG()

vtkm::UInt32 vtkm::io::EncodePNG ( std::vector< unsigned char > const &  image,
unsigned long  width,
unsigned long  height,
unsigned char *  out_png,
std::size_t  out_size 
)

◆ EndsWith()

bool vtkm::io::EndsWith ( const std::string &  value,
const std::string &  ending 
)

Checks if a provided string ends with a specific substring.

◆ Filename()

std::string vtkm::io::Filename ( const std::string &  filePath)

Returns the filename component of a filePath string.

Mimics the functionality of the c++17 filesystem::path filename function

◆ GetWindowsPathSeperator()

char vtkm::io::GetWindowsPathSeperator ( const std::string &  filePath)

determine which path separator to use for windows given a provided path Should return one of either '\' or '/' depending on what the provided path uses.

If no seperator is found it will just return '\'

◆ MergePaths()

std::string vtkm::io::MergePaths ( const std::string &  filePathPrefix,
const std::string &  filePathSuffix 
)

Merges two filepath strings together using the correct system filepath seperator EX: MergePaths("path/to/merge", "some/filename.txt") = "path/to/merge/some/filename.txt" EX: MergePaths("path/to/merge/", "/some/filename.txt") = "path/to/merge/some/filename.txt".

◆ ParentPath()

std::string vtkm::io::ParentPath ( const std::string &  filePath)

Returns the directory component of a filePath string.

Mimics the functionality of the c++17 filesystem::path parent_path function

◆ PrefixStringToFilename()

std::string vtkm::io::PrefixStringToFilename ( const std::string &  filePath,
const std::string &  prefix 
)

Takes the supplied prefix and prepends it to the filename for the provided filePath EX: PrefixStringToFilename("/some/path/to/filename.txt", "prefix-") = "/some/path/to/prefix-filename.txt".

◆ ReadImageFile()

vtkm::cont::DataSet vtkm::io::ReadImageFile ( const std::string &  fullPath,
const std::string &  fieldName 
)

◆ SavePNG()

vtkm::UInt32 vtkm::io::SavePNG ( std::string const &  filename,
std::vector< unsigned char > const &  image,
unsigned long  width,
unsigned long  height 
)

◆ WriteImageFile()

void vtkm::io::WriteImageFile ( const vtkm::cont::DataSet dataSet,
const std::string &  fullPath,
const std::string &  fieldName 
)