GNU Radio's TEST Package
gl_cmap.h
Go to the documentation of this file.
1 /*
2  * gl_cmap.h
3  *
4  * OpenGL float texture -> color mapping
5  *
6  * Copyright (C) 2013-2021 Sylvain Munaut
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  */
9 
10 #pragma once
11 
12 /*! \defgroup gl/cmap
13  * @{
14  */
15 
16 /*! \file gl_cmap.h
17  * \brief OpenGL float texture to color mapping
18  */
19 
20 #include <stdint.h>
21 
22 #include "gl_platform.h"
23 
24 
25 struct fosphor_gl_cmap_ctx;
26 
31 };
32 
33 
34 struct fosphor_gl_cmap_ctx *fosphor_gl_cmap_init(void);
35 void fosphor_gl_cmap_release(struct fosphor_gl_cmap_ctx *cmap_ctx);
36 
37 void fosphor_gl_cmap_enable(struct fosphor_gl_cmap_ctx *cmap_ctx,
38  GLuint tex_id, GLuint cmap_id,
39  float scale, float offset,
40  enum fosphor_gl_cmap_mode mode);
42 
43 void fosphor_gl_cmap_draw_scale(GLuint cmap_id,
44  float x0, float x1, float y0, float y1);
45 
46 typedef int (*gl_cmap_gen_func_t)(uint32_t *rgba, int N, void *arg);
47 int fosphor_gl_cmap_generate(GLuint *cmap_id, gl_cmap_gen_func_t gfn, void *gfn_arg, int N);
48 
49 
50 /*! @} */
Wrapper to select proper OpenGL headers for various platforms.
int fosphor_gl_cmap_generate(GLuint *cmap_id, gl_cmap_gen_func_t gfn, void *gfn_arg, int N)
void fosphor_gl_cmap_disable(void)
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_release(struct fosphor_gl_cmap_ctx *cmap_ctx)
void fosphor_gl_cmap_draw_scale(GLuint cmap_id, float x0, float x1, float y0, float y1)
fosphor_gl_cmap_mode
Definition: gl_cmap.h:27
int(* gl_cmap_gen_func_t)(uint32_t *rgba, int N, void *arg)
Definition: gl_cmap.h:46
struct fosphor_gl_cmap_ctx * fosphor_gl_cmap_init(void)
@ GL_CMAP_MODE_BICUBIC
Definition: gl_cmap.h:30
@ GL_CMAP_MODE_BILINEAR
Definition: gl_cmap.h:29
@ GL_CMAP_MODE_NEAREST
Definition: gl_cmap.h:28