103 static cMultiImagePtr
create() {
return (std::make_shared<cMultiImage>()); }
113 cMultiImagePtr
copy();
116 bool allocate(
const unsigned int a_width,
117 const unsigned int a_height,
118 const unsigned int a_slices,
119 const GLenum a_format = GL_RGB,
120 const GLenum a_type = GL_UNSIGNED_BYTE);
129 bool convert(
const unsigned int a_newFormat);
159 const unsigned char a_transparencyLevel);
163 const unsigned char a_g,
164 const unsigned char a_b,
184 virtual unsigned char*
getVoxelData(
const unsigned int a_x,
185 const unsigned int a_y,
186 const unsigned int a_z)
const;
190 const unsigned int a_y,
191 const unsigned int a_z,
196 const unsigned int a_y,
197 const unsigned int a_z,
202 const unsigned int a_y,
203 const unsigned int a_z,
204 const unsigned char a_r,
205 const unsigned char a_g,
210 const unsigned int a_y,
211 const unsigned int a_z,
212 const unsigned char a_grayLevel);
232 virtual bool loadFromFile(
const std::string& a_filename);
235 virtual int loadFromFiles(
const std::vector<std::string>& a_filename);
238 virtual int loadFromFiles(
const std::string& a_basename,
const std::string& a_extension,
unsigned long a_max = 9999);
241 virtual bool addFromFile(
const std::string& a_filename,
unsigned long a_index=-1);
244 virtual bool saveToFiles(
const std::string& a_basename,
const std::string& a_extension);
This class implements a 3D vector.
Definition: CVector3d.h:88
unsigned long m_currentIndex
Index of the currently selected image.
Definition: CMultiImage.h:279
virtual bool saveToFiles(const std::string &a_basename, const std::string &a_extension)
This method saves all images to a set of files.
Definition: CMultiImage.cpp:1037
virtual void flipHorizontal()
This method flips all images horizontally.
Definition: CMultiImage.cpp:806
virtual void setTransparentColor(const unsigned char a_r, const unsigned char a_g, const unsigned char a_b, const unsigned char a_transparencyLevel)
This method defines a pixel color to be transparent for all images.
Definition: CMultiImage.h:162
virtual unsigned char * getVoxelData(const unsigned int a_x, const unsigned int a_y, const unsigned int a_z) const
This method returns a pointer to voxel memory data.
Definition: CMultiImage.cpp:763
virtual void setVoxelColor(const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, const cColorb &a_color)
This method sets the color of an image voxel at location (x,y,z).
Definition: CMultiImage.cpp:602
This class implements an array of 2D image structures.
Definition: CMultiImage.h:88
cMultiImage()
Default constructor of cMultiImage.
Definition: CMultiImage.cpp:63
cMultiImagePtr copy()
This method creates a copy itself.
Definition: CMultiImage.cpp:205
unsigned long m_imageCount
Number of images contained in the structure.
Definition: CMultiImage.h:276
virtual unsigned int getImageCount() const
This method returns the number of images stored.
Definition: CMultiImage.h:126
bool addImage(cImage &a_image, unsigned long a_index=-1)
This method adds an image to the set if size and format are compatible.
Definition: CMultiImage.cpp:341
virtual bool addFromFilePrealloc(const std::string &a_filename, unsigned long a_index)
Add an image file to a preallocated set if size and format are compatible.
Definition: CMultiImage.cpp:1006
void erase()
This method deletes all image data from memory.
Definition: CMultiImage.h:123
std::shared_ptr< cMultiImage > cMultiImagePtr
Definition: CMultiImage.h:66
virtual void setTransparentColor(const cColorb &a_color, const unsigned char a_transparencyLevel)
This method defines a pixel color for all images to be transparent.
Definition: CMultiImage.cpp:704
virtual void getVoxelLocation(const cVector3d a_texCoord, int &a_voxelX, int &a_voxelY, int &a_voxelZ)
This method retrieves a voxel location from a texture coordinate.
Definition: CMultiImage.cpp:516
unsigned char * m_array
The image array data that holds all images contiguously.
Definition: CMultiImage.h:273
void cleanup()
This method deletes memory and rid ourselves of any image previously stored.
Definition: CMultiImage.cpp:103
virtual bool loadFromFile(const std::string &a_filename)
This method loads an image file.
Definition: CMultiImage.cpp:829
bool convert(const unsigned int a_newFormat)
This method converts the image to a new format passed as argument.
Definition: CMultiImage.cpp:231
virtual void setVoxelColor(const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, const unsigned char a_r, const unsigned char a_g, const unsigned char a_b)
This method sets the color of an image voxel at location (x,y,z).
Definition: CMultiImage.h:201
virtual bool getVoxelColor(const unsigned int a_x, const unsigned int a_y, const unsigned int a_z, cColorb &a_color) const
This method returns the color of an image voxel at location (x,y,z).
Definition: CMultiImage.cpp:541
virtual bool addFromFile(const std::string &a_filename, unsigned long a_index=-1)
This method adds an image file to the set if size and format are compatible.
Definition: CMultiImage.cpp:976
This class defines a color using a GLubyte representation for each component.
Definition: CColor.h:1184
virtual ~cMultiImage()
Destructor of cMultiImage.
Definition: CMultiImage.cpp:75
static cMultiImagePtr create()
Shared cMultiImage allocator.
Definition: CMultiImage.h:103
bool removeImage(unsigned long a_index)
This method removes an image from the set.
Definition: CMultiImage.cpp:470
virtual int loadFromFiles(const std::vector< std::string > &a_filename)
This method loads an image set from a set of files.
Definition: CMultiImage.cpp:919
bool allocate(const unsigned int a_width, const unsigned int a_height, const unsigned int a_slices, const GLenum a_format=GL_RGB, const GLenum a_type=GL_UNSIGNED_BYTE)
This method allocates a new multi image array by defining its size, pixel format and pixel type...
Definition: CMultiImage.cpp:132
virtual bool selectImage(unsigned long a_index)
This method sets the current image.
Definition: CMultiImage.cpp:311
Definition: CAudioBuffer.cpp:56
unsigned char * getArray()
This method returns a pointer to the actual image data array. Use with care!
Definition: CMultiImage.h:222
bool addImagePrealloc(cImage &a_image, unsigned long a_index)
Add an image to a preallocated set if size and format are compatible.
Definition: CMultiImage.cpp:427
Implements a 2D image data structure.
This class implements a 2D image data structure.
Definition: CImage.h:83
virtual unsigned long getCurrentIndex()
This method returns the index number of the current image.
Definition: CMultiImage.h:139
virtual void setTransparency(const unsigned char a_transparencyLevel)
This method defines a transparent level to all pixels of image set.
Definition: CMultiImage.cpp:733
void defaults()
This method initializes all member variables.
Definition: CMultiImage.cpp:87