71 if (scene ==
nullptr) {
78 opts.save_copy =
true;
81 opts.im_format.quality =
clamp_i(quality, 0, 100);
86 reports,
RPT_ERROR,
"Image '%s' could not be saved to '%s'",
image->id.name + 2, path);
104 const bool save_copy)
110 if (path && path[0]) {
114 opts.im_format.quality =
clamp_i(quality, 0, 100);
116 opts.save_copy = save_copy;
120 "Image '%s' could not be saved to '%s'",
134static void rna_Image_pack(
172 if (ibuf ==
nullptr) {
177 if (ibuf->byte_data()) {
186static void rna_Image_scale(
191 iuser.framenr = frame;
194 if (
tile !=
nullptr) {
195 iuser.tile =
tile->tile_number;
206static int rna_Image_gl_load(
211 iuser.framenr = frame;
212 iuser.layer = layer_index;
213 iuser.pass = pass_index;
214 if (
image->rr !=
nullptr) {
220 if (tex ==
nullptr) {
231static int rna_Image_gl_touch(
236 return rna_Image_gl_load(
image, reports, frame, layer_index, pass_index);
247static void rna_Image_filepath_from_user(
Image *
image,
ImageUser *image_user,
char *filepath)
252static void rna_Image_buffers_free(
Image *
image)
279 "Save image to a specific path using a scenes render settings");
283 RNA_def_pointer(func,
"scene",
"Scene",
"",
"Scene to take image parameters from");
290 "Quality for image formats that support lossy compression, uses default quality if "
303 "Output path, uses image data-block filepath if not specified");
310 "Quality for image formats that support lossy compression, uses default quality if "
318 "Save the image as a copy, without updating current image's filepath");
331 "length of given data (mandatory if data is provided)",
358 func,
"tile_index", 0, 0,
INT_MAX,
"Tile",
"Tile index (for tiled images)", 0,
INT_MAX);
362 func,
"Delay the image from being cleaned from the cache due inactivity");
365 func,
"frame", 0, 0,
INT_MAX,
"Frame",
"Frame of image sequence or movie", 0,
INT_MAX);
372 "Index of layer that should be loaded",
381 "Index of pass that should be loaded",
386 func,
"error", 0, INT_MIN,
INT_MAX,
"Error",
"OpenGL error value", INT_MIN,
INT_MAX);
392 "Load the image into an OpenGL texture. On success, image.bindcode will contain the "
393 "OpenGL texture bindcode. Colors read from the texture will be in scene linear color space "
394 "and have premultiplied or straight alpha matching the image alpha mode.");
397 func,
"frame", 0, 0,
INT_MAX,
"Frame",
"Frame of image sequence or movie", 0,
INT_MAX);
404 "Index of layer that should be loaded",
413 "Index of pass that should be loaded",
418 func,
"error", 0, INT_MIN,
INT_MAX,
"Error",
"OpenGL error value", INT_MIN,
INT_MAX);
425 func =
RNA_def_function(srna,
"filepath_from_user",
"rna_Image_filepath_from_user");
428 "Return the absolute path to the filepath of an image frame specified by the image user");
430 func,
"image_user",
"ImageUser",
"",
"Image user of the image to get filepath for");
436 "The resulting filepath from the image and its user");
#define IMA_SIGNAL_RELOAD
#define ID_IS_EDITABLE(_id)
Read Blender memory allocation and freeing.
const ccl_global KernelWorkTile * tile
void WM_main_add_notifier(uint type, void *reference)
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)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
char * STRNCPY(char(&dst)[N], const char *src)
bool BKE_image_scale(Image *image, int width, int height, ImageUser *iuser)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_api_image_packed_file(StructRNA *srna)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
void BKE_image_free_gpu_texture_caches(Image *ima)
void RNA_def_function_ui_description(FunctionRNA *func, 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)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void BKE_image_user_file_path(const ImageUser *iuser, const Image *ima, char *filepath)
bool BKE_image_save_options_init(ImageSaveOptions *opts, Main *bmain, Scene *scene, Image *ima, ImageUser *iuser, bool guess_path, bool save_as_render)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
RenderPass * BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
void BKE_report(ReportList *reports, eReportType type, const char *message)
int BKE_packedfile_unpack_image(Main *bmain, ReportList *reports, Image *ima, enum ePF_FileStatus how)
BMesh const char void * data
void BKE_image_free_buffers_ex(Image *image, bool do_lock)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void IMB_partial_update_mark_full(ImBuf *ibuf)
const EnumPropertyItem rna_enum_unpack_method_items[]
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_packfile_ensure(Main *bmain, Image *image, ReportList *reports, const char *data, int data_len)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
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 BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Main * CTX_data_main(const bContext *C)
void IMB_byte_from_float(ImBuf *ibuf)
void GPU_texture_free(gpu::Texture *texture)
void BKE_image_save_options_free(ImageSaveOptions *opts)
Scene * CTX_data_scene(const bContext *C)
gpu::Texture * BKE_image_acquire_gpu_texture(Image *image, ImageUser *iuser)
bool BKE_image_has_packedfile(const Image *image)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_api_image(StructRNA *srna)
void BKE_imageuser_default(ImageUser *iuser)
MINLINE int clamp_i(int value, int min, int max)
bool BKE_image_save(ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, const ImageSaveOptions *opts)
int BKE_packedfile_write_to_file(ReportList *reports, const char *ref_file_name, const char *filepath_rel, PackedFile *pf)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)