PICCANTE  0.4
The hottest HDR imaging library!
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
pic::Image Class Reference

The Image class stores an image as buffer of float. More...

#include <image.hpp>

Public Member Functions

 Image ()
 the basic construct of an Image More...
 
 Image (Image *imgIn, bool deepCopy)
 Image embeds an existing image in the new image. More...
 
 Image (std::string nameFile, LDR_type typeLoad)
 Image loads an Image from a file on the disk. More...
 
 Image (int width, int height, int channels)
 Image creates an Image with a given size. More...
 
 Image (float *color, int channels)
 Image embeds an array of float inside an Image. More...
 
 Image (int frames, int width, int height, int channels, float *data)
 Image is a constructor which initializes an image defined by the input properties. More...
 
 ~Image ()
 Image destructor. This deallocates: data, dataUC, and dataRGBE. More...
 
void allocate (int width, int height, int channels, int frames)
 allocate allocates memory for the pixel buffer. More...
 
void allocateAux ()
 allocateAux computes extra information after allocation; e.g. strides. More...
 
void release ()
 release frees allocated buffers. More...
 
void copySubImage (Image *imgIn, int startX, int startY)
 copySubImage copies imgIn in the current image. The current image is written from (startX, startY). More...
 
void scaleCosine ()
 scaleCosine multiplies the current image by the vertical cosine assuming a longitude-latitude image. More...
 
void flipH ()
 FlipH flips horizontally the current image. More...
 
void flipV ()
 FlipV flips vertically the current image. More...
 
void flipHV ()
 flipHV flips horizontally and vertically the current image. More...
 
void flipVH ()
 flipVH flips vertically and horizontally the current image. More...
 
void rotate90CCW ()
 rotate90CCW rotates 90 degrees counter-clockwise the current image. More...
 
void rotate90CW ()
 rotate90CW rotates 90 degrees clockwise the current image. More...
 
float getDiagonalSize ()
 getDiagonalSize More...
 
void setZero ()
 setZero sets data to 0.0f. More...
 
void setRand (unsigned int seed)
 setRand More...
 
bool isValid ()
 isValid checks if the current image is valid, which means if they have an allocated buffer or not. More...
 
bool isSimilarType (const Image *img)
 isSimilarType checks if the current image is similar to img; i.e. if they have the same width, height, frames, and channels. More...
 
void assign (const Image *imgIn)
 assign More...
 
void blend (Image *img, Image *weight)
 blend More...
 
void minimum (Image *img)
 minimum is the minimum operator for Image. More...
 
void maximum (Image *img)
 maximum is the maximum operator for Image. More...
 
void applyFunction (float(*func)(float))
 applyFunction is an operator that applies an input function to all values in data. More...
 
void applyFunctionParam (float(*func)(float, std::vector< float > &), std::vector< float > &param)
 applyFunctionParam More...
 
BBox getFullBox ()
 getFullBox computes a full BBox for this image. More...
 
float * getMaxVal (BBox *box, float *ret)
 getMaxVal computes the maximum value for the current Image. More...
 
float * getMinVal (BBox *box, float *ret)
 getMinVal computes the minimum value for the current Image. More...
 
float * getLogMeanVal (BBox *box, float *ret)
 getLogMeanVal computes the log mean for the current Image. More...
 
float * getSumVal (BBox *box, float *ret)
 getSumVal sums values for the current Image. More...
 
float * getMeanVal (BBox *box, float *ret)
 getMeanVal computes the mean for the current Image. More...
 
float * getMomentsVal (int x0, int y0, int radius, float *ret)
 getMomentsVal computes the moments at pixel (x0, y0). More...
 
float * getVarianceVal (float *meanVal, BBox *box, float *ret)
 getVarianceVal computes the variance for the current Image. More...
 
float * getCovMtxVal (float *meanVal, BBox *box, float *ret)
 getCovMtxVal computes the convariance matrix for the current Image. More...
 
float * getPercentileVal (float percentile, BBox *box, float *ret)
 getPercentileVal computes the n-th value given a percentile. More...
 
