MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__tga_get_comp

Function stbi__tga_get_comp

include/stb/stb_image.h:5739–5753  ·  view source on GitHub ↗

returns STBI_rgb or whatever, 0 on error

Source from the content-addressed store, hash-verified

5737#ifndef STBI_NO_TGA
5738// returns STBI_rgb or whatever, 0 on error
5739static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16)
5740{
5741 // only RGB or RGBA (incl. 16bit) or grey allowed
5742 if (is_rgb16) *is_rgb16 = 0;
5743 switch(bits_per_pixel) {
5744 case 8: return STBI_grey;
5745 case 16: if(is_grey) return STBI_grey_alpha;
5746 // fallthrough
5747 case 15: if(is_rgb16) *is_rgb16 = 1;
5748 return STBI_rgb;
5749 case 24: // fallthrough
5750 case 32: return bits_per_pixel/8;
5751 default: return 0;
5752 }
5753}
5754
5755static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
5756{

Callers 2

stbi__tga_infoFunction · 0.85
stbi__tga_loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected