SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::helper::io::Image Class Reference

#include <Image.h>

Inheritance diagram for sofa::helper::io::Image:

Static Public Attributes

static const char * strFromDataType [COUNT_OF_DATA_TYPES+1]
 
static const char * strFromChannelFormat [COUNT_OF_CHANNEL_FORMATS+1]
 
static const char * strFromTextureType [TEXTURE_INVALID+1]
 

Protected Attributes

unsigned char m_bLoaded
 

Public Member Functions

 Image ()
 
virtual ~Image ()
 
 Image (const Image &rhs)
 
Imageoperator= (const Image &rhs)
 
unsigned getWidth (unsigned mipmap=0) const
 
unsigned getHeight (unsigned mipmap=0) const
 
unsigned getDepth (unsigned mipmap=0) const
 
unsigned getBytesPerPixel () const
 
unsigned getBytesPerBlock () const
 
unsigned getBytesPerChannel () const
 
unsigned getChannelCount () const
 
unsigned getMipmapCount () const
 
unsigned getPixelCount () const
 
unsigned getLineSize (unsigned mipmap=0) const
 
unsigned getMipmapSize (unsigned mipmap) const
 
unsigned getMipmapRangeSize (unsigned firstMipmap, unsigned mipmaps) const
 
unsigned getImageSize () const
 
DataType getDataType () const
 
ChannelFormat getChannelFormat () const
 
TextureType getTextureType () const
 
unsigned char * getPixels ()
 
unsigned char * getMipmapPixels (unsigned mipmap)
 
unsigned char * getCubeMipmapPixels (unsigned cubeside, unsigned mipmap)
 
unsigned char * get3DSliceMipmapPixels (unsigned slice, unsigned mipmap)
 
void clear ()
 
void init (unsigned width, unsigned height, unsigned depth, unsigned mipmaps, DataType dataType, ChannelFormat channelFormat)
 
void init (unsigned width, unsigned height, unsigned bpp)
 
bool isLoaded () const
 
virtual bool load (std::string filename)
 
virtual bool save (std::string filename, int compression_level=-1)
 

Static Public Member Functions

static ImageCreate (std::string filename)
 
template<class Object >
static Object * create (Object *, std::string arg="")
 

Attribute details

unsigned char sofa::helper::io::Image::m_bLoaded
protected
const char * sofa::helper::io::Image::strFromChannelFormat
static
Initial value:
=
{
"L",
"LA",
"R",
"RG",
"RGB",
"RGBA",
"BGR",
"BGRA",
"COUNT_OF_CHANNEL_FORMATS"
}
const char * sofa::helper::io::Image::strFromDataType
static
Initial value:
=
{
"UNORM8",
"UNORM16",
"UINT32",
"HALF",
"FLOAT",
"UCOMPRESSED",
"COUNT_OF_DATA_TYPES"
}
const char * sofa::helper::io::Image::strFromTextureType
static
Initial value:
=
{
"TEXTURE_2D",
"TEXTURE_3D",
"TEXTURE_CUBE",
"TEXTURE_INVALID"
}

Constructor details

sofa::helper::io::Image::Image ( )
sofa::helper::io::Image::~Image ( )
virtual
sofa::helper::io::Image::Image ( const Image rhs)

Function details

void sofa::helper::io::Image::clear ( )
Image * sofa::helper::io::Image::Create ( std::string  filename)
static
template<class Object >
static Object* sofa::helper::io::Image::create ( Object *  ,
std::string  arg = "" 
)
inlinestatic
unsigned char * sofa::helper::io::Image::get3DSliceMipmapPixels ( unsigned  slice,
unsigned  mipmap 
)
unsigned sofa::helper::io::Image::getBytesPerBlock ( ) const
unsigned sofa::helper::io::Image::getBytesPerChannel ( ) const
unsigned sofa::helper::io::Image::getBytesPerPixel ( ) const
unsigned sofa::helper::io::Image::getChannelCount ( ) const
Image::ChannelFormat sofa::helper::io::Image::getChannelFormat ( ) const
unsigned char * sofa::helper::io::Image::getCubeMipmapPixels ( unsigned  cubeside,
unsigned  mipmap 
)
Image::DataType sofa::helper::io::Image::getDataType ( ) const
unsigned sofa::helper::io::Image::getDepth ( unsigned  mipmap = 0) const
unsigned sofa::helper::io::Image::getHeight ( unsigned  mipmap = 0) const
unsigned sofa::helper::io::Image::getImageSize ( ) const
unsigned sofa::helper::io::Image::getLineSize ( unsigned  mipmap = 0) const
unsigned sofa::helper::io::Image::getMipmapCount ( ) const
unsigned char * sofa::helper::io::Image::getMipmapPixels ( unsigned  mipmap)
unsigned sofa::helper::io::Image::getMipmapRangeSize ( unsigned  firstMipmap,
unsigned  mipmaps 
) const
unsigned sofa::helper::io::Image::getMipmapSize ( unsigned  mipmap) const
unsigned sofa::helper::io::Image::getPixelCount ( ) const
unsigned char * sofa::helper::io::Image::getPixels ( )
Image::TextureType sofa::helper::io::Image::getTextureType ( ) const
unsigned sofa::helper::io::Image::getWidth ( unsigned  mipmap = 0) const
void sofa::helper::io::Image::init ( unsigned  width,
unsigned  height,
unsigned  depth,
unsigned  mipmaps,
DataType  dataType,
ChannelFormat  channelFormat 
)
void sofa::helper::io::Image::init ( unsigned  width,
unsigned  height,
unsigned  bpp 
)
bool sofa::helper::io::Image::isLoaded ( ) const
inline
bool sofa::helper::io::Image::load ( std::string  filename)
virtual
Image & sofa::helper::io::Image::operator= ( const Image rhs)
bool sofa::helper::io::Image::save ( std::string  filename,
int  compression_level = -1 
)
virtual

Enum details

Enumerator
LA 
RG 
RGB 
RGBA 
BGR 
BGRA 
COUNT_OF_CHANNEL_FORMATS 
Enumerator
UNORM8 
UNORM16 
UINT32 
HALF 
FLOAT 
UCOMPRESSED 
COUNT_OF_DATA_TYPES 
Enumerator
TEXTURE_2D 
TEXTURE_3D 
TEXTURE_CUBE 
COUNT_OF_TEXTURE_TYPES 
TEXTURE_INVALID