float * getMedVal (BBox *box, float *ret)
 getPercentileVal computes the median value value given a percentile. More...
 
float getDynamicRange (bool bRobust, float percentile)
 getDynamicRange computes the dynamic range of the image. More...
 
unsigned char * getdataUC ()
 getdataUC More...
 
float * getColorSamples (float *samples, int &nSamples, float percentage)
 getColorSamples More...
 
int size () const
 size computes the number of values. More...
 
int sizeFrame () const
 size computes the number of values. More...
 
int nPixels () const
 nPixels computes the number of pixels. More...
 
bool checkCoordinates (int x, int y, int z=0)
 checkCoordinates checks (x, y, z) coordinates) if they are valid or not. More...
 
void convertFromMask (bool *mask, int width, int height)
 convertFromMask converts a boolean mask into an Image. true is mapped to 1.0f, and false is mapped to 0.0f. More...
 
bool * convertToMask (float *color, float threshold, bool cmp, bool *mask)
 convertToMask converts an Image into a boolean mask. More...
 
bool getFlippedEXR ()
 getFlippedEXR returns the flippedEXR flag. More...
 
void removeSpecials ()
 removeSpecials removes NaN and +/-Inf values and sets them to 0.0f. More...
 
void clamp (float a, float b)
 clamp set data values in the range [a,b] More...
 
void calculateStrides ()
 calculateStrides computes the strides values for pixels, lines and frames. More...
 
float * operator() (int x, int y, int t)
 operator () returns a pointer to a pixel at (x, y, t) More...
 
float * operator() (int x, int y)
 operator () returns a pointer to a pixel at (x, y) More...
 
float * operator() (float x, float y)
 operator () returns a pointer to a pixel at (x, y) with normalized coordinates (values in [0, 1]). More...
 
float * getLL (float x, float y, float z)
 getLL returns a pointer to a pixel given a normalized direction and assuming longituted-latitude mapping of the image. More...
 
void getNormalizedCoords (int x, int y, float &nx, float &ny)
 getNormalizedCoords computes normalized coordinates (nx, ny) of (x, y). More...
 
int getAddress (int x, int y)
 getAddress calculates a memory address from (x, y) More...
 
int getAddress (int x, int y, int t)
 getAddress calculates a memory address from (x, y, t) More...
 
void reverseAddress (int ind, int &x, int &y)
 reverseAddress computes (x, y) given a memory address More...
 
ImageallocateSimilarOne ()
 allocateSimilarOne creates an Image with similar size of the calling instance. More...
 
void allocateSimilarTo (Image *img)
 allocateSimilarTo allocate an Image with similar size of the passed by. More...
 
Imageclone () const
 Clone creates a deep copy of the calling instance. More...
 
bool Read (std::string nameFile, LDR_type typeLoad)
 Read opens an Image from a file on the disk. More...
 
bool Write (std::string nameFile, LDR_type typeWrite, int writerCounter)
 Write saves an Image into a file on the disk. More...
 
void changeOwnership (bool notOwned)
 changeOwnership More...
 
void operator= (const Image &a)
 operator = More...
 
void operator= (const float &a)
 operator = More...
 
void operator+= (const float &a)
 operator += More...
 
Image operator+ (const float &a) const
 operator + More...
 
void operator+= (const Image &a)
 operator += More...
 
Image operator+ (const Image &a) const
 operator + More...
 
void operator*= (const float &a)
 operator *= More...
 
Image operator* (const float &a) const
 operator * More...
 
void operator*= (const Image &a)
 operator *= More...
 
Image operator* (const Image &a) const
 operator * More...
 
void operator-= (const float &a)
 operator -= More...
 
Image operator- (const float &a) const
 operator - More...
 
void operator-= (const Image &a)
 operator -= More...
 
Image operator- (const Image &a) const
 operator - More...
 
void operator/= (const float &a)
 operator /= More...
 
Image operator/ (const float &a) const
 operator / More...
 
void operator/= (const Image &a)
 operator /= More...
 
