Blender  V3.3
BIF_glutil.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "GPU_texture.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 struct rcti;
17 
20 struct ImBuf;
21 struct bContext;
22 
23 typedef struct IMMDrawPixelsTexState {
24  struct GPUShader *shader;
25  unsigned int pos;
26  unsigned int texco;
29 
30 /* To be used before calling immDrawPixelsTex
31  * Default shader is GPU_SHADER_2D_IMAGE_COLOR
32  * Returns a shader to be able to set uniforms */
40 
58  float x,
59  float y,
60  int img_w,
61  int img_h,
62  eGPUTextureFormat gpu_format,
63  bool use_filter,
64  const void *rect,
65  float scaleX,
66  float scaleY,
67  float xzoom,
68  float yzoom,
69  const float color[4]);
70 
86  float x,
87  float y,
88  int img_w,
89  int img_h,
90  eGPUTextureFormat gpu_format,
91  bool use_filter,
92  void *rect,
93  float xzoom,
94  float yzoom,
95  const float color[4]);
97  float x,
98  float y,
99  int img_w,
100  int img_h,
101  eGPUTextureFormat gpu_format,
102  bool use_filter,
103  void *rect,
104  float clip_min_x,
105  float clip_min_y,
106  float clip_max_x,
107  float clip_max_y,
108  float xzoom,
109  float yzoom,
110  const float color[4]);
112  float x,
113  float y,
114  int img_w,
115  int img_h,
116  eGPUTextureFormat gpu_format,
117  bool use_filter,
118  void *rect,
119  float scaleX,
120  float scaleY,
121  float xzoom,
122  float yzoom,
123  const float color[4]);
139  float x,
140  float y,
141  int img_w,
142  int img_h,
143  eGPUTextureFormat gpu_format,
144  bool use_filter,
145  void *rect,
146  float scaleX,
147  float scaleY,
148  float clip_min_x,
149  float clip_min_y,
150  float clip_max_x,
151  float clip_max_y,
152  float xzoom,
153  float yzoom,
154  const float color[4]);
155 
156 /* Image buffer drawing functions, with display transform
157  *
158  * The view and display settings can either be specified manually,
159  * or retrieved from the context with the '_ctx' variations.
160  *
161  * For better performance clipping coordinates can be specified so parts of the
162  * image outside the view are skipped. */
163 
164 void ED_draw_imbuf(struct ImBuf *ibuf,
165  float x,
166  float y,
167  bool use_filter,
168  struct ColorManagedViewSettings *view_settings,
169  struct ColorManagedDisplaySettings *display_settings,
170  float zoom_x,
171  float zoom_y);
175 void ED_draw_imbuf_clipping(struct ImBuf *ibuf,
176  float x,
177  float y,
178  bool use_filter,
179  struct ColorManagedViewSettings *view_settings,
180  struct ColorManagedDisplaySettings *display_settings,
181  float clip_min_x,
182  float clip_min_y,
183  float clip_max_x,
184  float clip_max_y,
185  float zoom_x,
186  float zoom_y);
187 
188 void ED_draw_imbuf_ctx(const struct bContext *C,
189  struct ImBuf *ibuf,
190  float x,
191  float y,
192  bool use_filter,
193  float zoom_x,
194  float zoom_y);
196  struct ImBuf *ibuf,
197  float x,
198  float y,
199  bool use_filter,
200  float clip_min_x,
201  float clip_min_y,
202  float clip_max_x,
203  float clip_max_y,
204  float zoom_x,
205  float zoom_y);
206 
207 int ED_draw_imbuf_method(struct ImBuf *ibuf);
208 
212 void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy);
213 
214 #ifdef __cplusplus
215 }
216 #endif
void immDrawPixelsTexTiled_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:364
void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float scaleX, float scaleY, float xzoom, float yzoom, const float color[4])
Definition: glutil.c:59
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:600
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:401
void immDrawPixelsTexTiled_scaling_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:130
void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy)
struct IMMDrawPixelsTexState IMMDrawPixelsTexState
void immDrawPixelsTexTiled(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:333
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:540
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:44
void immDrawPixelsTexTiled_scaling(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:300
_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:20
eGPUTextureFormat
Definition: GPU_texture.h:83
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
#define C
Definition: RandGen.cpp:25
uint pos
IconTextureDrawCall border
const int state
unsigned int pos
Definition: BIF_glutil.h:25
unsigned int texco
Definition: BIF_glutil.h:26
struct GPUShader * shader
Definition: BIF_glutil.h:24