1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
#ifndef _GPU_PIXELS_H_
#define _GPU_PIXELS_H_
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2013 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Jason Wilkins.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/gpu/GPU_pixels.h
* \ingroup gpu
*/
#include "GPU_glew.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GPUbitmap {
GLsizei width, height;
GLsizei xorig, yorig;
const GLubyte* bitmap;
} GPUbitmap;
typedef struct GPUpixels {
GLsizei width, height;
GLenum format;
GLenum type;
const GLvoid* pixels;
} GPUpixels;
void GPU_bitmap_cache(GPUbitmap* bitmap);
void GPU_pixels_cache(GPUpixels* pixels);
void GPU_bitmap_uncache(GPUbitmap* bitmap);
void GPU_pixels_uncache(GPUpixels* pixels);
void GPU_pixels_zoom(GLfloat xfactor, GLfloat yfactor);
void GPU_get_pixels_zoom(GLfloat* xfactor_out, GLfloat *yfactor_out);
void GPU_pixels_format(GLenum pname, GLint param);
void GPU_pixels_uniform_1f(GLenum pname, GLfloat param);
void GPU_pixels_pos_2f(GLfloat x, GLfloat y);
void GPU_pixels_pos_3f(GLfloat x, GLfloat y, GLfloat z);
void GPU_bitmap(GPUbitmap* bitmap);
void GPU_pixels(GPUpixels* pixels);
void GPU_pixels_begin(void);
void GPU_pixels_end (void);
#if defined(GLEW_ES_ONLY)
/* ES 2.0 doesn't define pixel transfer pnames, but the draw pixel replacement library emulates them */
#define GL_RED_SCALE 0x0D14
#define GL_RED_BIAS 0x0D15
#define GL_ZOOM_X 0x0D16
#define GL_ZOOM_Y 0x0D17
#define GL_GREEN_SCALE 0x0D18
#define GL_GREEN_BIAS 0x0D19
#define GL_BLUE_SCALE 0x0D1A
#define GL_BLUE_BIAS 0x0D1B
#define GL_ALPHA_SCALE 0x0D1C
#define GL_ALPHA_BIAS 0x0D1D
#endif
#if defined(GLEW_ES_ONLY)
/* ES 2.0 doesn't define all pixel unpack parameters, but the drawPixel replacement library emulates them */
#ifndef GL_UNPACK_SWAP_BYTES
#define GL_UNPACK_SWAP_BYTES 0x0CF0
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* _GPU_PIXELS_H_ */
|