Image operator/ (const Image &a) const
 operator / More...
 
float * sort ()
 sort More...
 

Public Attributes

float exposure
 
int width
 
int height
 
int channels
 
int frames
 
int depth
 
int alpha
 
int tstride
 
int ystride
 
int xstride
 
float widthf
 
float width1f
 
float heightf
 
float height1f
 
float channelsf
 
float framesf
 
float frames1f
 
std::string nameFile
 
float * data
 data is the main buffer where pixel values are stored. More...
 
unsigned char * dataUC
 dataUC is a buffer for rendering 8-bit images. More...
 
unsigned char * dataRGBE
 dataRGBE is a buffer for rendering RGBE encoded images. More...
 

Protected Member Functions

void setNULL ()
 setNULL sets buffers values to NULL. More...
 

Protected Attributes

bool flippedEXR
 
int readerCounter
 
bool notOwned
 
BBox fullBox
 
LDR_type typeLoad
 

Detailed Description

The Image class stores an image as buffer of float.

Constructor & Destructor Documentation

◆ Image() [1/6]

pic::Image::Image ( )

the basic construct of an Image

◆ Image() [2/6]

pic::Image::Image ( Image imgIn,
bool  deepCopy 
)

Image embeds an existing image in the new image.

Parameters
imgInis the input image to embed.
deepCopyenables a deep copy of img into this.

◆ Image() [3/6]

pic::Image::Image ( std::string  nameFile,
LDR_type  typeLoad 
)

Image loads an Image from a file on the disk.

Parameters
nameFileis the file name.
typeLoadis an option for LDR images only: LT_NOR means that the input image values will be normalized in [0,1]. LT_NOR_GAMMA means that the input image values will be normalized in [0,1], and gamma correction 2.2 will be removed. LT_NONE means that image values are not modified during the loading.

The default value is LT_NOR_GAMMA assuming that we are storing normalized and linearized values in Image.

◆ Image() [4/6]

pic::Image::Image ( int  width,
int  height,
int  channels 
)

Image creates an Image with a given size.

Parameters
widthis the horizontal size in pixels.
heightis the vertical size in pixels.
channelsis the number of color channels.

◆ Image() [5/6]

pic::Image::Image ( float *  color,
int  channels 
)

Image embeds an array of float inside an Image.

Parameters
coloris the pointer to an array of float values.
channelsis the color's number of elements.

◆ Image() [6/6]

pic::Image::Image ( int  frames,
int  width,
int  height,
int  channels,
float *  data 
)

Image is a constructor which initializes an image defined by the input properties.

Parameters
framesis the number of temporal pixels.
widthis the number of horizontal pixels.
heightis the number of vertical pixels.
channelsis the number of color channels.
datais a buffer of size frames * width * height * channels. If it is empty (set to NULL) a new buffer will be created.

◆ ~Image()

pic::Image::~Image ( )

Image destructor. This deallocates: data, dataUC, and dataRGBE.

Member Function Documentation

◆ allocate()

void pic::Image::allocate ( int  width,
int  height,
int  channels,
int  frames 
)

allocate allocates memory for the pixel buffer.

Parameters
widthis the number of horizontal pixels.
heightis the number of vertical pixels.
channelsis the number of color channels.
framesis the number of temporal pixels.

◆ allocateAux()

void pic::Image::allocateAux ( )

allocateAux computes extra information after allocation; e.g. strides.

◆ allocateSimilarOne()

Image* pic::Image::allocateSimilarOne ( )

allocateSimilarOne creates an Image with similar size of the calling instance.

Returns
This returns an Image with the same size of the calling instance.

◆ allocateSimilarTo()

void pic::Image::allocateSimilarTo ( Image img)

allocateSimilarTo allocate an Image with similar size of the passed by.

◆ applyFunction()

void pic::Image::applyFunction ( float(*)(float)  func)

applyFunction is an operator that applies an input function to all values in data.

◆ applyFunctionParam()

void pic::Image::applyFunctionParam ( float(*)(float, std::vector< float > &)  func,
std::vector< float > &  param 
)

