|
VLC 4.0.0-dev
|
This file defines the public OpenGL sampler interface. More...
Go to the source code of this file.
Data Structures | |
| struct | vlc_gl_sampler_ops |
| struct | vlc_gl_sampler |
| OpenGL sampler. More... | |
Macros | |
| #define | set_callback_opengl_sampler(open) |
Typedefs | |
| typedef int | vlc_gl_sampler_open_fn(struct vlc_gl_sampler *sampler, bool expose_planes) |
| Activation function for OpenGL sampler module implementations. | |
Functions | |
| static void | vlc_gl_sampler_FetchLocations (struct vlc_gl_sampler *sampler, uint32_t program) |
| Callback to fetch locations of uniform or attribute variables. | |
| static void | vlc_gl_sampler_Load (struct vlc_gl_sampler *sampler) |
| Callback to load sampler data. | |
| static int | vlc_gl_sampler_Update (struct vlc_gl_sampler *sampler, const struct vlc_gl_picture *picture) |
| Update the input picture. | |
| static void | vlc_gl_sampler_SelectPlane (struct vlc_gl_sampler *sampler, unsigned plane) |
| Select the plane to expose. | |
This file defines the public OpenGL sampler interface.
The purpose of a sampler is to provide pixel values of a VLC input picture, stored in any format.
Concretely, a GLSL function:
vec4 vlc_texture(vec2 coords)
returns the RGBA values for the given coordinates.
Contrary to the standard GLSL function:
vec4 texture2D(sampler2D sampler, vec2 coords)
it does not take a sampler2D as parameter. The role of the sampler is to abstract the input picture from the filter, so the input picture is implicitly available.
| #define set_callback_opengl_sampler | ( | open | ) |
| typedef int vlc_gl_sampler_open_fn(struct vlc_gl_sampler *sampler, bool expose_planes) |
Activation function for OpenGL sampler module implementations.
The input format is described by the public fields of the sampler object which are populated before the module is loaded.
| sampler | the sampler |
| expose_planes | if set, vlc_texture() exposes a single plane at a time |
|
inlinestatic |
Callback to fetch locations of uniform or attribute variables.
This function pointer cannot be NULL. This callback is called one time after the program is linked.
| sampler | the sampler |
| program | the linked GL program handle |
References vlc_gl_sampler_ops::fetch_locations, and vlc_gl_sampler::ops.
|
inlinestatic |
Callback to load sampler data.
This function pointer cannot be NULL. This callback can be used to specify values of uniform variables.
| sampler | the sampler |
References vlc_gl_sampler_ops::load, and vlc_gl_sampler::ops.
|
inlinestatic |
Select the plane to expose.
If the sampler exposes planes separately (for plane filters), select the plane to expose via the GLSL function vlc_texture().
| sampler | the sampler |
| plane | the plane number |
References vlc_gl_sampler::ops, and vlc_gl_sampler_ops::select_plane.
|
inlinestatic |
Update the input picture.
| sampler | the sampler |
| picture | the OpenGL picture |
References vlc_gl_sampler::ops, and vlc_gl_sampler_ops::update.