48 memset(opts, 0,
sizeof(*opts));
63 bool *r_colorspace_changed)
117 *r_colorspace_changed =
true;
123 if (colormanaged_ibuf != ibuf) {
145 bool *r_colorspace_changed)
188 int layer = (iuser && !is_multilayer) ? iuser->
layer : -1;
203 "Did not write, the image doesn't have a \"%s\" and \"%s\" views",
215 "Did not write, the image doesn't have a \"%s\" and \"%s\" views",
248 (is_exr_rr ?
true : save_copy),
250 r_colorspace_changed);
255 unsigned char planes = ibuf->
planes;
262 for (
int i = 0; i < totviews; i++) {
264 bool ok_view =
false;
271 image_save_post(reports, ima, ibuf, ok_view, opts,
true, filepath, r_colorspace_changed);
304 image_save_post(reports, ima, ibuf, ok_view, opts,
true, filepath, r_colorspace_changed);
324 unsigned char planes = ibuf->
planes;
330 for (
int i = 0; i < 2; i++) {
356 reports,
RPT_ERROR,
"Did not write, unexpected error when saving stereo image");
383 for (
int i = 0; i < 2; i++) {
403 bool colorspace_changed =
false;
410 "When saving a tiled image, the path '%s' must contain the UDIM tag 1001",
429 unsigned short numlen;
435 if (tile->tile_number == 1001 || !ok) {
442 iuser->
tile = tile->tile_number;
448 if (colorspace_changed) {
void BKE_image_multiview_index(struct Image *ima, struct ImageUser *iuser)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
int BKE_imbuf_write_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const bool save_copy)
bool BKE_image_is_stereo(struct Image *ima)
struct RenderResult * BKE_image_acquire_renderresult(struct Scene *scene, struct Image *ima)
void BKE_imformat_defaults(struct ImageFormatData *im_format)
bool BKE_imbuf_alpha_test(struct ImBuf *ibuf)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_imbuf_stamp_info(struct RenderResult *rr, struct ImBuf *ibuf)
void BKE_imbuf_write_prepare(struct ImBuf *ibuf, const struct ImageFormatData *imf)
struct RenderPass * BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser)
#define IMA_SIGNAL_COLORMANAGE
void BKE_image_signal(struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
void BKE_image_release_renderresult(struct Scene *scene, struct Image *ima)
void BKE_imageuser_default(struct ImageUser *iuser)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_scene_multiview_view_filepath_get(const struct RenderData *rd, const char *filepath, const char *view, char *r_filepath)
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count_at_most(const struct ListBase *listbase, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findstringindex(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_path_sequence_decode(const char *string, char *head, char *tail, unsigned short *r_num_len)
void BLI_path_sequence_encode(char *string, const char *head, const char *tail, unsigned short numlen, int pic)
void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define ID_BLEND_PATH(_bmain, _id)
#define R_IMF_IMTYPE_MULTILAYER
#define R_IMF_PLANES_RGBA
#define STEREO_RIGHT_NAME
#define R_IMF_IMTYPE_OPENEXR
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_freerectfloatImBuf(struct ImBuf *ibuf)
void IMB_freezbuffloatImBuf(struct ImBuf *ibuf)
struct ImBuf * IMB_dupImBuf(const struct ImBuf *ibuf1)
void IMB_freeImBuf(struct ImBuf *ibuf)
bool IMB_prepare_write_ImBuf(const bool isfloat, struct ImBuf *ibuf)
void imb_freerectImBuf(struct ImBuf *ibuf)
void IMB_freezbufImBuf(struct ImBuf *ibuf)
struct ImBuf * IMB_stereo3d_ImBuf(struct ImageFormatData *im_format, struct ImBuf *ibuf_left, struct ImBuf *ibuf_right)
bool IMB_isfloat(const struct ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
ColorManagedColorspaceSettings colorspace_settings
static void imbuf_save_post(ImBuf *ibuf, ImBuf *colormanaged_ibuf)
static void image_save_post(ReportList *reports, Image *ima, ImBuf *ibuf, int ok, ImageSaveOptions *opts, int save_copy, const char *filepath, bool *r_colorspace_changed)
bool BKE_image_save(ReportList *reports, Main *bmain, Image *ima, ImageUser *iuser, ImageSaveOptions *opts)
static bool image_save_single(ReportList *reports, Image *ima, ImageUser *iuser, ImageSaveOptions *opts, bool *r_colorspace_changed)
void BKE_image_save_options_init(ImageSaveOptions *opts, Main *bmain, Scene *scene)
bool RE_WriteRenderResult(ReportList *reports, RenderResult *rr, const char *filename, ImageFormatData *imf, const char *view, int layer)
bool RE_HasFloatPixels(RenderResult *rr)
ImbFormatOptions foptions
char name[IMB_FILENAME_SIZE]
struct ImageFormatData im_format