Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::gfx::TextureBase::Face Class Reference

Internal class that wraps texture data: a single image or a stack of mipmaps, and any sub- or layered data. More...

#include "texture.h"

Public Member Functions

 Face (TextureBase *texture, int sub_image_changed_bit, int mipmaps_changed_start_bit)
 TextureBase::Face. More...
 
void SetSubImage (size_t level, const math::Point2ui offset, const ImagePtr &image)
 Sets the area of the texture starting from the passed xy offset and having the dimensions of the passed image. More...
 
void SetSubImage (size_t level, const math::Point3ui offset, const ImagePtr &image)
 Sets the area of the texture starting from the passed xyz offset and having the dimensions of the passed image. More...
 
const base::AllocVector
< SubImage > & 
GetSubImages () const
 Returns the vector of sub-images; it may be empty. More...
 
void ClearSubImages () const
 Clears the vector of sub-images. More...
 
bool HasImage (size_t level) const
 Returns true if there is a mipmap image at the specified level stored here. More...
 
const ImagePtr GetImage (size_t level) const
 Returns the image at the specified mipmap level, or NULL if this is not mipmapped. More...
 
size_t GetImageCount () const
 Gets the number of mipmap images that have been set. More...
 
void SetImage (size_t level, const ImagePtr &image_in, TextureBase *texture)
 Sets the image to use for the texture at the specified mipmap level. More...
 

Detailed Description

Internal class that wraps texture data: a single image or a stack of mipmaps, and any sub- or layered data.

Definition at line 164 of file texture.h.

Constructor & Destructor Documentation

ion::gfx::TextureBase::Face::Face ( TextureBase texture,
int  sub_image_changed_bit,
int  mipmaps_changed_start_bit 
)

TextureBase::Face.

Definition at line 37 of file texture.cc.

Member Function Documentation

void ion::gfx::TextureBase::Face::ClearSubImages ( ) const
inline

Clears the vector of sub-images.

Definition at line 186 of file texture.h.

const ImagePtr ion::gfx::TextureBase::Face::GetImage ( size_t  level) const
inline

Returns the image at the specified mipmap level, or NULL if this is not mipmapped.

Definition at line 198 of file texture.h.

References ion::base::SharedPtr< T >::Get().

Referenced by ion::gfx::Texture::~Texture().

size_t ion::gfx::TextureBase::Face::GetImageCount ( ) const
inline

Gets the number of mipmap images that have been set.

Definition at line 206 of file texture.h.

const base::AllocVector<SubImage>& ion::gfx::TextureBase::Face::GetSubImages ( ) const
inline

Returns the vector of sub-images; it may be empty.

Definition at line 181 of file texture.h.

bool ion::gfx::TextureBase::Face::HasImage ( size_t  level) const
inline

Returns true if there is a mipmap image at the specified level stored here.

Definition at line 192 of file texture.h.

void ion::gfx::TextureBase::Face::SetImage ( size_t  level,
const ImagePtr image_in,
TextureBase texture 
)

Sets the image to use for the texture at the specified mipmap level.

If the full image pyramid is not set and any mipmap other than the 0th level is set, then the missing images will be autogenerated by OpenGL. Passing a NULL ImagePtr will clear the client- supplied image for that level.

Mipmap images must all share the same format, and have dimensions consistent with a mipmap hierarchy. If these conditions are not met, an error will be generated during rendering.

Definition at line 62 of file texture.cc.

References ion::base::SharedPtr< T >::Get().

void ion::gfx::TextureBase::Face::SetSubImage ( size_t  level,
const math::Point2ui  offset,
const ImagePtr image 
)

Sets the area of the texture starting from the passed xy offset and having the dimensions of the passed image.

See comments for these functions in Texture.

If the Face is backed by a 3D image, the z offset is set to 0.

Definition at line 48 of file texture.cc.

void ion::gfx::TextureBase::Face::SetSubImage ( size_t  level,
const math::Point3ui  offset,
const ImagePtr image 
)

Sets the area of the texture starting from the passed xyz offset and having the dimensions of the passed image.

See comments for these functions in Texture.

Definition at line 54 of file texture.cc.


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