36 {
IMA_GENTYPE_GRID,
"UV_GRID", 0,
"UV Grid",
"Generated grid to test UV mappings"},
41 "Generated improved UV grid to test UV mappings"},
42 {0,
nullptr, 0,
nullptr,
nullptr},
46 {
IMA_SRC_FILE,
"FILE", 0,
"Single Image",
"Single image file"},
47 {
IMA_SRC_SEQUENCE,
"SEQUENCE", 0,
"Image Sequence",
"Multiple image files, as a sequence"},
50 {
IMA_SRC_VIEWER,
"VIEWER", 0,
"Viewer",
"Compositing node viewer"},
51 {
IMA_SRC_TILED,
"TILED", 0,
"UDIM Tiles",
"Tiled UDIM image texture"},
52 {0,
nullptr, 0,
nullptr,
nullptr},
58# include <fmt/format.h>
94 if (value != ima->source) {
124static void rna_Image_generated_type_set(
PointerRNA *
ptr,
int value)
135 return base_tile->
gen_x;
138static void rna_Image_generated_width_set(
PointerRNA *
ptr,
int value)
142 base_tile->
gen_x = std::clamp(value, 1, 65536);
149 return base_tile->
gen_y;
152static void rna_Image_generated_height_set(
PointerRNA *
ptr,
int value)
156 base_tile->
gen_y = std::clamp(value, 1, 65536);
166static void rna_Image_generated_float_set(
PointerRNA *
ptr,
bool value)
174 base_tile->
gen_flag &= ~IMA_GEN_FLOAT;
178void rna_Image_generated_color_get(
PointerRNA *
ptr,
float values[4])
185void rna_Image_generated_color_set(
PointerRNA *
ptr,
const float values[4])
189 for (
uint i = 0; i < 4; i++) {
220 rna_Image_colormanage_update(bmain, scene,
ptr);
247 if (scene !=
nullptr) {
267 rna_ImageUser_update(bmain, scene,
ptr);
271static std::optional<std::string> rna_ImageUser_path(
const PointerRNA *
ptr)
291 if (&sima->
iuser == iuser) {
292 return fmt::format(
"areas[{}].spaces[{}].image_user", area_index, space_index);
297 return " ... image_user";
349 ibuf ? &ibuf->foptions : nullptr);
356static void rna_Image_file_format_set(
PointerRNA *
ptr,
int value)
366static void rna_UDIMTile_size_get(
PointerRNA *
ptr,
int *values)
373 image_user.
tile =
tile->tile_number;
396 image_user.
tile =
tile->tile_number;
411static void rna_UDIMTile_label_get(
PointerRNA *
ptr,
char *value)
417 char value_buf[
sizeof(
tile->label)];
419 memcpy(value, value_buf,
len + 1);
431static void rna_UDIMTile_tile_number_set(
PointerRNA *
ptr,
int value)
438 if (cur_tile ==
nullptr) {
458 return image->active_tile_index;
461static void rna_Image_active_tile_index_set(
PointerRNA *
ptr,
int value)
469static void rna_Image_active_tile_index_range(
494 image->active_tile_index = index;
524static void rna_Image_resolution_get(
PointerRNA *
ptr,
float *values)
532 values[0] = ibuf->
ppm[0];
533 values[1] = ibuf->
ppm[1];
543static void rna_Image_resolution_set(
PointerRNA *
ptr,
const float *values)
551 ibuf->
ppm[0] = values[0];
552 ibuf->
ppm[1] = values[1];
578 planes = ibuf->
planes * 4;
620 length[0] = ibuf->
x * ibuf->
y * ibuf->
channels;
631static void rna_Image_pixels_get(
PointerRNA *
ptr,
float *values)
647 for (i = 0; i <
size; i++) {
656static void rna_Image_pixels_set(
PointerRNA *
ptr,
const float *values)
672 for (i = 0; i <
size; i++) {
715 bool is_float =
false;
762 if (value.owner_id == &image->id) {
766 image->render_slot = index;
775 return image->render_slot;
778static void rna_render_slots_active_index_set(
PointerRNA *
ptr,
int value)
782 image->render_slot = value;
784 CLAMP(image->render_slot, 0, num_slots - 1);
787static void rna_render_slots_active_index_range(
823 "Parameters defining how an Image data-block is used by another data-block");
838 prop,
"Current Frame",
"Current frame number in image sequence or movie");
857 prop,
"Offset",
"Offset the number of the frame to use in the animation");
866 "Global starting frame of the movie/sequence, assuming first picture has a #1");
959 "rna_render_slots_active_index_get",
960 "rna_render_slots_active_index_set",
961 "rna_render_slots_active_index_range");
968 prop,
"rna_render_slots_active_get",
"rna_render_slots_active_set",
nullptr,
nullptr);
975 parm =
RNA_def_string(func,
"name",
nullptr, 0,
"Name",
"New name for the render slot");
976 parm =
RNA_def_pointer(func,
"result",
"RenderSlot",
"",
"Newly created render layer");
993 prop,
"rna_UDIMTile_label_get",
"rna_UDIMTile_label_length",
nullptr);
1010 "Width and height of the tile buffer in pixels, zero when image data can't be loaded",
1081 "rna_Image_active_tile_index_get",
1082 "rna_Image_active_tile_index_set",
1083 "rna_Image_active_tile_index_range");
1089 prop,
"rna_Image_active_tile_get",
"rna_Image_active_tile_set",
nullptr,
nullptr);
1096 func,
"tile_number", 1, 1, INT_MAX,
"",
"Number of the newly created tile", 1, 100);
1098 parm =
RNA_def_string(func,
"label",
nullptr, 0,
"",
"Optional label for the tile");
1099 parm =
RNA_def_pointer(func,
"result",
"UDIMTile",
"",
"Newly created image tile");
1104 parm =
RNA_def_int(func,
"tile_number", 0, 0, INT_MAX,
"",
"Number of the tile", 0, 100);
1111 parm =
RNA_def_pointer(func,
"tile",
"UDIMTile",
"",
"Image tile to remove");
1126 {0,
nullptr, 0,
nullptr,
nullptr},
1133 "Store RGB and alpha channels separately with alpha acting as a mask, also known as "
1134 "unassociated alpha. Commonly used by image editing applications and file formats like "
1140 "Store RGB channels with alpha multiplied in, also known as associated alpha. The natural "
1141 "format for renders and used by file formats like OpenEXR."},
1146 "Different images are packed in the RGB and alpha channels, and they should not "
1147 "affect each other. Channel packing is commonly used by game engines to save memory."},
1152 "Ignore alpha channel from the file and make image fully opaque"},
1153 {0,
nullptr, 0,
nullptr,
nullptr},
1158 srna,
"Image",
"Image data-block referencing an external or packed image");
1175 prop,
"rna_Image_file_format_get",
"rna_Image_file_format_set",
nullptr);
1209 "Apply render part of display transformation when displaying this image on the screen");
1248 prop,
"rna_Image_generated_type_get",
"rna_Image_generated_type_set",
nullptr);
1258 prop,
"rna_Image_generated_width_get",
"rna_Image_generated_width_set",
nullptr);
1268 prop,
"rna_Image_generated_height_get",
"rna_Image_generated_height_set",
nullptr);
1276 prop,
"rna_Image_generated_float_get",
"rna_Image_generated_float_set");
1285 prop,
"rna_Image_generated_color_get",
"rna_Image_generated_color_set",
nullptr);
1296 prop,
"Display Aspect",
"Display Aspect for this image, does not affect rendering");
1335 "Width and height of the image buffer in pixels, zero when image data can't be loaded",
1349 "X/Y pixels per meter, for the image buffer",
1354 prop,
"rna_Image_resolution_get",
"rna_Image_resolution_set",
nullptr);
1359 prop,
"Duration",
"Duration (in frames) of the image (1 when not a video/sequence)");
1382 prop,
"Is Float",
"True if this image is stored in floating-point buffer");
1394 "Representation of alpha in the image file, to convert to and from "
1395 "when saving and loading the image");
1401 "Half Float Precision",
1402 "Use 16 bits per channel to lower the memory usage during rendering");
1409 "Margin to take into account when fixing UV seams during painting. Higher "
1410 "number would improve seam-fixes for mipmaps, but decreases performance.");
RenderSlot * BKE_image_get_renderslot(Image *ima, int index)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_user_frame_calc(Image *ima, ImageUser *iuser, int cfra)
void BKE_image_mark_dirty(Image *image, ImBuf *ibuf)
bool BKE_image_fill_tile(Image *ima, ImageTile *tile)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
bool BKE_image_is_dirty(Image *image)
#define IMA_SIGNAL_COLORMANAGE
int BKE_image_get_tile_label(const Image *ima, const ImageTile *tile, char *label, int label_maxncpy)
bool BKE_image_has_anim(Image *image)
void BKE_imageuser_default(ImageUser *iuser)
void BKE_image_free_gputextures(Image *ima)
#define IMA_SIGNAL_SRC_CHANGE
bool BKE_image_is_stereo(const Image *ima)
bool BKE_image_is_multiview(const Image *ima)
#define IMA_SIGNAL_RELOAD
bool BKE_image_has_packedfile(const Image *image)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
void BKE_image_reassign_tile(Image *ima, ImageTile *tile, int new_tile_number)
bool BKE_image_clear_renderslot(Image *ima, ImageUser *iuser, int slot)
ImageTile * BKE_image_add_tile(Image *ima, int tile_number, const char *label)
void BKE_image_file_format_set(Image *image, int ftype, const ImbFormatOptions *options)
bool BKE_image_remove_tile(Image *ima, ImageTile *tile)
void BKE_image_partial_update_mark_full_update(Image *image)
Mark the whole image to be updated.
bool BKE_image_has_loaded_ibuf(Image *image)
bool BKE_id_is_in_global_main(ID *id)
void BKE_ntree_update_tag_image_user_changed(bNodeTree *ntree, ImageUser *iuser)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE void copy_v4_v4(float r[4], const float a[4])
#define BLT_I18NCONTEXT_ID_IMAGE
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ IMA_ALPHA_CHANNEL_PACKED
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *ntree)
int GPU_texture_opengl_bindcode(const GPUTexture *texture)
int IMB_anim_get_duration(ImBufAnim *anim, IMB_Timecode_Type tc)
Contains defines and structs used throughout the imbuf module.
@ IB_DISPLAY_BUFFER_INVALID
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
#define RNA_MAX_ARRAY_DIMENSION
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
constexpr PointerRNA PointerRNA_NULL
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
CCL_NAMESPACE_BEGIN struct Options options
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int num_tiles
ccl_global const KernelWorkTile * tile
#define unit_float_to_uchar_clamp(val)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_image(BlenderRNA *brna)
static void rna_def_image(BlenderRNA *brna)
static void rna_def_render_slot(BlenderRNA *brna)
static void rna_def_render_slots(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem image_source_items[]
static void rna_def_image_packed_files(BlenderRNA *brna)
static void rna_def_udim_tile(BlenderRNA *brna)
static void rna_def_udim_tiles(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_imageuser(BlenderRNA *brna)
const EnumPropertyItem rna_enum_image_generated_type_items[]
void RNA_api_image(StructRNA *srna)
void RNA_api_image_packed_file(StructRNA *srna)
std::optional< std::string > rna_CameraBackgroundImage_image_or_movieclip_user_path(const PointerRNA *ptr)
std::optional< std::string > rna_Node_ImageUser_path(const PointerRNA *ptr)
const EnumPropertyItem rna_enum_image_type_items[]
const EnumPropertyItem rna_enum_views_format_items[]
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct PackedFile * packedfile
struct ListBase packedfiles
struct GPUTexture * gputexture[3][2]
void * BKE_image_get_tile
void WM_main_add_notifier(uint type, void *reference)