Blender  V3.3
image_usage.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. */
3 
8 #pragma once
9 
14 struct ImageUsage {
16  short pass = 0;
18  short layer = 0;
20  short view = 0;
21 
24  char alpha_mode;
26 
27  const void *last_image = nullptr;
28 
29  ImageUsage() = default;
30  ImageUsage(const struct Image *image, const struct ImageUser *image_user, bool do_tile_drawing)
31  {
32  pass = image_user ? image_user->pass : 0;
33  layer = image_user ? image_user->layer : 0;
34  view = image_user ? image_user->multi_index : 0;
35  colorspace_settings = image->colorspace_settings;
36  alpha_mode = image->alpha_mode;
37  last_image = static_cast<const void *>(image);
38  last_tile_drawing = do_tile_drawing;
39  }
40 
41  bool operator==(const ImageUsage &other) const
42  {
43  return memcmp(this, &other, sizeof(ImageUsage)) == 0;
44  }
45  bool operator!=(const ImageUsage &other) const
46  {
47  return !(*this == other);
48  }
49 };
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
short layer
Definition: image_usage.hh:18
bool operator==(const ImageUsage &other) const
Definition: image_usage.hh:41
const void * last_image
Definition: image_usage.hh:27
ImageUsage(const struct Image *image, const struct ImageUser *image_user, bool do_tile_drawing)
Definition: image_usage.hh:30
ColorManagedColorspaceSettings colorspace_settings
Definition: image_usage.hh:22
short view
Definition: image_usage.hh:20
bool last_tile_drawing
Definition: image_usage.hh:25
bool operator!=(const ImageUsage &other) const
Definition: image_usage.hh:45
char alpha_mode
Definition: image_usage.hh:24
ImageUsage()=default
short pass
Definition: image_usage.hh:16
short multi_index