64 static void rna_Image_save_render(
98 if (write_ibuf != ibuf) {
137 "Image '%s' could not be saved to '%s'",
150 static void rna_Image_pack(
156 char *data_dup =
MEM_mallocN(
sizeof(*data_dup) * (
size_t)data_len, __func__);
157 memcpy(data_dup,
data, (
size_t)data_len);
177 reports,
RPT_ERROR,
"Unpacking movies, image sequences or tiled images not supported");
186 static void rna_Image_reload(
Image *image,
Main *bmain)
217 static int rna_Image_gl_load(
Image *image,
ReportList *reports,
int frame)
234 static int rna_Image_gl_touch(
Image *image,
ReportList *reports,
int frame)
241 error = rna_Image_gl_load(image, reports, frame);
247 static void rna_Image_gl_free(
Image *image)
255 static void rna_Image_filepath_from_user(
Image *image,
ImageUser *image_user,
char *filepath)
260 static void rna_Image_buffers_free(
Image *image)
283 "Save image to a specific path using a scenes render settings");
287 RNA_def_pointer(func,
"scene",
"Scene",
"",
"Scene to take image parameters from");
304 "length of given data (mandatory if data is provided)",
325 parm =
RNA_def_int(func,
"width", 1, 1, INT_MAX,
"",
"Width", 1, INT_MAX);
327 parm =
RNA_def_int(func,
"height", 1, 1, INT_MAX,
"",
"Height", 1, INT_MAX);
332 func,
"Delay the image from being cleaned from the cache due inactivity");
335 func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame of image sequence or movie", 0, INT_MAX);
338 func,
"error", 0, -INT_MAX, INT_MAX,
"Error",
"OpenGL error value", -INT_MAX, INT_MAX);
344 "Load the image into an OpenGL texture. On success, image.bindcode will contain the "
345 "OpenGL texture bindcode. Colors read from the texture will be in scene linear color space "
346 "and have premultiplied or straight alpha matching the image alpha mode");
349 func,
"frame", 0, 0, INT_MAX,
"Frame",
"Frame of image sequence or movie", 0, INT_MAX);
352 func,
"error", 0, -INT_MAX, INT_MAX,
"Error",
"OpenGL error value", -INT_MAX, INT_MAX);
359 func =
RNA_def_function(srna,
"filepath_from_user",
"rna_Image_filepath_from_user");
362 "Return the absolute path to the filepath of an image frame specified by the image user");
364 func,
"image_user",
"ImageUser",
"",
"Image user of the image to get filepath for");
370 "The resulting filepath from the image and its user");
struct Scene * CTX_data_scene(const bContext *C)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
void BKE_image_user_file_path(struct ImageUser *iuser, struct Image *ima, char *path)
void BKE_image_free_buffers_ex(struct Image *image, bool do_lock)
bool BKE_image_has_packedfile(struct Image *image)
int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
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)
void BKE_image_packfiles_from_mem(struct ReportList *reports, struct Image *ima, char *data, const size_t data_len)
void BKE_image_free_gputextures(struct Image *ima)
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_free_packedfiles(struct Image *image)
void BKE_imageuser_default(struct ImageUser *iuser)
void BKE_image_tag_time(struct Image *ima)
bool BKE_image_has_multiple_ibufs(struct Image *image)
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 *filename, struct PackedFile *pf, const bool guimode)
int BKE_packedfile_unpack_image(struct Main *bmain, struct ReportList *reports, struct Image *ima, enum ePF_FileStatus how)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#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 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
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
struct GPUTexture GPUTexture
void IMB_colormanagement_colorspace_from_ibuf_ftype(struct ColorManagedColorspaceSettings *colorspace_settings, struct ImBuf *ibuf)
struct ImBuf * IMB_colormanagement_imbuf_for_write(struct ImBuf *ibuf, bool save_as_render, bool allocate_result, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, struct ImageFormatData *image_format_data)
void IMB_rect_from_float(struct ImBuf *ibuf)
void IMB_freeImBuf(struct ImBuf *ibuf)
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
@ IB_DISPLAY_BUFFER_INVALID
Read Guarded memory(de)allocation.
ColorManagedColorspaceSettings colorspace_settings
struct GPUTexture * gputexture[3][2]
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
struct ImageFormatData im_format
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)