mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
gobj: add F_rg, F_rg16, F_rg32, F_rgb32 to TexturePeeker
This commit is contained in:
parent
92539a3107
commit
5cafe8552b
@ -140,6 +140,12 @@ TexturePeeker(Texture *tex, Texture::CData *cdata) {
|
||||
_get_texel = get_texel_la;
|
||||
break;
|
||||
|
||||
case Texture::F_rg16:
|
||||
case Texture::F_rg32:
|
||||
case Texture::F_rg:
|
||||
_get_texel = get_texel_rg;
|
||||
break;
|
||||
|
||||
case Texture::F_rgb:
|
||||
case Texture::F_rgb5:
|
||||
case Texture::F_rgb8:
|
||||
@ -148,6 +154,7 @@ TexturePeeker(Texture *tex, Texture::CData *cdata) {
|
||||
case Texture::F_rgb332:
|
||||
case Texture::F_r11_g11_b10:
|
||||
case Texture::F_rgb9_e5:
|
||||
case Texture::F_rgb32:
|
||||
_get_texel = get_texel_rgb;
|
||||
break;
|
||||
|
||||
@ -582,6 +589,18 @@ get_texel_la(LColor &color, const unsigned char *&p, GetComponentFunc *get_compo
|
||||
color[3] = (*get_component)(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the color of the texel at byte p, given that the texture is in format
|
||||
* F_rg or similar.
|
||||
*/
|
||||
void TexturePeeker::
|
||||
get_texel_rg(LColor &color, const unsigned char *&p, GetComponentFunc *get_component) {
|
||||
color[0] = (*get_component)(p);
|
||||
color[1] = (*get_component)(p);
|
||||
color[2] = 0.0f;
|
||||
color[3] = 1.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the color of the texel at byte p, given that the texture is in format
|
||||
* F_rgb or similar.
|
||||
|
@ -77,6 +77,7 @@ private:
|
||||
static void get_texel_a(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
static void get_texel_l(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
static void get_texel_la(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
static void get_texel_rg(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
static void get_texel_rgb(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
static void get_texel_rgba(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
static void get_texel_srgb(LColor &color, const unsigned char *&p, GetComponentFunc *get_component);
|
||||
|
Loading…
x
Reference in New Issue
Block a user