26 {
IMA_GENTYPE_GRID,
"UV_GRID", 0,
"UV Grid",
"Generated grid to test UV mappings"},
31 "Generated improved UV grid to test UV mappings"},
32 {0,
nullptr, 0,
nullptr,
nullptr},
36 {
IMA_SRC_FILE,
"FILE", 0,
"Single Image",
"Single image file"},
37 {
IMA_SRC_SEQUENCE,
"SEQUENCE", 0,
"Image Sequence",
"Multiple image files, as a sequence"},
40 {
IMA_SRC_VIEWER,
"VIEWER", 0,
"Viewer",
"Compositing node viewer"},
41 {
IMA_SRC_TILED,
"TILED", 0,
"UDIM Tiles",
"Tiled UDIM image texture"},
42 {0,
nullptr, 0,
nullptr,
nullptr},
48# include <fmt/format.h>
95 if (value != ima->source) {
125static void rna_Image_generated_type_set(
PointerRNA *
ptr,
int value)
136 return base_tile->
gen_x;
139static void rna_Image_generated_width_set(
PointerRNA *
ptr,
int value)
143 base_tile->
gen_x = std::clamp(value, 1, 65536);
150 return base_tile->
gen_y;
153static void rna_Image_generated_height_set(
PointerRNA *
ptr,
int value)
157 base_tile->
gen_y = std::clamp(value, 1, 65536);
167static void rna_Image_generated_float_set(
PointerRNA *
ptr,
bool value)
179void rna_Image_generated_color_get(
PointerRNA *
ptr,
float values[4])
186void rna_Image_generated_color_set(
PointerRNA *
ptr,
const float values[4])
221 rna_Image_colormanage_update(bmain, scene,
ptr);
246 ID *
id =
ptr->owner_id;
248 if (scene !=
nullptr) {
268 rna_ImageUser_update(bmain, scene,
ptr);
272static std::optional<std::string> rna_ImageUser_path(
const PointerRNA *
ptr)
275 switch (
GS(
ptr->owner_id->name)) {
292 if (&sima->
iuser == iuser) {
293 return fmt::format(
"areas[{}].spaces[{}].image_user", area_index, space_index);
298 return " ... image_user";
357static void rna_Image_file_format_set(
PointerRNA *
ptr,
int value)
367static void rna_UDIMTile_size_get(
PointerRNA *
ptr,
int *values)
374 image_user.
tile =
tile->tile_number;
397 image_user.
tile =
tile->tile_number;
412static void rna_UDIMTile_label_get(
PointerRNA *
ptr,
char *value)
418 char value_buf[
sizeof(
tile->label)];
420 memcpy(value, value_buf,
len + 1);
428 char label[
sizeof(
tile->label)];
432static void rna_UDIMTile_tile_number_set(
PointerRNA *
ptr,
int value)
439 if (cur_tile ==
nullptr) {
459 return image->active_tile_index;
462static void rna_Image_active_tile_index_set(
PointerRNA *
ptr,
int value)
470static void rna_Image_active_tile_index_range(
495 image->active_tile_index = index;
525static void rna_Image_resolution_get(
PointerRNA *
ptr,
float *values)
533 values[0] = ibuf->
ppm[0];
534 values[1] = ibuf->
ppm[1];
544static void rna_Image_resolution_set(
PointerRNA *
ptr,
const float *values)
552 ibuf->
ppm[0] = values[0];
553 ibuf->
ppm[1] = values[1];
572 planes = ibuf->
planes * 4;
625static void rna_Image_pixels_get(
PointerRNA *
ptr,
float *values)
640 for (
size_t i = 0;
i <
size;
i++) {
649static void rna_Image_pixels_set(
PointerRNA *
ptr,
const float *values)
664 for (
size_t i = 0;
i <
size;
i++) {
707 bool is_float =
false;
752 if (value.owner_id == &image->id) {
756 image->render_slot = index;
765 return image->render_slot;
768static void rna_render_slots_active_index_set(
PointerRNA *
ptr,
int value)
772 image->render_slot = value;
774 CLAMP(image->render_slot, 0, num_slots - 1);
777static void rna_render_slots_active_index_range(
785static ImageTile *rna_UDIMTile_new(
Image *image,
int tile_number,
const char *label)
813 "Parameters defining how an Image data-block is used by another data-block");
828 prop,
"Current Frame",
"Current frame number in image sequence or movie");
847 prop,
"Offset",
"Offset the number of the frame to use in the animation");
856 "Global starting frame of the movie/sequence, assuming first picture has a #1");
950 "rna_render_slots_active_index_get",
951 "rna_render_slots_active_index_set",
952 "rna_render_slots_active_index_range");
959 prop,
"rna_render_slots_active_get",
"rna_render_slots_active_set",
nullptr,
nullptr);
966 parm =
RNA_def_string(func,
"name",
nullptr, 0,
"Name",
"New name for the render slot");
967 parm =
RNA_def_pointer(func,
"result",
"RenderSlot",
"",
"Newly created render layer");
984 prop,
"rna_UDIMTile_label_get",
"rna_UDIMTile_label_length",
nullptr);
1001 "Width and height of the tile buffer in pixels, zero when image data cannot be loaded",
1072 "rna_Image_active_tile_index_get",
1073 "rna_Image_active_tile_index_set",
1074 "rna_Image_active_tile_index_range");
1080 prop,
"rna_Image_active_tile_get",
"rna_Image_active_tile_set",
nullptr,
nullptr);
1087 func,
"tile_number", 1, 1, INT_MAX,
"",
"Number of the newly created tile", 1, 100);
1089 parm =
RNA_def_string(func,
"label",
nullptr, 0,
"",
"Optional label for the tile");
1090 parm =
RNA_def_pointer(func,
"result",
"UDIMTile",
"",
"Newly created image tile");
1095 parm =
RNA_def_int(func,
"tile_number", 0, 0, INT_MAX,
"",
"Number of the tile", 0, 100);
1102 parm =
RNA_def_pointer(func,
"tile",
"UDIMTile",
"",
"Image tile to remove");
1117 {0,
nullptr, 0,
nullptr,
nullptr},
1124 "Store RGB and alpha channels separately with alpha acting as a mask, also known as "
1125 "unassociated alpha. Commonly used by image editing applications and file formats like "
1131 "Store RGB channels with alpha multiplied in, also known as associated alpha. The natural "
1132 "format for renders and used by file formats like OpenEXR."},
1137 "Different images are packed in the RGB and alpha channels, and they should not "
1138 "affect each other. Channel packing is commonly used by game engines to save memory."},
1143 "Ignore alpha channel from the file and make image fully opaque"},
1144 {0,
nullptr, 0,
nullptr,
nullptr},
1149 srna,
"Image",
"Image data-block referencing an external or packed image");
1168 prop,
"rna_Image_file_format_get",
"rna_Image_file_format_set",
nullptr);
1202 "Apply render part of display transformation when displaying this image on the screen");
1241 prop,
"rna_Image_generated_type_get",
"rna_Image_generated_type_set",
nullptr);
1251 prop,
"rna_Image_generated_width_get",
"rna_Image_generated_width_set",
nullptr);
1261 prop,
"rna_Image_generated_height_get",
"rna_Image_generated_height_set",
nullptr);
1269 prop,
"rna_Image_generated_float_get",
"rna_Image_generated_float_set");
1278 prop,
"rna_Image_generated_color_get",
"rna_Image_generated_color_set",
nullptr);
1289 prop,
"Display Aspect",
"Display Aspect for this image, does not affect rendering");
1322 "Width and height of the image buffer in pixels, zero when image data cannot be loaded",
1336 "X/Y pixels per meter, for the image buffer",
1341 prop,
"rna_Image_resolution_get",
"rna_Image_resolution_set",
nullptr);
1346 prop,
"Duration",
"Duration (in frames) of the image (1 when not a video/sequence)");
1369 prop,
"Is Float",
"True if this image is stored in floating-point buffer");
1381 "Representation of alpha in the image file, to convert to and from "
1382 "when saving and loading the image");
1388 "Half Float Precision",
1389 "Use 16 bits per channel to lower the memory usage during rendering");
1396 "Margin to take into account when fixing UV seams during painting. Higher "
1397 "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_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
void BKE_ntree_update_tag_image_user_changed(bNodeTree *ntree, ImageUser *iuser)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_listbase_count(const 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
size_t IMB_get_pixel_count(const ImBuf *ibuf)
Get the length of the data of the given image buffer in pixels.
@ IB_DISPLAY_BUFFER_INVALID
#define RNA_MAX_ARRAY_DIMENSION
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
CCL_NAMESPACE_BEGIN struct Options options
float length(VecOp< float, D >) RET
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int num_tiles
const ccl_global KernelWorkTile * tile
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
int MOV_get_duration_frames(MovieReader *anim, IMB_Timecode_Type tc)
const PointerRNA PointerRNA_NULL
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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_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_all_items[]
const EnumPropertyItem rna_enum_views_format_items[]
ImBufFloatBuffer float_buffer
ImbFormatOptions foptions
ImBufByteBuffer byte_buffer
struct PackedFile * packedfile
void * BKE_image_get_tile
void WM_main_add_notifier(uint type, void *reference)