Blender  V2.93
BIF_glutil.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "GPU_texture.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 struct rcti;
33 
36 struct ImBuf;
37 struct bContext;
38 
39 typedef struct IMMDrawPixelsTexState {
40  struct GPUShader *shader;
41  unsigned int pos;
42  unsigned int texco;
45 
46 /* To be used before calling immDrawPixelsTex
47  * Default shader is GPU_SHADER_2D_IMAGE_COLOR
48  * Returns a shader to be able to set uniforms */
50 
66  float x,
67  float y,
68  int img_w,
69  int img_h,
70  eGPUTextureFormat gpu_format,
71  bool use_filter,
72  void *rect,
73  float xzoom,
74  float yzoom,
75  const float color[4]);
77  float x,
78  float y,
79  int img_w,
80  int img_h,
81  eGPUTextureFormat gpu_format,
82  bool use_filter,
83  void *rect,
84  float clip_min_x,
85  float clip_min_y,
86  float clip_max_x,
87  float clip_max_y,
88  float xzoom,
89  float yzoom,
90  const float color[4]);
92  float x,
93  float y,
94  int img_w,
95  int img_h,
96  eGPUTextureFormat gpu_format,
97  bool use_filter,
98  void *rect,
99  float scaleX,
100  float scaleY,
101  float xzoom,
102  float yzoom,
103  const float color[4]);
105  float x,
106  float y,
107  int img_w,
108  int img_h,
109  eGPUTextureFormat gpu_format,
110  bool use_filter,
111  void *rect,
112  float scaleX,
113  float scaleY,
114  float clip_min_x,
115  float clip_min_y,
116  float clip_max_x,
117  float clip_max_y,
118  float xzoom,
119  float yzoom,
120  const float color[4]);
121 
122 /* Image buffer drawing functions, with display transform
123  *
124  * The view and display settings can either be specified manually,
125  * or retrieved from the context with the '_ctx' variations.
126  *
127  * For better performance clipping coordinates can be specified so parts of the
128  * image outside the view are skipped. */
129 
130 void ED_draw_imbuf(struct ImBuf *ibuf,
131  float x,
132  float y,
133  bool use_filter,
134  struct ColorManagedViewSettings *view_settings,
135  struct ColorManagedDisplaySettings *display_settings,
136  float zoom_x,
137  float zoom_y);
138 void ED_draw_imbuf_clipping(struct ImBuf *ibuf,
139  float x,
140  float y,
141  bool use_filter,
142  struct ColorManagedViewSettings *view_settings,
143  struct ColorManagedDisplaySettings *display_settings,
144  float clip_min_x,
145  float clip_min_y,
146  float clip_max_x,
147  float clip_max_y,
148  float zoom_x,
149  float zoom_y);
150 
151 void ED_draw_imbuf_ctx(const struct bContext *C,
152  struct ImBuf *ibuf,
153  float x,
154  float y,
155  bool use_filter,
156  float zoom_x,
157  float zoom_y);
159  struct ImBuf *ibuf,
160  float x,
161  float y,
162  bool use_filter,
163  float clip_min_x,
164  float clip_min_y,
165  float clip_max_x,
166  float clip_max_y,
167  float zoom_x,
168  float zoom_y);
169 
170 int ED_draw_imbuf_method(struct ImBuf *ibuf);
171 
172 void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy);
173 
174 #ifdef __cplusplus
175 }
176 #endif
void immDrawPixelsTex_clipping(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float xzoom, float yzoom, const float color[4])
Definition: glutil.c:329
void immDrawPixelsTexScaled(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float scaleX, float scaleY, float xzoom, float yzoom, const float color[4])
Definition: glutil.c:265
void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float scaleX, float scaleY, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float xzoom, float yzoom, const float color[4])
Definition: glutil.c:95
void immDrawPixelsTex(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float xzoom, float yzoom, const float color[4])
Definition: glutil.c:298
void ED_draw_imbuf_ctx_clipping(const struct bContext *C, struct ImBuf *ibuf, float x, float y, bool use_filter, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float zoom_x, float zoom_y)
int ED_draw_imbuf_method(struct ImBuf *ibuf)
Definition: glutil.c:566
void ED_draw_imbuf_clipping(struct ImBuf *ibuf, float x, float y, bool use_filter, struct ColorManagedViewSettings *view_settings, struct ColorManagedDisplaySettings *display_settings, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float zoom_x, float zoom_y)
Definition: glutil.c:367
void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy)
struct IMMDrawPixelsTexState IMMDrawPixelsTexState
void ED_draw_imbuf(struct ImBuf *ibuf, float x, float y, bool use_filter, struct ColorManagedViewSettings *view_settings, struct ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y)
Definition: glutil.c:506
void ED_draw_imbuf_ctx(const struct bContext *C, struct ImBuf *ibuf, float x, float y, bool use_filter, float zoom_x, float zoom_y)
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
Definition: glutil.c:66
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
struct GPUShader GPUShader
Definition: GPU_shader.h:33
eGPUTextureFormat
Definition: GPU_texture.h:84
#define C
Definition: RandGen.cpp:39
uint pos
IconTextureDrawCall border
static ulong state[N]
unsigned int pos
Definition: BIF_glutil.h:41
unsigned int texco
Definition: BIF_glutil.h:42
struct GPUShader * shader
Definition: BIF_glutil.h:40