Blender V5.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
8
9#pragma once
10
11#include <cstring>
12
13#include "DNA_color_types.h"
14#include "DNA_image_types.h"
15
16namespace blender::image_engine {
17
22struct ImageUsage {
24 short pass = 0;
26 short layer = 0;
28 short view = 0;
30 short render_slot = 0;
31
36
37 const void *last_image = nullptr;
38 const void *last_scene = nullptr;
39
40 ImageUsage() = default;
42 const blender::ImageUser *image_user,
43 bool do_tile_drawing)
44 {
45 pass = image_user ? image_user->pass : 0;
46 layer = image_user ? image_user->layer : 0;
47 view = image_user ? image_user->multi_index : 0;
48 render_slot = image->render_slot;
49 colorspace_settings = image->colorspace_settings;
50 alpha_mode = image->alpha_mode;
51 last_image = static_cast<const void *>(image);
52 last_scene = image_user ? static_cast<const void *>(image_user->scene) : nullptr;
53 last_tile_drawing = do_tile_drawing;
54 }
55
56 bool operator==(const ImageUsage &other) const
57 {
58 return memcmp(this, &other, sizeof(ImageUsage)) == 0;
59 }
60 bool operator!=(const ImageUsage &other) const
61 {
62 return !(*this == other);
63 }
64};
65
66} // namespace blender::image_engine
struct Scene * scene
ImageUsage(const blender::Image *image, const blender::ImageUser *image_user, bool do_tile_drawing)
ColorManagedColorspaceSettings colorspace_settings
bool operator==(const ImageUsage &other) const
bool operator!=(const ImageUsage &other) const