SyB3R - Synthetic Benchmark for 3D Reconstruction
Public Member Functions | Protected Attributes | List of all members
syb3r::tools::FloatImage< Type > Class Template Reference

Stores an image with arbitrary, usually float based, pixel values. More...

#include <libs/Common/source/syb3r/tools/FloatImage.h>

Public Member Functions

void resize (unsigned w, unsigned h)
 Allocate memory for w times h pixels. More...
 
unsigned getHeight () const
 Returns number or rows in the image.
 
unsigned getWidth () const
 Returns number of columns in the image.
 
Type & operator[] (unsigned idx)
 Direct access to the row major data.
 
const Type & operator[] (unsigned idx) const
 Direct access to the row major data.
 
Type & operator() (unsigned x, unsigned y)
 Access to a single pixel.
 
const Type & operator() (unsigned x, unsigned y) const
 Access to a single pixel.
 
template<typename OtherType , class BinaryOp >
const FloatImage< Type > & performBinaryOp (const FloatImage< OtherType > &rhs, BinaryOp op)
 Helper function for binary operations.
 
template<class UnaryOp >
const FloatImage< Type > & performUnaryOp (UnaryOp op)
 Helper function for unary operations.
 
template<typename OtherType >
const FloatImage< Type > & operator-= (const FloatImage< OtherType > &rhs)
 
template<typename OtherType >
const FloatImage< Type > & operator+= (const FloatImage< OtherType > &rhs)
 
template<typename OtherType >
const FloatImage< Type > & operator*= (const FloatImage< OtherType > &rhs)
 
template<typename OtherType >
const FloatImage< Type > & operator/= (const FloatImage< OtherType > &rhs)
 
template<typename OtherType >
const FloatImage< Type > & operator*= (const OtherType &factor)
 
template<typename OtherType >
const FloatImage< Type > & operator+= (const OtherType &factor)
 
void subsample (const FloatImage< Type > &other, unsigned stride)
 Copys every n-th row and every n-th column. More...
 
Type sampleLinear (float x, float y) const
 Samples from a float coordinate, using bilinear interpolation. More...
 
template<typename scalarType >
scalarType sampleLinearChannel (float x, float y, unsigned channel) const
 Samples a single channel from a float coordinate, using bilinear interpolation. More...
 
void swap (FloatImage< Type > &other)
 

Protected Attributes

unsigned m_width = 0
 
unsigned m_height = 0
 
std::vector< Type > m_data
 

Detailed Description

template<typename Type>
class syb3r::tools::FloatImage< Type >

Stores an image with arbitrary, usually float based, pixel values.

If instantiated with Eigen::Vector3f, this class features the most basic tools for manipulating RGB32F images.

Member Function Documentation

template<typename Type>
void syb3r::tools::FloatImage< Type >::resize ( unsigned  w,
unsigned  h 
)
inline

Allocate memory for w times h pixels.

The content does not get rescaled.

template<typename Type>
Type syb3r::tools::FloatImage< Type >::sampleLinear ( float  x,
float  y 
) const
inline

Samples from a float coordinate, using bilinear interpolation.

Note
Keep in mind that the first pixel spans the x/y range of 0..1 and thus has it's center at 0.5, not at zero!
template<typename Type>
template<typename scalarType >
scalarType syb3r::tools::FloatImage< Type >::sampleLinearChannel ( float  x,
float  y,
unsigned  channel 
) const
inline

Samples a single channel from a float coordinate, using bilinear interpolation.

Note
Keep in mind that the first pixel spans the x/y range of 0..1 and thus has it's center at 0.5, not at zero!
template<typename Type>
void syb3r::tools::FloatImage< Type >::subsample ( const FloatImage< Type > &  other,
unsigned  stride 
)
inline

Copys every n-th row and every n-th column.

No box filtering or anything, just sub sampling.


The documentation for this class was generated from the following file: