Blender V4.3
image_usage.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
12
17struct ImageUsage {
19 short pass = 0;
21 short layer = 0;
23 short view = 0;
24
29
30 const void *last_image = nullptr;
31
32 ImageUsage() = default;
33 ImageUsage(const Image *image, const ImageUser *image_user, bool do_tile_drawing)
34 {
35 pass = image_user ? image_user->pass : 0;
36 layer = image_user ? image_user->layer : 0;
37 view = image_user ? image_user->multi_index : 0;
38 colorspace_settings = image->colorspace_settings;
39 alpha_mode = image->alpha_mode;
40 last_image = static_cast<const void *>(image);
41 last_tile_drawing = do_tile_drawing;
42 }
43
44 bool operator==(const ImageUsage &other) const
45 {
46 return memcmp(this, &other, sizeof(ImageUsage)) == 0;
47 }
48 bool operator!=(const ImageUsage &other) const
49 {
50 return !(*this == other);
51 }
52};
53
54} // namespace blender::draw::image_engine
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
short multi_index
bool operator!=(const ImageUsage &other) const
ImageUsage(const Image *image, const ImageUser *image_user, bool do_tile_drawing)
bool operator==(const ImageUsage &other) const
ColorManagedColorspaceSettings colorspace_settings