55static void rna_Image_save_render(
Image *image,
64 if (scene ==
nullptr) {
79 reports,
RPT_ERROR,
"Image '%s' could not be saved to '%s'", image->
id.
name + 2, path);
91static void rna_Image_save(
Image *image,
103 if (path && path[0]) {
113 "Image '%s' could not be saved to '%s'",
127static void rna_Image_pack(
134 memcpy(data_dup,
data,
size_t(data_len));
168static void rna_Image_reload(
Image *image,
Main *bmain)
178 if (ibuf ==
nullptr) {
193static void rna_Image_scale(
201 if (
tile !=
nullptr) {
214static int rna_Image_gl_load(
215 Image *image,
ReportList *reports,
int frame,
int layer_index,
int pass_index)
220 iuser.
layer = layer_index;
221 iuser.
pass = pass_index;
222 if (image->
rr !=
nullptr) {
228 if (tex ==
nullptr) {
237static int rna_Image_gl_touch(
238 Image *image,
ReportList *reports,
int frame,
int layer_index,
int pass_index)
245 error = rna_Image_gl_load(image, reports, frame, layer_index, pass_index);
251static void rna_Image_gl_free(
Image *image)
259static void rna_Image_filepath_from_user(
Image *image,
ImageUser *image_user,
char *filepath)
264static void rna_Image_buffers_free(
Image *image)
287 "Save image to a specific path using a scenes render settings");
291 RNA_def_pointer(func,
"scene",
"Scene",
"",
"Scene to take image parameters from");
298 "Quality for image formats that support lossy compression, uses default quality if "
311 "Output path, uses image data-block filepath if not specified");
318 "Quality for image formats that support lossy compression, uses default quality if "
326 "Save the image as a copy, without updating current image's filepath");
339 "length of given data (mandatory if data is provided)",
360 parm =
RNA_def_int(func,
"width", 1, 1, INT_MAX,
"",
"Width", 1, INT_MAX);
362 parm =
RNA_def_int(func,
"height", 1, 1, INT_MAX,
"",
"Height", 1, INT_MAX);
364 RNA_def_int(func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame (for image sequences)", 0, INT_MAX);
366 func,
"tile_index", 0, 0, INT_MAX,
"Tile",
"Tile index (for tiled images)", 0, INT_MAX);
370 func,
"Delay the image from being cleaned from the cache due inactivity");
373 func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame of image sequence or movie", 0, INT_MAX);
380 "Index of layer that should be loaded",
389 "Index of pass that should be loaded",
394 func,
"error", 0, -INT_MAX, INT_MAX,
"Error",
"OpenGL error value", -INT_MAX, INT_MAX);
400 "Load the image into an OpenGL texture. On success, image.bindcode will contain the "
401 "OpenGL texture bindcode. Colors read from the texture will be in scene linear color space "
402 "and have premultiplied or straight alpha matching the image alpha mode.");
405 func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame of image sequence or movie", 0, INT_MAX);
412 "Index of layer that should be loaded",
421 "Index of pass that should be loaded",
426 func,
"error", 0, -INT_MAX, INT_MAX,
"Error",
"OpenGL error value", -INT_MAX, INT_MAX);
433 func =
RNA_def_function(srna,
"filepath_from_user",
"rna_Image_filepath_from_user");
436 "Return the absolute path to the filepath of an image frame specified by the image user");
438 func,
"image_user",
"ImageUser",
"",
"Image user of the image to get filepath for");
444 "The resulting filepath from the image and its user");
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
bool BKE_image_scale(Image *image, int width, int height, ImageUser *iuser)
RenderPass * BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
void BKE_image_user_file_path(const ImageUser *iuser, const Image *ima, char *filepath)
void BKE_image_tag_time(Image *ima)
bool BKE_image_memorypack(Image *ima)
void BKE_image_packfiles(ReportList *reports, Image *ima, const char *basepath)
void BKE_image_free_buffers_ex(Image *image, bool do_lock)
bool BKE_image_is_dirty(Image *image)
void BKE_imageuser_default(ImageUser *iuser)
void BKE_image_free_gputextures(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)
blender::gpu::Texture * BKE_image_get_gpu_texture(Image *image, ImageUser *iuser)
void BKE_image_packfiles_from_mem(ReportList *reports, Image *ima, char *data, size_t data_len)
void BKE_image_partial_update_mark_full_update(Image *image)
Mark the whole image to be updated.
void BKE_image_free_packedfiles(Image *image)
bool BKE_image_save(ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, const ImageSaveOptions *opts)
bool BKE_image_save_options_init(ImageSaveOptions *opts, Main *bmain, Scene *scene, Image *ima, ImageUser *iuser, const bool guess_path, const bool save_as_render)
void BKE_image_save_options_free(ImageSaveOptions *opts)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
int BKE_packedfile_unpack_image(Main *bmain, ReportList *reports, Image *ima, enum ePF_FileStatus how)
int BKE_packedfile_write_to_file(ReportList *reports, const char *ref_file_name, const char *filepath_rel, PackedFile *pf)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int clamp_i(int value, int min, int max)
char * STRNCPY(char(&dst)[N], const char *src)
#define ID_BLEND_PATH(_bmain, _id)
#define ID_IS_EDITABLE(_id)
void IMB_byte_from_float(ImBuf *ibuf)
@ IB_DISPLAY_BUFFER_INVALID
Read Guarded memory(de)allocation.
BMesh const char void * data
const ccl_global KernelWorkTile * tile
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
static void error(const char *str)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_function_flag(FunctionRNA *func, int flag)
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
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_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_api_image(StructRNA *srna)
void RNA_api_image_packed_file(StructRNA *srna)
const EnumPropertyItem rna_enum_unpack_method_items[]
ImBufByteBuffer byte_buffer
struct PackedFile * packedfile
ImageFormatData im_format
GPUTexture * gputexture[3][2]
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)