applyFunctionParam

Parameters
param

◆ assign()

void pic::Image::assign ( const Image imgIn)

assign

Parameters
imgIn

◆ blend()

void pic::Image::blend ( Image img,
Image weight 
)

blend

Parameters
img
weight

◆ calculateStrides()

void pic::Image::calculateStrides ( )
inline

calculateStrides computes the strides values for pixels, lines and frames.

◆ changeOwnership()

void pic::Image::changeOwnership ( bool  notOwned)
inline

changeOwnership

Parameters
notOwned

◆ checkCoordinates()

bool pic::Image::checkCoordinates ( int  x,
int  y,
int  z = 0 
)
inline

checkCoordinates checks (x, y, z) coordinates) if they are valid or not.

Parameters
xis the horizontal coordinate.
yis the vertical coordinate.
zis the temporal coordinate.
Returns
This function returns true if the coordinates are inside the bounding box of the Image.

◆ clamp()

void pic::Image::clamp ( float  a,
float  b 
)

clamp set data values in the range [a,b]

Parameters
athe minimum value.
bthe maximum value.

◆ clone()

Image* pic::Image::clone ( ) const

Clone creates a deep copy of the calling instance.

Returns
This returns a deep copy of the calling instance.

◆ convertFromMask()

void pic::Image::convertFromMask ( bool *  mask,
int  width,
int  height 
)

convertFromMask converts a boolean mask into an Image. true is mapped to 1.0f, and false is mapped to 0.0f.

Parameters
maskis a buffer of boolean values with (width * height) elements.
widthis the horizontal number of pixels.
heightis the vertical number of pixels.

◆ convertToMask()

bool* pic::Image::convertToMask ( float *  color,
float  threshold,
bool  cmp,
bool *  mask 
)

convertToMask converts an Image into a boolean mask.

Parameters
color
threshold
cmp
mask
Returns

◆ copySubImage()

void pic::Image::copySubImage ( Image imgIn,
int  startX,
int  startY 
)

copySubImage copies imgIn in the current image. The current image is written from (startX, startY).

Parameters
imgInthe image to be copied.
startXis the horizontal coordinate in pixels.
startYis the vertical coordinate in pixels.

◆ flipH()

void pic::Image::flipH ( )
inline

FlipH flips horizontally the current image.

◆ flipHV()

void pic::Image::flipHV ( )
inline

flipHV flips horizontally and vertically the current image.

◆ flipV()

void pic::Image::flipV ( )
inline

FlipV flips vertically the current image.

◆ flipVH()

void pic::Image::flipVH ( )
inline

flipVH flips vertically and horizontally the current image.

◆ getAddress() [1/2]

int pic::Image::getAddress ( int  x,
int  y 
)
inline

getAddress calculates a memory address from (x, y)

Parameters
xis the horizontal coordinate in pixels
yis the vertical coordinate in pixels
Returns
This function returns the memory address for (x, y)

◆ getAddress() [2/2]

int pic::Image::getAddress ( int  x,
int  y,
int  t 
)
inline

getAddress calculates a memory address from (x, y, t)

Parameters
xis the horizontal coordinate in pixels
yis the vertical coordinate in pixels
tis the temporal coordinate in pixels
Returns
This function returns the memory address for (x, y, t)

◆ getColorSamples()

float* pic::Image::getColorSamples ( float *  samples,
int &  nSamples,
float  percentage 
)

getColorSamples

Parameters
samples
percentage
Returns

◆ getCovMtxVal()

float* pic::Image::getCovMtxVal ( float *  meanVal,
BBox box,
float *  ret 
)

getCovMtxVal computes the convariance matrix for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getdataUC()

unsigned char* pic::Image::getdataUC ( )
inline

getdataUC

Returns

◆ getDiagonalSize()

float pic::Image::getDiagonalSize ( )
inline

getDiagonalSize

Returns

◆ getDynamicRange()

float pic::Image::getDynamicRange ( bool  bRobust,
float  percentile 
)

getDynamicRange computes the dynamic range of the image.

