Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
shader.h File Reference

Basic shader-like bitmap manipulation.

#include <banjo/api.h>
#include <banjo/bitmap.h>
#include <banjo/linmath.h>
Include dependency graph for shader.h:

Go to the source code of this file.

Macros

#define BJ_SHADER_STANDARD_FLAGS   (BJ_SHADER_INVERT_Y | BJ_SHADER_CLAMP_COLOR | BJ_SHADER_NORMALIZE_COORDS | BJ_SHADER_CENTER_COORDS)
 Flagset alias for bj_bitmap_apply_shader.
 

Typedefs

typedef int(* bj_bitmap_shading_fn_t) (bj_vec3 out_color, const bj_vec2 pixel_coord, void *user_data)
 Function type for a bitmap shading operation.
 
typedef enum bj_shader_flag_t bj_shader_flag
 Shader input control flags.
 

Enumerations

enum  bj_shader_flag_t {
  BJ_SHADER_INVERT_X = 0x01 , BJ_SHADER_INVERT_Y = 0x02 , BJ_SHADER_CLAMP_COLOR = 0x04 , BJ_SHADER_NORMALIZE_COORDS = 0x08 ,
  BJ_SHADER_CENTER_COORDS = 0x10
}
 Shader input control flags. More...
 

Functions

void bj_bitmap_apply_shader (bj_bitmap *p_bitmap, bj_bitmap_shading_fn_t p_shader, void *p_data, uint8_t flags)
 Applies a shader function to every pixel in a bitmap.