44 memcpy(imf_dst, imf_src,
sizeof(*imf_dst));
66 format->linear_colorspace_settings.name);
70 if (
format->linear_colorspace_settings.name[0] ==
'\0' || image_requires_linear != is_linear) {
91 format->media_type = media_type;
134 const bool is_render = (owner_id &&
GS(owner_id->
name) ==
ID_SCE);
150 if ((imf->
depth & depth_ok) == 0) {
156 Scene *scene =
reinterpret_cast<Scene *
>(owner_id);
180 memset(r_options, 0,
sizeof(*r_options));
212#ifdef WITH_IMAGE_CINEON
214 return IMB_FTYPE_CINEON;
217 return IMB_FTYPE_DPX;
220#ifdef WITH_IMAGE_OPENJPEG
222 r_options->
flag |= JP2_JP2;
224 return IMB_FTYPE_JP2;
227#ifdef WITH_IMAGE_WEBP
230 return IMB_FTYPE_WEBP;
264#ifdef WITH_IMAGE_CINEON
265 if (ftype == IMB_FTYPE_CINEON) {
268 if (ftype == IMB_FTYPE_DPX) {
279#ifdef WITH_IMAGE_OPENJPEG
280 if (ftype == IMB_FTYPE_JP2) {
284#ifdef WITH_IMAGE_WEBP
285 if (ftype == IMB_FTYPE_WEBP) {
413 const bool is_render_out = (owner_id &&
GS(owner_id->
name) ==
ID_SCE);
425 const char depth_ls[] = {
435 for (
int i = 0; depth_ls[
i];
i++) {
436 if (valid_depths & depth_ls[
i]) {
445 if (
STREQ(imtype_arg,
"TGA")) {
448 if (
STREQ(imtype_arg,
"IRIS")) {
451 if (
STREQ(imtype_arg,
"JPEG")) {
454 if (
STREQ(imtype_arg,
"RAWTGA")) {
457 if (
STREQ(imtype_arg,
"PNG")) {
460 if (
STREQ(imtype_arg,
"BMP")) {
463 if (
STREQ(imtype_arg,
"HDR")) {
466 if (
STREQ(imtype_arg,
"TIFF")) {
469#ifdef WITH_IMAGE_OPENEXR
470 if (
STREQ(imtype_arg,
"OPEN_EXR")) {
473 if (
STREQ(imtype_arg,
"OPEN_EXR_MULTILAYER")) {
476 if (
STREQ(imtype_arg,
"EXR")) {
479 if (
STREQ(imtype_arg,
"MULTILAYER")) {
484 if (
STREQ(imtype_arg,
"FFMPEG")) {
488#ifdef WITH_IMAGE_CINEON
489 if (
STREQ(imtype_arg,
"CINEON")) {
492 if (
STREQ(imtype_arg,
"DPX")) {
496#ifdef WITH_IMAGE_OPENJPEG
497 if (
STREQ(imtype_arg,
"JP2")) {
501#ifdef WITH_IMAGE_WEBP
502 if (
STREQ(imtype_arg,
"WEBP")) {
520 r_ext[ext_num++] =
".rgb";
523 r_ext[ext_num++] =
".rgb";
526 r_ext[ext_num++] =
".hdr";
529 r_ext[ext_num++] =
".png";
532 r_ext[ext_num++] =
".dds";
535 r_ext[ext_num++] =
".tga";
538 r_ext[ext_num++] =
".bmp";
541 r_ext[ext_num++] =
".tif";
542 r_ext[ext_num++] =
".tiff";
545 r_ext[ext_num++] =
".psd";
547#ifdef WITH_IMAGE_OPENEXR
549 r_ext[ext_num++] =
".exr";
552#ifdef WITH_IMAGE_CINEON
554 r_ext[ext_num++] =
".cin";
557 r_ext[ext_num++] =
".dpx";
560#ifdef WITH_IMAGE_OPENJPEG
564 r_ext[ext_num++] =
".jp2";
567 r_ext[ext_num++] =
".j2c";
570 BLI_assert_msg(0,
"Unsupported jp2 codec was specified in im_format->jp2_codec");
574 r_ext[ext_num++] =
".jp2";
578#ifdef WITH_IMAGE_WEBP
580 r_ext[ext_num++] =
".webp";
585 r_ext[ext_num++] =
".jpg";
586 r_ext[ext_num++] =
".jpeg";
589 r_ext[ext_num] =
nullptr;
605 const size_t filepath_maxncpy,
625 const size_t filepath_maxncpy,
632 const size_t filepath_maxncpy,
647 const bool use_frames,
650 if (filepath ==
nullptr) {
655 if (template_variables) {
657 filepath,
FILE_MAX, *template_variables);
659 return variable_errors;
688 const bool use_frames,
711 const bool use_frames,
731 char imtype = imf->
imtype;
780#ifdef WITH_IMAGE_OPENEXR
793#ifdef WITH_IMAGE_CINEON
795 ibuf->
ftype = IMB_FTYPE_CINEON;
810 ibuf->
ftype = IMB_FTYPE_DPX;
832#ifdef WITH_IMAGE_OPENJPEG
837 ibuf->
ftype = IMB_FTYPE_JP2;
865 BLI_assert_msg(0,
"Unsupported jp2 codec was specified in im_format->jp2_codec");
869#ifdef WITH_IMAGE_WEBP
871 ibuf->
ftype = IMB_FTYPE_WEBP;
926 int ftype = imbuf->
ftype;
929 bool is_depth_set =
false;
977#ifdef WITH_IMAGE_OPENEXR
998#ifdef WITH_IMAGE_CINEON
999 else if (ftype == IMB_FTYPE_CINEON) {
1002 else if (ftype == IMB_FTYPE_DPX) {
1007 if (custom_flags &
RAWTGA) {
1014#ifdef WITH_IMAGE_OPENJPEG
1015 else if (ftype == IMB_FTYPE_JP2) {
1019 if (custom_flags & JP2_16BIT) {
1021 is_depth_set =
true;
1023 else if (custom_flags & JP2_12BIT) {
1025 is_depth_set =
true;
1028 if (custom_flags & JP2_YCC) {
1032 if (custom_flags & JP2_CINE) {
1034 if (custom_flags & JP2_CINE_48FPS) {
1039 if (custom_flags & JP2_JP2) {
1042 else if (custom_flags & JP2_J2K) {
1046 BLI_assert_msg(0,
"Unsupported jp2 codec was specified in file type");
1050#ifdef WITH_IMAGE_WEBP
1051 else if (ftype == IMB_FTYPE_WEBP) {
1063 if (!is_depth_set) {
1101 const Scene *scene_src,
1103 const bool allow_video)
1105 *imf = (imf_src) ? *imf_src : scene_src->
r.
im_format;
Functions and classes for evaluating template expressions in filepaths.
blender::Vector< blender::bke::path_templates::Error > BKE_path_apply_template(char *path, int path_maxncpy, const blender::bke::path_templates::VariableMap &template_variables)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool bool BLI_path_suffix(char *path, size_t path_maxncpy, const char *suffix, const char *sep) ATTR_NONNULL(1
bool BLI_path_extension_check_array(const char *path, const char **ext_array) ATTR_NONNULL(1
bool BLI_path_extension_replace(char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1
bool BLI_path_extension_ensure(char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1
bool BLI_path_frame(char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define DNA_struct_default_get(struct_name)
@ MEDIA_TYPE_MULTI_LAYER_IMAGE
@ R_IMF_JP2_FLAG_CINE_PRESET
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_COLOR_MANAGEMENT_OVERRIDE
@ R_IMF_EXR_FLAG_MULTIPART
@ R_IMF_IMTYPE_MULTILAYER
bool IMB_colormanagement_space_name_is_scene_linear(const char *name)
@ COLOR_ROLE_DEFAULT_FLOAT
@ COLOR_ROLE_DEFAULT_BYTE
@ COLOR_ROLE_SCENE_LINEAR
bool IMB_colormanagement_space_name_is_data(const char *name)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
#define TIF_COMPRESS_PACKBITS
#define TIF_COMPRESS_NONE
#define TIF_COMPRESS_DEFLATE
#define OPENEXR_CODEC_MASK
#define OPENEXR_MULTIPART
const char * imb_ext_image[]
CCL_NAMESPACE_BEGIN struct Options options
int MOV_codec_valid_bit_depths(IMB_Ffmpeg_Codec_ID codec_id)
void MOV_validate_output_settings(RenderData *rd, const ImageFormatData *imf)
ImBufFloatBuffer float_buffer
ImbFormatOptions foptions
struct ImageFormatData im_format
struct FFMpegCodecData ffcodecdata
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings