Viskores  1.0
Classes | Typedefs | Enumerations | Functions
viskores::io Namespace Reference

Viskores 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 Viskores 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

viskores::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...
 
viskores::UInt32 EncodePNG (std::vector< unsigned char > const &image, unsigned long width, unsigned long height, unsigned char *out_png, std::size_t out_size)
 
viskores::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 viskores::cont::DataSet &dataSet, const std::string &fullPath, const std::string &fieldName)
 
viskores::cont::DataSet ReadImageFile (const std::string &fullPath, const std::string &fieldName)
 

Detailed Description

Viskores File input and output classes.

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

Typedef Documentation

◆ GreyPixel_16

◆ GreyPixel_8

◆ RGBPixel_16

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

◆ RGBPixel_8

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

Enumeration Type Documentation

◆ FileType

Enumerator
ASCII 
BINARY 

Function Documentation

◆ CreateDirectoriesFromFilePath()

bool viskores::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()

viskores::UInt32 viskores::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()

viskores::UInt32 viskores::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 viskores::io::EndsWith ( const std::string &  value,
const std::string &  ending 
)

Checks if a provided string ends with a specific substring.

◆ Filename()

std::string viskores::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 viskores::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 viskores::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 viskores::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 viskores::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()

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

◆ SavePNG()

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

◆ WriteImageFile()

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