/cmap

## Files

file | gl.h
| OpenGL part of fosphor.
file | gl_cmap.h
| OpenGL float texture to color mapping.
file | gl_cmap_gen.h
| OpenGL color map generators.
file | gl_font.h
| Basic OpenGL font rendering.

## Macros

#define | ATTR_FORMAT(a, b, c)
#define | GLF_FLG_LCD (1 << 0)

## Typedefs

typedef int(* | gl_cmap_gen_func_t) (uint32_t *rgba, int N, void *arg)

## Enumerations

enum | fosphor_gl_id { GL_ID_TEX_WATERFALL , GL_ID_TEX_HISTOGRAM , GL_ID_VBO_SPECTRUM }
enum | fosphor_gl_cmap_mode { GL_CMAP_MODE_NEAREST , GL_CMAP_MODE_BILINEAR , GL_CMAP_MODE_BICUBIC }
enum | glf_align { GLF_LEFT , GLF_RIGHT , GLF_TOP , GLF_BOTTOM , GLF_CENTER }

## Functions

int | fosphor_gl_init (struct fosphor *self)
void | fosphor_gl_release (struct fosphor *self)
GLuint | fosphor_gl_get_shared_id (struct fosphor *self, enum fosphor_gl_id id)
void | fosphor_gl_refresh (struct fosphor *self)
void | fosphor_gl_draw (struct fosphor *self, struct fosphor_render *render)
struct fosphor_gl_cmap_ctx * | fosphor_gl_cmap_init (void)
void | fosphor_gl_cmap_release (struct fosphor_gl_cmap_ctx *cmap_ctx)
void | fosphor_gl_cmap_enable (struct fosphor_gl_cmap_ctx *cmap_ctx, GLuint tex_id, GLuint cmap_id, float scale, float offset, enum fosphor_gl_cmap_mode mode)
void | fosphor_gl_cmap_disable (void)
void | fosphor_gl_cmap_draw_scale (GLuint cmap_id, float x0, float x1, float y0, float y1)
int | fosphor_gl_cmap_generate (GLuint *cmap_id, gl_cmap_gen_func_t gfn, void *gfn_arg, int N)
int | fosphor_gl_cmap_histogram (uint32_t *rgba, int N, void *arg)
int | fosphor_gl_cmap_waterfall (uint32_t *rgba, int N, void *arg)
int | fosphor_gl_cmap_prog (uint32_t *rgba, int N, void *arg)
int | fosphor_gl_cmap_png (uint32_t *rgba, int N, void *rsrc_name)
struct gl_font * | glf_alloc (int height, int flags)
void | glf_free (struct gl_font *glf)
int | glf_load_face_file (struct gl_font *glf, const char *filename)
int | glf_load_face_mem (struct gl_font *glf, const void *data, size_t len)
float | glf_width_str (const struct gl_font *glf, const char *str)
void | glf_draw_str (const struct gl_font *glf, float x, enum glf_align x_align, float y, enum glf_align y_align, const char *str)
void | glf_printf (const struct gl_font *glf, float x, enum glf_align x_align, float y, enum glf_align y_align, const char *fmt,...) ATTR_FORMAT(printf
void void | glf_begin (const struct gl_font *glf, float fg_color[3])
void | glf_end (void)

## Detailed Description

## Macro Definition Documentation

## ATTR_FORMAT

#define ATTR_FORMAT | ( |  | a,
|  |  | b,
|  |  | c )

Value:
__attribute__((format(a,b,c)))

Referenced by glf_printf().

## GLF_FLG_LCD

#define GLF_FLG_LCD (1 << 0)

## Typedef Documentation

## gl_cmap_gen_func_t

typedef int(* gl_cmap_gen_func_t) (uint32_t *rgba, int N, void *arg)

## Enumeration Type Documentation

## fosphor_gl_cmap_mode

enum fosphor_gl_cmap_mode

Enumerator
GL_CMAP_MODE_NEAREST |
GL_CMAP_MODE_BILINEAR |
GL_CMAP_MODE_BICUBIC |

## fosphor_gl_id

enum fosphor_gl_id

