In file libs/cs3d/common/txtmgr.h:

class csTextureMM

csTextureMM represents a texture and all its mipmapped variants

Inheritance:


Public Fields

static bool fIgnoreLoadingErrors
Set this to TRUE to ignore image loading errors

Public Methods

void alloc_2dtexture(csTextureManager* tex)
Allocate the 2d texture for this texture.
void alloc_mipmaps(csTextureManager* tex)
Allocate all mipmap levels for this texture.
void blend_mipmap0(csTextureManager* tex)
Blend mipmap level 0.
void compute_color_usage()
Compute the 'usage' table.
void create_mipmaps(csTextureManager* tex)
Create all mipmapped bitmaps from the first level.
csTextureMM(IImageFile* image)
bool for_2d()
For 2d?
bool for_3d()
For 3d?
void free_image()
Release the original image (IImageFile) as given by the engine.
void free_usage_table()
Free the color usage table linked to a texture.
const csColor& get_mean_color()
Get the mean color.
int get_mean_color_idx()
Get the mean color index.
int get_num_colors()
csTexture* get_texture(int lev)
Get the mipmapped texture at some level (0..3).
bool get_transparent()
Query color 0 status (true - transparent; false - opaque)
void get_transparent(int &red, int &green, int &blue)
Get the transparent color
const RGBPalEntry& get_usage(int idx)
bool loaded_correctly()
Return true if the texture has been loaded correctly.
virtual void remap_palette_24bit(csTextureManager* new_palette)
This function does not really remap but it converts the format to an ULong format suitable for 24-bit internal texture format
virtual void remap_texture(csTextureManager* new_palette)
Remap the texture in the best possible way
virtual void remap_texture_16(csTextureManager* new_palette)
Remap the 2d texture to 16-bit display format
virtual void remap_texture_32(csTextureManager* new_palette)
Remap the 2d texture to 32-bit display format
void set_3d2d(bool f3d, bool f2d)
Set 3d/2d usage.
void set_transparent(int red, int green, int blue)
Set the transparent color.
virtual ~csTextureMM()

Protected Fields

bool for2d
Is the texture to be used for the 2d driver?
bool for3d
Is the texture to be used for the 3d rasterizer?
IImageFile* ifile
The corresponding ImageFile.
bool istransp
Does color 0 mean "transparent" for this texture?
csColor mean_color
Mean color used when texture mapping is disabled.
int mean_idx
Mean color index
int rs24
In 32bpp we have to use the native pixel format These are the shift values for R,G and B
csTexture* t1
Texture for mipmap level 0
csTexture* t2
Texture for mipmap level 1
csTexture* t2d
Texture for 2D driver use
csTexture* t3
Texture for mipmap level 2
csTexture* t4
Texture for mipmap level 3
RGBPixel transp_color
Transparent color
ImageColorInfo* usage
A sorted table with all used colors in the image.

Protected Methods

virtual void convert_to_internal(csTextureManager* tex, IImageFile* imfile, unsigned char* bm)
Convert ImageFile to internal format.
void create_blended_mipmap(csTextureManager* tex, unsigned char* bm)
Create a blended mipmap with the same size as the previous level.
void create_mipmap_bitmap(csTextureManager* tex, int steps, unsigned char* bm)
Create a mipmapped bitmap from a previous level

Documentation

csTextureMM represents a texture and all its mipmapped variants
IImageFile* ifile
The corresponding ImageFile.

ImageColorInfo* usage
A sorted table with all used colors in the image.

RGBPixel transp_color
Transparent color

bool istransp
Does color 0 mean "transparent" for this texture?

csColor mean_color
Mean color used when texture mapping is disabled.

int mean_idx
Mean color index

bool for3d
Is the texture to be used for the 3d rasterizer?

bool for2d
Is the texture to be used for the 2d driver?

csTexture* t1
Texture for mipmap level 0

csTexture* t2
Texture for mipmap level 1

csTexture* t3
Texture for mipmap level 2

csTexture* t4
Texture for mipmap level 3

csTexture* t2d
Texture for 2D driver use

int rs24
In 32bpp we have to use the native pixel format These are the shift values for R,G and B

void create_mipmap_bitmap(csTextureManager* tex, int steps, unsigned char* bm)
Create a mipmapped bitmap from a previous level. 'steps' is the number of steps to mipmap (only 1, 2, or 3 supported).

void create_blended_mipmap(csTextureManager* tex, unsigned char* bm)
Create a blended mipmap with the same size as the previous level.

virtual void convert_to_internal(csTextureManager* tex, IImageFile* imfile, unsigned char* bm)
Convert ImageFile to internal format.

static bool fIgnoreLoadingErrors
Set this to TRUE to ignore image loading errors

csTextureMM(IImageFile* image)

virtual ~csTextureMM()

void set_3d2d(bool f3d, bool f2d)
Set 3d/2d usage.

bool for_3d()
For 3d?

bool for_2d()
For 2d?

void alloc_mipmaps(csTextureManager* tex)
Allocate all mipmap levels for this texture.

void alloc_2dtexture(csTextureManager* tex)
Allocate the 2d texture for this texture.

void blend_mipmap0(csTextureManager* tex)
Blend mipmap level 0.

void create_mipmaps(csTextureManager* tex)
Create all mipmapped bitmaps from the first level.

void free_usage_table()
Free the color usage table linked to a texture.

void free_image()
Release the original image (IImageFile) as given by the engine.

bool loaded_correctly()
Return true if the texture has been loaded correctly.

csTexture* get_texture(int lev)
Get the mipmapped texture at some level (0..3).

void set_transparent(int red, int green, int blue)
Set the transparent color.

bool get_transparent()
Query color 0 status (true - transparent; false - opaque)

void get_transparent(int &red, int &green, int &blue)
Get the transparent color

int get_mean_color_idx()
Get the mean color index.

const csColor& get_mean_color()
Get the mean color.

int get_num_colors()

void compute_color_usage()
Compute the 'usage' table.

virtual void remap_texture(csTextureManager* new_palette)
Remap the texture in the best possible way. The default implementation will switch only between 16Bit and 32Bit modes. That is simple, but enough for OpenGL and DirectX. Other renderers will have to override this method for appropriate results.

virtual void remap_palette_24bit(csTextureManager* new_palette)
This function does not really remap but it converts the format to an ULong format suitable for 24-bit internal texture format

virtual void remap_texture_16(csTextureManager* new_palette)
Remap the 2d texture to 16-bit display format

virtual void remap_texture_32(csTextureManager* new_palette)
Remap the 2d texture to 32-bit display format

const RGBPalEntry& get_usage(int idx)


Direct child classes:
csTextureMMSoftware
csHardwareAcceleratedTextureMM

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de