|
Blender V5.3
|
#include <BIF_glutil.hh>
Public Member Functions | |
| PixelBitmapDrawer (GPUBuiltinShader builtin_shader) | |
| PixelBitmapDrawer () | |
| gpu::Shader * | shader_get () |
| void | draw (float x, float y, int img_w, int img_h, gpu::TextureFormat gpu_format, bool use_filter, const void *rect, float scale_x, float scale_y, const float color[4]) |
Utility to render a quad using pixel bitmap data in system memory.
Definition at line 30 of file BIF_glutil.hh.
| blender::PixelBitmapDrawer::PixelBitmapDrawer | ( | GPUBuiltinShader | builtin_shader | ) |
Prepares for drawing, using one of built-in shaders (e.g. GPU_SHADER_3D_IMAGE_COLOR).
Before drawing additional uniforms can be set on the shader.
Definition at line 36 of file glutil.cc.
References blender::GPU_shader_get_builtin_shader(), and blender::immBindBuiltinProgram().
| blender::PixelBitmapDrawer::PixelBitmapDrawer | ( | ) |
Prepares for drawing, with shader set up by the caller. The shader is expected to use pos and texCoord attributes, and image texture.
Definition at line 31 of file glutil.cc.
References blender::nullptr.
| void blender::PixelBitmapDrawer::draw | ( | float | x, |
| float | y, | ||
| int | img_w, | ||
| int | img_h, | ||
| gpu::TextureFormat | gpu_format, | ||
| bool | use_filter, | ||
| const void * | rect, | ||
| float | scale_x, | ||
| float | scale_y, | ||
| const float | color[4] ) |
Draws pixel data on a rectangle.
The model-view and projection matrices are assumed to define a 1-to-1 mapping to screen space.
If color is null, white is used.
Definition at line 45 of file glutil.cc.
References ELEM, blender::GPU_DATA_FLOAT, blender::GPU_DATA_UBYTE, blender::GPU_PRIM_TRI_FAN, blender::GPU_SAMPLER_EXTEND_MODE_EXTEND, blender::GPU_shader_get_uniform(), blender::GPU_texture_bind(), blender::GPU_texture_create_2d(), blender::GPU_texture_extend_mode(), blender::GPU_texture_filter_mode(), blender::GPU_texture_free(), blender::GPU_texture_mipmap_mode(), blender::GPU_texture_unbind(), blender::GPU_texture_update(), blender::GPU_texture_update_mipmap_chain(), blender::GPU_TEXTURE_USAGE_SHADER_READ, blender::GPU_TEXTURE_USAGE_SHADER_WRITE, blender::immAttr2f(), blender::immBegin(), blender::immEnd(), blender::immUnbindProgram(), blender::immUniformColor4fv(), blender::immVertex2f(), blender::x, and y.
Referenced by blender::ui::draw_but_IMAGE(), blender::ui::draw_but_TRACKPREVIEW(), blender::draw_filled_lasso(), blender::ED_draw_imbuf(), blender::ED_mask_draw_region(), blender::file_draw_preview(), blender::ui::icon_draw_rect(), blender::ui::tooltip_region_draw_cb(), and blender::wm_drag_draw_icon().
|
inline |
Definition at line 51 of file BIF_glutil.hh.
Referenced by blender::draw_filled_lasso(), and blender::ED_mask_draw_region().