Blender V5.3
image_space.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
12
13namespace blender {
14
15struct ARegion;
16struct ImBuf;
17struct Image;
18struct ImageUser;
19struct Main;
20
21namespace image_engine {
22
23struct ShaderParameters;
24
32 public:
33 virtual ~AbstractSpaceAccessor() = default;
34
42 virtual blender::Image *get_image(Main *bmain) = 0;
43
50
60
64 virtual void release_buffer(blender::Image *image, ImBuf *image_buffer, void *lock) = 0;
65
72 virtual void get_shader_parameters(ShaderParameters &r_shader_parameters,
73 ImBuf *image_buffer) = 0;
74
76 virtual bool use_tile_drawing() const = 0;
77
79 virtual bool use_display_window() const = 0;
80
82 virtual float get_zoom() const = 0;
83
85 virtual float get_aspect_ratio() const = 0;
86
88 virtual float2 get_pan_offset() const = 0;
89};
90
91} // namespace image_engine
92
93} // namespace blender
volatile int lock
virtual void release_buffer(blender::Image *image, ImBuf *image_buffer, void *lock)=0
virtual float get_aspect_ratio() const =0
Gets the aspect ratio of the image. The ratio is for the vertical axis.
virtual float2 get_pan_offset() const =0
Gets the pan offset of the space in image pixel space.
virtual float get_zoom() const =0
Gets the zoom factor of the space. A factor of 2 is a zoom-in by two times.
virtual blender::ImageUser * get_image_user()=0
virtual blender::Image * get_image(Main *bmain)=0
virtual ImBuf * acquire_image_buffer(blender::Image *image, void **lock)=0
virtual void get_shader_parameters(ShaderParameters &r_shader_parameters, ImBuf *image_buffer)=0
virtual bool use_display_window() const =0
Draw image with display window offsets.
virtual bool use_tile_drawing() const =0
Is (wrap) repeat option enabled in the space.
BMesh Iterators.
VecBase< float, 2 > float2