Parameters
bRobustis a value that enables robust computation of the dynamic range using percentile.
percentileis the percentile value used when computing the dynamic range in a robust way.
Returns

◆ getFlippedEXR()

bool pic::Image::getFlippedEXR ( )
inline

getFlippedEXR returns the flippedEXR flag.

Returns
This function returns the flippedEXR flag.

◆ getFullBox()

BBox pic::Image::getFullBox ( )

getFullBox computes a full BBox for this image.

Returns
This function returns a full BBox for this image.

◆ getLL()

float* pic::Image::getLL ( float  x,
float  y,
float  z 
)
inline

getLL returns a pointer to a pixel given a normalized direction and assuming longituted-latitude mapping of the image.

Parameters
xthe x-coordinate of the unit-vector
ythe y-coordinate of the unit-vector
zthe z-coordinate of the unit-vector
Returns
This function returns a pointer to data at location (x, y, z) that is normalized; i.e., sqrt(x^2+y^2+z^2) == 1.

◆ getLogMeanVal()

float* pic::Image::getLogMeanVal ( BBox box,
float *  ret 
)

getLogMeanVal computes the log mean for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getMaxVal()

float* pic::Image::getMaxVal ( BBox box,
float *  ret 
)

getMaxVal computes the maximum value for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getMeanVal()

float* pic::Image::getMeanVal ( BBox box,
float *  ret 
)

getMeanVal computes the mean for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getMedVal()

float* pic::Image::getMedVal ( BBox box,
float *  ret 
)

getPercentileVal computes the median value value given a percentile.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
percentileis the percentile.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getMinVal()

float* pic::Image::getMinVal ( BBox box,
float *  ret 
)

getMinVal computes the minimum value for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getMomentsVal()

float* pic::Image::getMomentsVal ( int  x0,
int  y0,
int  radius,
float *  ret 
)

getMomentsVal computes the moments at pixel (x0, y0).

Parameters
x0is the horizontal coordinate.
y0is the vertical coordinate.
radiusis the radius of the patch.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getNormalizedCoords()

void pic::Image::getNormalizedCoords ( int  x,
int  y,
float &  nx,
float &  ny 
)
inline

getNormalizedCoords computes normalized coordinates (nx, ny) of (x, y).

Parameters
xis the horizontal coordinate in pixels
yis the vertical coordinate in pixels
nxis the horizontal coordinate in [0, 1]
nyis the vertical coordinate in [0, 1]

◆ getPercentileVal()

float* pic::Image::getPercentileVal ( float  percentile,
BBox box,
float *  ret 
)

getPercentileVal computes the n-th value given a percentile.

Parameters
percentileis the percentile.
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
percentileis the percentile.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getSumVal()

float* pic::Image::getSumVal ( BBox box,
float *  ret 
)

getSumVal sums values for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ getVarianceVal()

float* pic::Image::getVarianceVal ( float *  meanVal,
BBox box,
float *  ret 
)

getVarianceVal computes the variance for the current Image.

Parameters
boxis the bounding box where to compute the function. If it is set to NULL the function will be computed on the entire image.
retis an array where the function computations are stored. If it is set to NULL an array will be allocated.
Returns
This function returns an array where the function computations are stored.

◆ isSimilarType()

bool pic::Image::isSimilarType ( const Image img)

isSimilarType checks if the current image is similar to img; i.e. if they have the same width, height, frames, and channels.

Parameters
imgis an input image
Returns
This function returns true if the two images are similar, otherwise false.

◆ isValid()

bool pic::Image::isValid ( )

isValid checks if the current image is valid, which means if they have an allocated buffer or not.

Returns
This function return true if the current Image is allocated, otherwise false.

◆ maximum()

void pic::Image::maximum ( Image img)

maximum is the maximum operator for Image.

Parameters
imgis a and Image and the operand. This and the current Image need to have the same width, height, and color channels.

◆ minimum()

void pic::Image::minimum ( Image img)

minimum is the minimum operator for Image.

