21#ifndef VLC_GL_PICTURE_H
22#define VLC_GL_PICTURE_H 1
89 unsigned coords_count,
90 const float *pic_coords,
91 float *tex_coords_out)
93 const float *mtx = pic->
mtx;
96#define MTX(ROW,COL) mtx[(COL)*2+(ROW)]
97 for (
unsigned i = 0; i < coords_count; ++i)
101 float x = pic_coords[0];
102 float y = pic_coords[1];
103 tex_coords_out[0] =
MTX(0,0) * x +
MTX(0,1) * y +
MTX(0,2);
104 tex_coords_out[1] =
MTX(1,0) * x +
MTX(1,1) * y +
MTX(1,2);
152 float direction[
static 2*2])
171 float ux = pic->
mtx[0];
172 float uy = pic->
mtx[1];
173 float vx = pic->
mtx[2];
174 float vy = pic->
mtx[3];
176 float unorm = sqrt(ux * ux + uy * uy);
177 float vnorm = sqrt(vx * vx + vy * vy);
179 direction[0] = ux / unorm;
180 direction[1] = uy / unorm;
181 direction[2] = vx / vnorm;
182 direction[3] = vy / vnorm;
#define PICTURE_PLANE_MAX
Maximum number of plane for a picture.
Definition vlc_picture.h:67
An OpenGL picture state, with textures and a coordinate transformation matrix.
Definition vlc_opengl_picture.h:40
bool mtx_has_changed
Indicate if the transform to convert picture coordinates to textures coordinates have changed due to ...
Definition vlc_opengl_picture.h:69
float mtx[2 *3]
Matrix to convert from 2D pictures coordinates to texture coordinates.
Definition vlc_opengl_picture.h:57
uint32_t textures[(5)]
Texture handles for each plane.
Definition vlc_opengl_picture.h:44
This file is a collection of common definitions and types.
static void vlc_gl_picture_ComputeDirectionMatrix(const struct vlc_gl_picture *pic, float direction[static 2 *2])
Return a matrix to orient texture coordinates.
Definition vlc_opengl_picture.h:152
static void vlc_gl_picture_ToTexCoords(const struct vlc_gl_picture *pic, unsigned coords_count, const float *pic_coords, float *tex_coords_out)
Convert from picture coordinates to texture coordinates, which can be used to sample at the correct l...
Definition vlc_opengl_picture.h:89
This file defines picture structures and functions in vlc.