61 std::unique_ptr<AbstractSpaceAccessor> space;
62 DrawingMode drawing_mode;
75 drawing_mode.cache_init(vedata);
79 float winmat[4][4], viewmat[4][4];
89 instance_data->
image = space->get_image(bmain);
90 if (instance_data->
image ==
nullptr) {
95 space->use_tile_drawing();
97 ImBuf *image_buffer = space->acquire_image_buffer(instance_data->
image, &
lock);
100 float image_resolution[2] = {image_buffer ? image_buffer->
x : 1024.0f,
101 image_buffer ? image_buffer->
y : 1024.0f};
102 space->init_ss_to_texture_matrix(
107 space->release_buffer(instance_data->
image, image_buffer,
lock);
109 ImageUser *iuser = space->get_image_user();
110 if (instance_data->
image->
rr !=
nullptr) {
116 drawing_mode.cache_image(vedata, instance_data->
image, iuser);
121 drawing_mode.draw_finish(vedata);
124 instance_data->
image =
nullptr;
129 drawing_mode.draw_scene(vedata);
141 vedata->
instance_data = MEM_new<IMAGE_InstanceData>(__func__);
174 MEM_delete(instance_data);
struct Main * CTX_data_main(const bContext *C)
struct RenderPass * BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser)
void BKE_image_multiview_index(const struct Image *ima, struct ImageUser *iuser)
General operations, lookup, etc. for blender objects.
#define BLI_assert_unreachable()
void orthographic_m4(float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip)
void unit_m4(float m[4][4])
#define DRW_VIEWPORT_DATA_SIZE(ty)
Contains defines and structs used throughout the imbuf module.
virtual ~ImageEngine()=default
ImageEngine(const DRWContextState *draw_ctx, IMAGE_Data *vedata)
const DRWContextState * DRW_context_state_get(void)
DRWView * DRW_view_create(const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4], DRWCallVisibilityFn *visibility_fn)
DrawEngineType draw_engine_image_type
static void IMAGE_engine_free()
static std::unique_ptr< AbstractSpaceAccessor > space_accessor_from_context(const DRWContextState *draw_ctx)
static void IMAGE_cache_populate(void *UNUSED(vedata), Object *UNUSED(ob))
static void IMAGE_cache_init(void *vedata)
static void IMAGE_instance_free(void *_instance_data)
static void IMAGE_draw_scene(void *vedata)
static void IMAGE_engine_init(void *ved)
static const DrawEngineDataSize IMAGE_data_size
struct SpaceLink * space_data
const struct bContext * evil_C
ShaderParameters sh_params
bool do_tile_drawing
should we perform tiled drawing (wrap repeat).
float ss_to_texture[4][4]
Transform matrix to convert a normalized screen space coordinates to texture space.
struct IMAGE_InstanceData::@222 flags
void update(AbstractSpaceAccessor *space, const Scene *scene, Image *image, ImBuf *image_buffer)
IMAGE_InstanceData * instance_data