51 static void rna_Image_save_render(
68 reports,
RPT_ERROR,
"Image '%s' could not be saved to '%s'",
image->id.name + 2, path);
89 "Image '%s' could not be saved to '%s'",
103 static void rna_Image_pack(
109 char *data_dup =
MEM_mallocN(
sizeof(*data_dup) * (
size_t)data_len, __func__);
110 memcpy(data_dup,
data, (
size_t)data_len);
173 static int rna_Image_gl_load(
179 iuser.
layer = layer_index;
180 iuser.
pass = pass_index;
196 static int rna_Image_gl_touch(
204 error = rna_Image_gl_load(
image, reports, frame, layer_index, pass_index);
218 static void rna_Image_filepath_from_user(
Image *
image,
ImageUser *image_user,
char *filepath)
223 static void rna_Image_buffers_free(
Image *
image)
246 "Save image to a specific path using a scenes render settings");
250 RNA_def_pointer(func,
"scene",
"Scene",
"",
"Scene to take image parameters from");
267 "length of given data (mandatory if data is provided)",
288 parm =
RNA_def_int(func,
"width", 1, 1, INT_MAX,
"",
"Width", 1, INT_MAX);
290 parm =
RNA_def_int(func,
"height", 1, 1, INT_MAX,
"",
"Height", 1, INT_MAX);
295 func,
"Delay the image from being cleaned from the cache due inactivity");
298 func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame of image sequence or movie", 0, INT_MAX);
305 "Index of layer that should be loaded",
314 "Index of pass that should be loaded",
319 func,
"error", 0, -INT_MAX, INT_MAX,
"Error",
"OpenGL error value", -INT_MAX, INT_MAX);
325 "Load the image into an OpenGL texture. On success, image.bindcode will contain the "
326 "OpenGL texture bindcode. Colors read from the texture will be in scene linear color space "
327 "and have premultiplied or straight alpha matching the image alpha mode");
330 func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame of image sequence or movie", 0, INT_MAX);
337 "Index of layer that should be loaded",
346 "Index of pass that should be loaded",
351 func,
"error", 0, -INT_MAX, INT_MAX,
"Error",
"OpenGL error value", -INT_MAX, INT_MAX);
358 func =
RNA_def_function(srna,
"filepath_from_user",
"rna_Image_filepath_from_user");
361 "Return the absolute path to the filepath of an image frame specified by the image user");
363 func,
"image_user",
"ImageUser",
"",
"Image user of the image to get filepath for");
369 "The resulting filepath from the image and its user");
struct Scene * CTX_data_scene(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
void BKE_image_free_buffers_ex(struct Image *image, bool do_lock)
void BKE_image_user_file_path(const struct ImageUser *iuser, const struct Image *ima, char *path)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_image_partial_update_mark_full_update(struct Image *image)
Mark the whole image to be updated.
bool BKE_image_scale(struct Image *image, int width, int height)
void BKE_image_packfiles(struct ReportList *reports, struct Image *ima, const char *basepath)
bool BKE_image_memorypack(struct Image *ima)
struct RenderPass * BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser)
void BKE_image_free_gputextures(struct Image *ima)
bool BKE_image_has_packedfile(const struct Image *image)
struct GPUTexture * BKE_image_get_gpu_texture(struct Image *image, struct ImageUser *iuser, struct ImBuf *ibuf)
bool BKE_image_is_dirty(struct Image *image)
#define IMA_SIGNAL_RELOAD
void BKE_image_signal(struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
void BKE_image_packfiles_from_mem(struct ReportList *reports, struct Image *ima, char *data, size_t data_len)
void BKE_image_free_packedfiles(struct Image *image)
void BKE_imageuser_default(struct ImageUser *iuser)
void BKE_image_tag_time(struct Image *ima)
bool BKE_image_save(struct ReportList *reports, struct Main *bmain, struct Image *ima, struct ImageUser *iuser, const struct ImageSaveOptions *opts)
bool BKE_image_save_options_init(ImageSaveOptions *opts, struct Main *bmain, struct Scene *scene, struct Image *ima, struct ImageUser *iuser, const bool guess_path, const bool save_as_render)
void BKE_image_save_options_free(struct ImageSaveOptions *opts)
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
int BKE_packedfile_write_to_file(struct ReportList *reports, const char *ref_file_name, const char *filepath, struct PackedFile *pf, bool guimode)
int BKE_packedfile_unpack_image(struct Main *bmain, struct ReportList *reports, struct Image *ima, enum ePF_FileStatus how)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define STRNCPY(dst, src)
#define ID_BLEND_PATH(_bmain, _id)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
struct GPUTexture GPUTexture
void IMB_rect_from_float(struct ImBuf *ibuf)
@ IB_DISPLAY_BUFFER_INVALID
Read Guarded memory(de)allocation.
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
void *(* MEM_mallocN)(size_t len, const char *str)
static void error(const char *str)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
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_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_function_output(FunctionRNA *UNUSED(func), PropertyRNA *ret)
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_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
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[]
struct PackedFile * packedfile
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)