srp
software rendering pipeline
Loading...
Searching...
No Matches
Texture

Internals of the Texture module. More...

Collaboration diagram for Texture:

Files

file  texture.c
 
file  texture_p.h
 

Classes

struct  SRPTexture
 
#define N_CHANNELS_REQUESTED   3
 
SRPTexturesrpNewTexture (const char *image, SRPTextureWrappingMode wrappingModeX, SRPTextureWrappingMode wrappingModeY)
 
void srpFreeTexture (SRPTexture *this)
 
void srpTextureGetFilteredColor (const SRPTexture *this, float u, float v, float out[4])
 
int srpTextureGet (SRPTexture *this, SRPTextureParameter parameter)
 
void srpTextureSet (SRPTexture *this, SRPTextureParameter parameter, int data)
 

Detailed Description

Internals of the Texture module.

See also
Texture

Macro Definition Documentation

◆ N_CHANNELS_REQUESTED

#define N_CHANNELS_REQUESTED   3

Number of channels requested from the stbi_load() call.

Function Documentation

◆ srpFreeTexture()

void srpFreeTexture ( SRPTexture this)

Free a texture

Parameters
[in]thisA pointer to the texture, as returned by srpNewTexture()

◆ srpNewTexture()

SRPTexture * srpNewTexture ( const char *  image,
SRPTextureWrappingMode  wrappingModeX,
SRPTextureWrappingMode  wrappingModeY 
)

Initialize a texture by loading an image

Parameters
[in]imageA filesystem path to an image. Most popular image types are supported
[in]wrappingModeX,wrappingModeYWrapping modes to use in X and Y axes
Returns
A pointer to the constructed texture

◆ srpTextureGet()

int srpTextureGet ( SRPTexture this,
SRPTextureParameter  parameter 
)

Get a parameter from existing SRPTexture

Parameters
[in]thisA pointer to texture
[in]parameterA struct member to get
Returns
Requested member, or -1 on failure

◆ srpTextureGetFilteredColor()

void srpTextureGetFilteredColor ( const SRPTexture this,
float  u,
float  v,
float  out[4] 
)

Get a texel color at u, v by filtering the texture using specified modes

Parameters
[in]thisA pointer to the texture, as returned by srpNewTexture()
[in]u,vCoordinates of the requested texel
[out]outAn array of 4 values each in [0, 1] interval, representing RGBA8888 color (0.0 = 0x0; 1.0 = 0xFF)

◆ srpTextureSet()

void srpTextureSet ( SRPTexture this,
SRPTextureParameter  parameter,
int  data 
)

Set a parameter to existing SRPTexture

Parameters
[in]thisA pointer to texture
[in]parameterA struct member to set to
[in]dataA value to set