Atoms Crowd  7.0.0
AtomsUtils::Image Class Reference

Image class. More...

#include <Image.h>

Public Types

enum  ImageType { kByte = 0 , kFloat }
 

Public Member Functions

 Image ()
 Constructor.
 
 Image (unsigned int width, unsigned int height, unsigned int channel, unsigned short imgType)
 Constructor. More...
 
 Image (float *data, unsigned int width, unsigned int height, unsigned int channel)
 Constructor. More...
 
 Image (unsigned char *data, unsigned int width, unsigned int height, unsigned int channel)
 Constructor. More...
 
 Image (std::vector< float > data, unsigned int width, unsigned int height, unsigned int channel)
 Constructor. More...
 
 Image (std::vector< unsigned char > data, unsigned int width, unsigned int height, unsigned int channel)
 Constructor. More...
 
 ~Image ()
 Destructor.
 
 Image (const Image &other)
 Copy constructor.
 
Imageoperator= (const Image &other)
 Assign operator.
 
unsigned short imageType () const
 Get Image type.
 
unsigned int width () const
 Get image width.
 
unsigned int height () const
 Get image height.
 
unsigned int channels () const
 Get number of channels.
 
const float * pixelsFloat () const
 Get float pixels data.
 
float * pixelsFloat ()
 Get float pixels data.
 
const unsigned char * pixels () const
 Get float pixels data.
 
unsigned char * pixels ()
 Get float pixels data.
 
void clear ()
 Clear image.
 
void loadFromFile (const std::string &fileName)
 Load form file.
 
bool saveToFile (const std::string &fileName) const
 Save to file. More...
 
void reverseV ()
 reverse v
 

Detailed Description

Image class.

Stores an image object as an array of pixels The image can be stored as byte array or float array

Constructor & Destructor Documentation

◆ Image() [1/5]

AtomsUtils::Image::Image ( unsigned int  width,
unsigned int  height,
unsigned int  channel,
unsigned short  imgType 
)

Constructor.

Parameters
widthImage width
heightImage hegiht
channelsNumber of channels
imgTypeImage type

◆ Image() [2/5]

AtomsUtils::Image::Image ( float *  data,
unsigned int  width,
unsigned int  height,
unsigned int  channel 
)

Constructor.

Parameters
dataPixels data
widthImage width
heightImage hegiht
channelsNumber of channels
imgTypeImage type

◆ Image() [3/5]

AtomsUtils::Image::Image ( unsigned char *  data,
unsigned int  width,
unsigned int  height,
unsigned int  channel 
)

Constructor.

Parameters
dataPixels data
widthImage width
heightImage hegiht
channelsNumber of channels
imgTypeImage type

◆ Image() [4/5]

AtomsUtils::Image::Image ( std::vector< float >  data,
unsigned int  width,
unsigned int  height,
unsigned int  channel 
)

Constructor.

Parameters
dataPixels data
widthImage width
heightImage hegiht
channelsNumber of channels
imgTypeImage type

◆ Image() [5/5]

AtomsUtils::Image::Image ( std::vector< unsigned char >  data,
unsigned int  width,
unsigned int  height,
unsigned int  channel 
)

Constructor.

Parameters
dataPixels data
widthImage width
heightImage hegiht
channelsNumber of channels
imgTypeImage type

Member Function Documentation

◆ saveToFile()

bool AtomsUtils::Image::saveToFile ( const std::string &  fileName) const

Save to file.

Save image to file, only jpg, png, tga, bmp, hdr are supported


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