Enumerator
GL_ID_TEX_WATERFALL |
GL_ID_TEX_HISTOGRAM |
GL_ID_VBO_SPECTRUM |

## glf_align

enum glf_align

Enumerator
GLF_LEFT |
GLF_RIGHT |
GLF_TOP |
GLF_BOTTOM |
GLF_CENTER |

## Function Documentation

## fosphor_gl_cmap_disable()

void fosphor_gl_cmap_disable | ( | void |  | ) |

## fosphor_gl_cmap_draw_scale()

void fosphor_gl_cmap_draw_scale | ( | GLuint | cmap_id,
|  | float | x0,
|  | float | x1,
|  | float | y0,
|  | float | y1 )

## fosphor_gl_cmap_enable()

void fosphor_gl_cmap_enable | ( | struct fosphor_gl_cmap_ctx * | cmap_ctx,
|  | GLuint | tex_id,
|  | GLuint | cmap_id,
|  | float | scale,
|  | float | offset,
|  | enum fosphor_gl_cmap_mode | mode )

## fosphor_gl_cmap_generate()

int fosphor_gl_cmap_generate | ( | GLuint * | cmap_id,
|  | gl_cmap_gen_func_t | gfn,
|  | void * | gfn_arg,
|  | int | N )

## fosphor_gl_cmap_histogram()

int fosphor_gl_cmap_histogram | ( | uint32_t * | rgba,
|  | int | N,
|  | void * | arg )

## fosphor_gl_cmap_init()

struct fosphor_gl_cmap_ctx * fosphor_gl_cmap_init | ( | void |  | ) |

## fosphor_gl_cmap_png()

int fosphor_gl_cmap_png | ( | uint32_t * | rgba,
|  | int | N,
|  | void * | rsrc_name )

## fosphor_gl_cmap_prog()

int fosphor_gl_cmap_prog | ( | uint32_t * | rgba,
|  | int | N,
|  | void * | arg )

## fosphor_gl_cmap_release()

void fosphor_gl_cmap_release | ( | struct fosphor_gl_cmap_ctx * | cmap_ctx | ) |

## fosphor_gl_cmap_waterfall()

int fosphor_gl_cmap_waterfall | ( | uint32_t * | rgba,
|  | int | N,
|  | void * | arg )

## fosphor_gl_draw()

void fosphor_gl_draw | ( | struct fosphor * | self,
|  | struct fosphor_render * | render )

## fosphor_gl_get_shared_id()

GLuint fosphor_gl_get_shared_id | ( | struct fosphor * | self,
|  | enum fosphor_gl_id | id )

## fosphor_gl_init()

int fosphor_gl_init | ( | struct fosphor * | self | ) |

## fosphor_gl_refresh()

void fosphor_gl_refresh | ( | struct fosphor * | self | ) |

## fosphor_gl_release()

void fosphor_gl_release | ( | struct fosphor * | self | ) |

## glf_alloc()

struct gl_font * glf_alloc | ( | int | height,
|  | int | flags )

## glf_begin()

void void glf_begin | ( | const struct gl_font * | glf,
|  | float | fg_color[3] )

References glf_begin().

Referenced by glf_begin().

## glf_draw_str()

void glf_draw_str | ( | const struct gl_font * | glf,
|  | float | x,
|  | enum glf_align | x_align,
|  | float | y,
|  | enum glf_align | y_align,
|  | const char * | str )

## glf_end()

void glf_end | ( | void |  | ) |

References glf_end().

Referenced by glf_end().

## glf_free()

void glf_free | ( | struct gl_font * | glf | ) |

## glf_load_face_file()

int glf_load_face_file | ( | struct gl_font * | glf,
|  | const char * | filename )

## glf_load_face_mem()

int glf_load_face_mem | ( | struct gl_font * | glf,
|  | const void * | data,
|  | size_t | len )

## glf_printf()

void glf_printf | ( | const struct gl_font * | glf,
|  | float | x,
|  | enum glf_align | x_align,
|  | float | y,
|  | enum glf_align | y_align,
|  | const char * | fmt,
|  |  | ... )

References ATTR_FORMAT.

## glf_width_str()

float glf_width_str | ( | const struct gl_font * | glf,
|  | const char * | str )