|
Blender
V2.93
|
#include "DRW_render.h"#include "BKE_image.h"#include "BKE_main.h"#include "BKE_object.h"#include "DNA_camera_types.h"#include "DNA_screen_types.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "ED_image.h"#include "GPU_batch.h"#include "image_engine.h"#include "image_private.h"Go to the source code of this file.
Macros | |
| #define | IMAGE_DRAW_FLAG_SHOW_ALPHA (1 << 0) |
| #define | IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) |
| #define | IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) |
| #define | IMAGE_DRAW_FLAG_DEPTH (1 << 3) |
| #define | IMAGE_DRAW_FLAG_DO_REPEAT (1 << 4) |
| #define | IMAGE_DRAW_FLAG_USE_WORLD_POS (1 << 5) |
Functions | |
| static void | image_cache_image_add (DRWShadingGroup *grp, Image *image, ImBuf *ibuf) |
| static void | space_image_gpu_texture_get (Image *image, ImageUser *iuser, ImBuf *ibuf, GPUTexture **r_gpu_texture, bool *r_owns_texture, GPUTexture **r_tex_tile_data) |
| static void | space_node_gpu_texture_get (Image *image, ImageUser *iuser, ImBuf *ibuf, GPUTexture **r_gpu_texture, bool *r_owns_texture, GPUTexture **r_tex_tile_data) |
| static void | image_gpu_texture_get (Image *image, ImageUser *iuser, ImBuf *ibuf, GPUTexture **r_gpu_texture, bool *r_owns_texture, GPUTexture **r_tex_tile_data) |
| static void | image_cache_image (IMAGE_Data *vedata, Image *image, ImageUser *iuser, ImBuf *ibuf) |
Engine Callbacks | |
| static void | IMAGE_engine_init (void *ved) |
| static void | IMAGE_cache_init (void *ved) |
| static void | IMAGE_cache_populate (void *UNUSED(vedata), Object *UNUSED(ob)) |
| static void | image_draw_finish (IMAGE_Data *ved) |
| static void | IMAGE_draw_scene (void *ved) |
| static void | IMAGE_engine_free (void) |
Variables | |
| static const DrawEngineDataSize | IMAGE_data_size = DRW_VIEWPORT_DATA_SIZE(IMAGE_Data) |
| DrawEngineType | draw_engine_image_type |
Draw engine to draw the Image/UV editor
Definition in file image_engine.c.
| #define IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) |
Definition at line 45 of file image_engine.c.
| #define IMAGE_DRAW_FLAG_DEPTH (1 << 3) |
Definition at line 47 of file image_engine.c.
| #define IMAGE_DRAW_FLAG_DO_REPEAT (1 << 4) |
Definition at line 48 of file image_engine.c.
| #define IMAGE_DRAW_FLAG_SHOW_ALPHA (1 << 0) |
Definition at line 44 of file image_engine.c.
| #define IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) |
Definition at line 46 of file image_engine.c.
| #define IMAGE_DRAW_FLAG_USE_WORLD_POS (1 << 5) |
Definition at line 49 of file image_engine.c.
|
static |
Definition at line 182 of file image_engine.c.
References BKE_image_has_gpu_texture_premultiplied_alpha(), Scene::camera, copy_v4_fl4(), Object::data, DRW_context_state_get(), DRW_shgroup_create(), DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_texture_ex(), DRW_shgroup_uniform_vec2_copy(), DRW_shgroup_uniform_vec4_copy(), ED_space_image_get_display_channel_mask(), SpaceImage::flag, SpaceNode::flag, if(), image_cache_image_add(), IMAGE_DRAW_FLAG_APPLY_ALPHA, IMAGE_DRAW_FLAG_DEPTH, IMAGE_DRAW_FLAG_DO_REPEAT, IMAGE_DRAW_FLAG_SHOW_ALPHA, IMAGE_DRAW_FLAG_SHUFFLING, IMAGE_DRAW_FLAG_USE_WORLD_POS, image_gpu_texture_get(), IMAGE_PassList::image_pass, IMAGE_shader_image_get(), IMB_alpha_affects_rgb(), NULL, OB_CAMERA, IMAGE_PrivateData::owns_texture, IMAGE_StorageList::pd, IMAGE_Data::psl, scene, DRWContextState::scene, SET_FLAG_FROM_TEST, shader(), shuffle(), SI_DRAW_TILE, SI_SHOW_ALPHA, SI_SHOW_B, SI_SHOW_G, SI_SHOW_R, SI_SHOW_ZBUF, SI_USE_ALPHA, SNODE_SHOW_ALPHA, SNODE_SHOW_B, SNODE_SHOW_G, SNODE_SHOW_R, SNODE_USE_ALPHA, DRWContextState::space_data, SPACE_IMAGE, SPACE_NODE, SpaceLink::spacetype, IMAGE_Data::stl, IMAGE_PrivateData::texture, and Object::type.
Referenced by IMAGE_cache_init().
|
static |
Definition at line 51 of file image_engine.c.
References DRW_cache_quad_get(), DRW_context_state_get(), DRW_shgroup_call_obmat, float(), GPUBatch, IMA_SRC_TILED, LISTBASE_FOREACH, DRWContextState::region, Image::source, DRWContextState::space_data, SPACE_NODE, SpaceLink::spacetype, Image::tiles, unit_m4(), ARegion::winx, ARegion::winy, x, ImBuf::x, SpaceNode::xof, y, ImBuf::y, SpaceNode::yof, and SpaceNode::zoom.
Referenced by image_cache_image().
|
static |
Definition at line 329 of file image_engine.c.
References BKE_image_acquire_ibuf(), BKE_image_ensure_viewer(), CTX_data_main(), DRW_context_state_get(), DRW_pass_create(), DRW_STATE_BLEND_ALPHA_PREMUL, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, DRW_view_create(), ED_space_image(), ED_space_image_acquire_buffer(), DRWContextState::evil_C, IMAGE_PrivateData::ibuf, IMA_TYPE_COMPOSITE, IMAGE_PrivateData::image, image_cache_image(), IMAGE_PassList::image_pass, SpaceImage::iuser, IMAGE_PrivateData::lock, NULL, orthographic_m4(), IMAGE_StorageList::pd, IMAGE_Data::psl, DRWContextState::region, DRWContextState::space_data, SPACE_IMAGE, SPACE_NODE, SpaceLink::spacetype, state, IMAGE_Data::stl, unit_m4(), IMAGE_PrivateData::view, ARegion::winx, and ARegion::winy.
|
static |
Definition at line 374 of file image_engine.c.
|
static |
Definition at line 379 of file image_engine.c.
References BKE_image_release_ibuf(), DRW_context_state_get(), ED_space_image_release_buffer(), GPU_texture_free(), IMAGE_PrivateData::ibuf, IMAGE_PrivateData::image, IMAGE_PrivateData::lock, NULL, IMAGE_PrivateData::owns_texture, IMAGE_StorageList::pd, DRWContextState::space_data, SPACE_IMAGE, SPACE_NODE, SpaceLink::spacetype, IMAGE_Data::stl, and IMAGE_PrivateData::texture.
Referenced by IMAGE_draw_scene().
|
static |
Definition at line 403 of file image_engine.c.
References DefaultFramebufferList::default_fb, DRW_draw_pass(), DRW_view_set_active(), DRW_viewport_framebuffer_list_get(), GPU_framebuffer_bind(), image_draw_finish(), IMAGE_PassList::image_pass, NULL, IMAGE_StorageList::pd, IMAGE_Data::psl, IMAGE_Data::stl, and IMAGE_PrivateData::view.
|
static |
Definition at line 420 of file image_engine.c.
References IMAGE_shader_free().
|
static |
Definition at line 314 of file image_engine.c.
References IMAGE_PrivateData::ibuf, IMAGE_shader_library_ensure(), IMAGE_PrivateData::lock, MEM_callocN, NULL, IMAGE_StorageList::pd, IMAGE_Data::stl, and IMAGE_PrivateData::texture.
|
static |
Definition at line 159 of file image_engine.c.
References DRW_context_state_get(), DRWContextState::space_data, SPACE_IMAGE, space_image_gpu_texture_get(), SPACE_NODE, space_node_gpu_texture_get(), and SpaceLink::spacetype.
Referenced by image_cache_image().
|
static |
Definition at line 101 of file image_engine.c.
References BKE_image_get_gpu_texture(), BKE_image_get_gpu_tilemap(), BKE_image_get_gpu_tiles(), BKE_image_multilayer_index(), BKE_image_multiview_index(), BLI_assert, ImBuf::channels, DRW_context_state_get(), ED_space_image_get_display_channel_mask(), SpaceImage::flag, GPU_R16F, GPU_texture_create_2d(), if(), IMA_SRC_TILED, SpaceImage::iuser, NULL, ImBuf::rect_float, Image::rr, SI_SHOW_ZBUF, Image::source, DRWContextState::space_data, ImBuf::x, ImBuf::y, ImBuf::zbuf, and ImBuf::zbuf_float.
Referenced by image_gpu_texture_get().
|
static |
Definition at line 147 of file image_engine.c.
References BKE_image_get_gpu_texture(), and NULL.
Referenced by image_gpu_texture_get().
| DrawEngineType draw_engine_image_type |
Definition at line 429 of file image_engine.c.
Referenced by drw_engines_enable_editors(), and DRW_engines_register().
|
static |
Definition at line 427 of file image_engine.c.