Parameters
imgis a and Image and the operand. This and the current Image need to have the same width, height, and color channels.

◆ nPixels()

int pic::Image::nPixels ( ) const
inline

nPixels computes the number of pixels.

Returns
This function returns the number of pixels.

◆ operator()() [1/3]

float* pic::Image::operator() ( int  x,
int  y,
int  t 
)
inline

operator () returns a pointer to a pixel at (x, y, t)

Parameters
xis the horizontal coordinate in pixels
yis the vertical coordinate in pixels
tis the temporal coordinate in pixels
Returns
This function returns a pointer to data at location (x, y, t).

◆ operator()() [2/3]

float* pic::Image::operator() ( int  x,
int  y 
)
inline

operator () returns a pointer to a pixel at (x, y)

Parameters
xis the horizontal coordinate in pixels
yis the vertical coordinate in pixels
Returns
This function returns a pointer to data at location (x, y).

◆ operator()() [3/3]

float* pic::Image::operator() ( float  x,
float  y 
)
inline

operator () returns a pointer to a pixel at (x, y) with normalized coordinates (values in [0, 1]).

Parameters
xis the horizontal coordinate in pixels
yis the vertical coordinate in pixels
Returns
This function returns a pointer to data at location (x, y).

◆ operator*() [1/2]

Image pic::Image::operator* ( const float &  a) const

operator *

Parameters
a
Returns
it returns (this * a)

◆ operator*() [2/2]

Image pic::Image::operator* ( const Image a) const

operator *

Parameters
a
Returns
it returns (this * a)

◆ operator*=() [1/2]

void pic::Image::operator*= ( const float &  a)

operator *=

Parameters
a

◆ operator*=() [2/2]

void pic::Image::operator*= ( const Image a)

operator *=

Parameters
a

◆ operator+() [1/2]

Image pic::Image::operator+ ( const float &  a) const

operator +

Parameters
a
Returns
it returns (this + a)

◆ operator+() [2/2]

Image pic::Image::operator+ ( const Image a) const

operator +

Parameters
a
Returns
it returns (this + a)

◆ operator+=() [1/2]

void pic::Image::operator+= ( const float &  a)

operator +=

Parameters
a

◆ operator+=() [2/2]

void pic::Image::operator+= ( const Image a)

operator +=

Parameters
a

◆ operator-() [1/2]

Image pic::Image::operator- ( const float &  a) const

operator -

Parameters
a
Returns
it returns (this - a)

◆ operator-() [2/2]

Image pic::Image::operator- ( const Image a) const

operator -

Parameters
a
Returns
it returns (this - a)

◆ operator-=() [1/2]

void pic::Image::operator-= ( const float &  a)

operator -=

Parameters
a

◆ operator-=() [2/2]

void pic::Image::operator-= ( const Image a)

operator -=

Parameters
a

◆ operator/() [1/2]

Image pic::Image::operator/ ( const float &  a) const

operator /

Parameters
a
Returns
it returns (this / a)

◆ operator/() [2/2]

Image pic::Image::operator/ ( const Image a) const

operator /

Parameters
a
Returns
it returns (this / a)

◆ operator/=() [1/2]

void pic::Image::operator/= ( const float &  a)

operator /=

Parameters
a

◆ operator/=() [2/2]

void pic::Image::operator/= ( const Image a)

operator /=

Parameters
a

◆ operator=() [1/2]

void pic::Image::operator= ( const Image a)

operator =

Parameters
a

◆ operator=() [2/2]

void pic::Image::operator= ( const float &  a)

operator =

Parameters
a

◆ Read()

bool pic::Image::Read ( std::string  nameFile,
LDR_type  typeLoad 
)

Read opens an Image from a file on the disk.

Parameters
nameFileis the file name.
typeLoadis an option for LDR images only: LT_NOR means that the input image values will be normalized in [0,1]. LT_NOR_GAMMA means that the input image values will be normalized in [0,1], and gamma correction 2.2 will be removed. LT_NONE means that image values are not modified.

The default is LT_NOR_GAMMA assuming that we are storing normalized and linearized values in Image.

