Image Utilities (IU)
|
The OpenEXRInputFile class interfaces the OpenEXR library with the Imageutilities. More...
#include <openexrio.h>
Data Structures | |
struct | Channel |
The Channel struct contains the name (string) and datatype (string) of a channel. More... | |
Public Member Functions | |
OpenEXRInputFile (const std::string &filename) | |
OpenEXRInputFile constructor. Opens a file for reading. More... | |
iu::Size< 2 > | get_size () |
return size of the OpenEXR image More... | |
std::vector< Channel > | get_channels () |
Get a list of all channels in the file. More... | |
std::vector< std::string > | get_attributes () |
Get a list of all attributes (attachements) in the file. More... | |
void | read_channel (const std::string &name, ImageCpu_32u_C1 &img) |
Search for a channel name and read its contents into img . The size of img must match the size returned by get_size. More... | |
void | read_channel (const std::string &name, ImageCpu_32f_C1 &img) |
Search for a channel name and read its contents into img . The size of img must match the size returned by get_size. More... | |
void | read_channel_32f (const std::string &name, ImageCpu_32f_C1 &img) |
Convenience function to read into a float image regardless of channel data. If the channel contains uint32 data, it will be converted to float. More... | |
void | read_channel (const std::string &name, ImageGpu_32u_C1 &img) |
read directly to a GPU-image More... | |
void | read_channel (const std::string &name, ImageGpu_32f_C1 &img) |
read directly to a GPU-image More... | |
void | read_channel_32f (const std::string &name, ImageGpu_32f_C1 &img) |
Convenience function to read into a GPU float image regardless of channel data. If the channel contains uint32 data, it will be converted to float. More... | |
void | read_attribute (const std::string &name, Eigen::Ref< Eigen::Matrix3f > mat) |
Read a 3x3 matrix attribute into an Eigen::Matrix3f. More... | |
void | read_attribute (const std::string &name, Eigen::Ref< Eigen::Matrix4f > mat) |
Read a 4x4 matrix attribute into an Eigen::Matrix4f. More... | |
The OpenEXRInputFile class interfaces the OpenEXR library with the Imageutilities.
After construction various information (image size, channels, attributes) can be queried which allows to construct the corresponding ImageCpu* variables needed to call the read_channel method. convenience methods to read directly to GPU-images are provided as well.
iu::OpenEXRInputFile::OpenEXRInputFile | ( | const std::string & | filename | ) |
OpenEXRInputFile constructor. Opens a file for reading.
filename | name of the file. |
std::vector<std::string> iu::OpenEXRInputFile::get_attributes | ( | ) |
Get a list of all attributes (attachements) in the file.
|
inline |
Get a list of all channels in the file.
|
inline |
return size of the OpenEXR image
void iu::OpenEXRInputFile::read_attribute | ( | const std::string & | name, |
Eigen::Ref< Eigen::Matrix3f > | mat | ||
) |
Read a 3x3 matrix attribute into an Eigen::Matrix3f.
name | attribute name (must be a 3x3 matrix) |
mat | Ref to Eigen::Matrix3f |
void iu::OpenEXRInputFile::read_attribute | ( | const std::string & | name, |
Eigen::Ref< Eigen::Matrix4f > | mat | ||
) |
Read a 4x4 matrix attribute into an Eigen::Matrix4f.
name | attribute name (must be a 4x4 matrix) |
mat | Ref to Eigen::Matrix4f |
void iu::OpenEXRInputFile::read_channel | ( | const std::string & | name, |
ImageCpu_32u_C1 & | img | ||
) |
void iu::OpenEXRInputFile::read_channel | ( | const std::string & | name, |
ImageCpu_32f_C1 & | img | ||
) |
void iu::OpenEXRInputFile::read_channel | ( | const std::string & | name, |
ImageGpu_32u_C1 & | img | ||
) |
read directly to a GPU-image
name | name of the channel containing uint32 data |
img | A GPU-image whose size matches that returned by get_size |
void iu::OpenEXRInputFile::read_channel | ( | const std::string & | name, |
ImageGpu_32f_C1 & | img | ||
) |
read directly to a GPU-image
name | name of the channel containing float data |
img | A GPU-image whose size matches that returned by get_size |
void iu::OpenEXRInputFile::read_channel_32f | ( | const std::string & | name, |
ImageCpu_32f_C1 & | img | ||
) |
Convenience function to read into a float image regardless of channel data. If the channel contains uint32 data, it will be converted to float.
name | name of the channel |
img | An image whose size matches that returned by get_size |
void iu::OpenEXRInputFile::read_channel_32f | ( | const std::string & | name, |
ImageGpu_32f_C1 & | img | ||
) |
Convenience function to read into a GPU float image regardless of channel data. If the channel contains uint32 data, it will be converted to float.
name | name of the channel |
img | A GPU-image whose size matches that returned by get_size |