Inviwo  0.9.10.1
Inviwo documentation
inviwo::cimgutil Namespace Reference

Classes

struct  TIFFHeader
 

Enumerations

enum  InterpolationType : int {
  RawMemory = -1, NoInterpolation = 0, Nearest = 1, Moving = 2,
  Linear = 3, Grid = 4, Cubic = 5, Lanczos = 6
}
 
enum  TIFFResolutionUnit { None, Inch, Centimeter }
 

Functions

template<typename T >
std::vector< unsigned char > saveCImgToBuffer (const cimg_library::CImg< T > &img, const std::string &ext)
 
template<typename T >
const cimg_library::CImg< T > & saveCImgToFileStream (FILE *handle, const cimg_library::CImg< T > &img, const std::string &ext)
 
IVW_MODULE_CIMG_API TIFFHeader getTIFFHeader (const std::string &filename)
 
IVW_MODULE_CIMG_API void * loadLayerData (void *dst, const std::string &filePath, uvec2 &out_dim, DataFormatId &formatId, bool rescaleToDim=false)
 
IVW_MODULE_CIMG_API void * loadVolumeData (void *dst, const std::string &filePath, size3_t &out_dim, DataFormatId &formatId)
 
IVW_MODULE_CIMG_API void saveLayer (const std::string &filePath, const Layer *inputImage)
 
IVW_MODULE_CIMG_API std::unique_ptr< std::vector< unsigned char > > saveLayerToBuffer (const std::string &extension, const Layer *inputImage)
 
void * loadTIFFLayerData (void *dst, const std::string &filePath, TIFFHeader header, bool rescaleToDim=false)
 
void * loadTIFFVolumeData (void *dst, const std::string &filePath, TIFFHeader header)
 
IVW_MODULE_CIMG_API void * rescaleLayer (const Layer *inputLayer, uvec2 dst_dim)
 Rescales Layer of given image data. More...
 
IVW_MODULE_CIMG_API void * rescaleLayerRAM (const LayerRAM *layerRam, uvec2 dst_dim)
 Rescales LayerRAM representation uses FILTER_BILINEAR by default. More...
 
IVW_MODULE_CIMG_API bool rescaleLayerRamToLayerRam (const LayerRAM *source, LayerRAM *target)
 
IVW_MODULE_CIMG_API std::string getLibJPGVersion ()
 
IVW_MODULE_CIMG_API std::string getOpenEXRVersion ()
 

Variables

std::unordered_map< std::string, DataFormatId > extToBaseTypeMap_
 

Detailed Description

cimgutil

Function Documentation

◆ loadLayerData()

void * inviwo::cimgutil::loadLayerData ( void *  dst,
const std::string &  filePath,
uvec2 &  out_dim,
DataFormatId &  formatId,
bool  rescaleToDim = false 
)

Loads layer data from a specified filePath.

◆ loadTIFFLayerData()

void * inviwo::cimgutil::loadTIFFLayerData ( void *  dst,
const std::string &  filePath,
TIFFHeader  header,
bool  rescaleToDim = false 
)

Load TIFF image data.

See also
TIFFLayerReader
getTIFFHeader

◆ loadTIFFVolumeData()

void * inviwo::cimgutil::loadTIFFVolumeData ( void *  dst,
const std::string &  filePath,
TIFFHeader  header 
)

Load TIFF stack as volume.

See also
TIFFStackVolumeRAMLoader
getTIFFHeader

◆ loadVolumeData()

void * inviwo::cimgutil::loadVolumeData ( void *  dst,
const std::string &  filePath,
size3_t &  out_dim,
DataFormatId &  formatId 
)

Loads volume data from a specified filePath.

◆ rescaleLayer()

void * inviwo::cimgutil::rescaleLayer ( const Layer inputLayer,
uvec2  dst_dim 
)

Rescales Layer of given image data.

Parameters
inputLayerimage data that needs to be rescaled
dst_dimis destination dimensions
Returns
rescaled raw data

◆ rescaleLayerRAM()

void * inviwo::cimgutil::rescaleLayerRAM ( const LayerRAM layerRam,
uvec2  dst_dim 
)

Rescales LayerRAM representation uses FILTER_BILINEAR by default.

Parameters
layerRamrepresentation that needs rescaling
dst_dimis destination dimensions
Returns
rescaled raw data

◆ saveLayer()

void inviwo::cimgutil::saveLayer ( const std::string &  filePath,
const Layer inputImage 
)

Saves an layer of an image to a specified filename.

Parameters
filePaththe path including filename and extension, which is used to determine the image format
inputImagespecifies the image that is to be saved.

◆ saveLayerToBuffer()

std::unique_ptr< std::vector< unsigned char > > inviwo::cimgutil::saveLayerToBuffer ( const std::string &  extension,
const Layer inputImage 
)

Saves an layer of an unsigned char buffer.

Parameters
extensionspecifies the output image format
inputImagespecifies the image that is to be saved.

Variable Documentation

◆ extToBaseTypeMap_

std::unordered_map<std::string, DataFormatId> inviwo::cimgutil::extToBaseTypeMap_
Initial value:
= {{"jpg", DataFormatId::UInt8},
{"jpeg", DataFormatId::UInt8},
{"bmp", DataFormatId::UInt8},
{"exr", DataFormatId::Float32},
{"hdr", DataFormatId::Float32}}