Returns
This returns true if the reading succeeds, false otherwise.

◆ release()

void pic::Image::release ( )

release frees allocated buffers.

◆ removeSpecials()

void pic::Image::removeSpecials ( )

removeSpecials removes NaN and +/-Inf values and sets them to 0.0f.

◆ reverseAddress()

void pic::Image::reverseAddress ( int  ind,
int &  x,
int &  y 
)
inline

reverseAddress computes (x, y) given a memory address

Parameters
indis the memory input address
xis the output horizontal coordinate for ind
yis the output vertical coordinate for ind

◆ rotate90CCW()

void pic::Image::rotate90CCW ( )
inline

rotate90CCW rotates 90 degrees counter-clockwise the current image.

◆ rotate90CW()

void pic::Image::rotate90CW ( )
inline

rotate90CW rotates 90 degrees clockwise the current image.

◆ scaleCosine()

void pic::Image::scaleCosine ( )

scaleCosine multiplies the current image by the vertical cosine assuming a longitude-latitude image.

◆ setNULL()

void pic::Image::setNULL ( )
protected

setNULL sets buffers values to NULL.

◆ setRand()

void pic::Image::setRand ( unsigned int  seed)

setRand

Parameters
seed

◆ setZero()

void pic::Image::setZero ( )

setZero sets data to 0.0f.

◆ size()

int pic::Image::size ( ) const
inline

size computes the number of values.

Returns
This function returns the number of values of the entire image.

◆ sizeFrame()

int pic::Image::sizeFrame ( ) const
inline

size computes the number of values.

Returns
This function returns the number of values of a frame.

◆ sort()

float* pic::Image::sort ( )
inline

sort

Returns

◆ Write()

bool pic::Image::Write ( std::string  nameFile,
LDR_type  typeWrite,
int  writerCounter 
)

Write saves an Image into a file on the disk.

Parameters
nameFileis the file name.
typeWriteis an option for LDR images only: LT_NOR means that Image ha normalized values and the output image values will be multiplied by 255 to have values in [0,255]. LT_NOR_GAMMA means that Image ha normalized and linearized values. The output image values will be gamma corrected (2.2) and multiplied by 255 to have values in [0,255]. LT_NONE means that Image values are the same of the output.

The default is LT_NOR_GAMMA assuming that we are storing normalized and linearized values in Image.

Parameters
writerCounteris the frame that we want to write on the disk in the case Image is a video. The default writerCounter value is 0.
Returns
This returns true if the writing succeeds, false otherwise.

Member Data Documentation

◆ alpha

int pic::Image::alpha

◆ channels

int pic::Image::channels

◆ channelsf

float pic::Image::channelsf

◆ data

float* pic::Image::data

data is the main buffer where pixel values are stored.

◆ dataRGBE

unsigned char* pic::Image::dataRGBE

dataRGBE is a buffer for rendering RGBE encoded images.

◆ dataUC

unsigned char* pic::Image::dataUC

dataUC is a buffer for rendering 8-bit images.

◆ depth

int pic::Image::depth

◆ exposure

float pic::Image::exposure

◆ flippedEXR

bool pic::Image::flippedEXR
protected

◆ frames

int pic::Image::frames

◆ frames1f

float pic::Image::frames1f

◆ framesf

float pic::Image::framesf

◆ fullBox

BBox pic::Image::fullBox
protected

◆ height

int pic::Image::height

◆ height1f

float pic::Image::height1f

◆ heightf

float pic::Image::heightf

◆ nameFile

std::string pic::Image::nameFile

◆ notOwned

bool pic::Image::notOwned
protected

◆ readerCounter

int pic::Image::readerCounter
protected

◆ tstride

int pic::Image::tstride

◆ typeLoad

LDR_type pic::Image::typeLoad
protected

◆ width

int pic::Image::width

◆ width1f

float pic::Image::width1f

◆ widthf

float pic::Image::widthf

◆ xstride

int pic::Image::xstride

◆ ystride

int pic::Image::ystride

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