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-2014 Sylvain Munaut
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef __FOSPHOR_GL_CMAP_H__
23#define __FOSPHOR_GL_CMAP_H__
24
25/*! \defgroup gl/cmap
26 * @{
27 */
28
29/*! \file gl_cmap.h
30 * \brief OpenGL float texture to color mapping
31 */
32
33#include <stdint.h>
34
35#include "gl_platform.h"
36
37
38struct fosphor_gl_cmap_ctx;
39
44};
45
46
47struct fosphor_gl_cmap_ctx *fosphor_gl_cmap_init(void);
48void fosphor_gl_cmap_release(struct fosphor_gl_cmap_ctx *cmap_ctx);
49
50void fosphor_gl_cmap_enable(struct fosphor_gl_cmap_ctx *cmap_ctx,
51 GLuint tex_id, GLuint cmap_id,
52 float scale, float offset,
53 enum fosphor_gl_cmap_mode mode);
55
56void fosphor_gl_cmap_draw_scale(GLuint cmap_id,
57 float x0, float x1, float y0, float y1);
58
59typedef int (*gl_cmap_gen_func_t)(uint32_t *rgba, int N, void *arg);
60int fosphor_gl_cmap_generate(GLuint *cmap_id, gl_cmap_gen_func_t gfn, void *gfn_arg, int N);
61
62
63/*! @} */
64
65#endif /* __FOSPHOR_GL_CMAP_H__ */
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)
struct fosphor_gl_cmap_ctx * fosphor_gl_cmap_init(void)
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:40
int(* gl_cmap_gen_func_t)(uint32_t *rgba, int N, void *arg)
Definition: gl_cmap.h:59
@ GL_CMAP_MODE_BICUBIC
Definition: gl_cmap.h:43
@ GL_CMAP_MODE_BILINEAR
Definition: gl_cmap.h:42
@ GL_CMAP_MODE_NEAREST
Definition: gl_cmap.h:41