45 memcpy(imf_dst, imf_src,
sizeof(*imf_dst));
67 format->linear_colorspace_settings.name);
71 if (
format->linear_colorspace_settings.name[0] ==
'\0' || image_requires_linear != is_linear) {
74 STRNCPY(
format->linear_colorspace_settings.name, default_color_space);
92 memset(r_options, 0,
sizeof(*r_options));
125 return IMB_FTYPE_CINEON;
128 return IMB_FTYPE_DPX;
133 r_options->
flag |= JP2_JP2;
135 return IMB_FTYPE_JP2;
141 return IMB_FTYPE_WEBP;
176 if (ftype == IMB_FTYPE_CINEON) {
179 if (ftype == IMB_FTYPE_DPX) {
191 if (ftype == IMB_FTYPE_JP2) {
196 if (ftype == IMB_FTYPE_WEBP) {
324 if (
STREQ(imtype_arg,
"TGA")) {
327 if (
STREQ(imtype_arg,
"IRIS")) {
330 if (
STREQ(imtype_arg,
"JPEG")) {
333 if (
STREQ(imtype_arg,
"RAWTGA")) {
336 if (
STREQ(imtype_arg,
"AVIRAW")) {
339 if (
STREQ(imtype_arg,
"AVIJPEG")) {
342 if (
STREQ(imtype_arg,
"PNG")) {
345 if (
STREQ(imtype_arg,
"BMP")) {
348 if (
STREQ(imtype_arg,
"HDR")) {
351 if (
STREQ(imtype_arg,
"TIFF")) {
355 if (
STREQ(imtype_arg,
"OPEN_EXR")) {
358 if (
STREQ(imtype_arg,
"OPEN_EXR_MULTILAYER")) {
361 if (
STREQ(imtype_arg,
"EXR")) {
364 if (
STREQ(imtype_arg,
"MULTILAYER")) {
369 if (
STREQ(imtype_arg,
"FFMPEG")) {
374 if (
STREQ(imtype_arg,
"CINEON")) {
377 if (
STREQ(imtype_arg,
"DPX")) {
382 if (
STREQ(imtype_arg,
"JP2")) {
387 if (
STREQ(imtype_arg,
"WEBP")) {
405 r_ext[ext_num++] =
".rgb";
408 r_ext[ext_num++] =
".rgb";
411 r_ext[ext_num++] =
".hdr";
413 else if (
ELEM(imtype,
421 r_ext[ext_num++] =
".png";
424 r_ext[ext_num++] =
".dds";
427 r_ext[ext_num++] =
".tga";
430 r_ext[ext_num++] =
".bmp";
433 r_ext[ext_num++] =
".tif";
434 r_ext[ext_num++] =
".tiff";
437 r_ext[ext_num++] =
".psd";
441 r_ext[ext_num++] =
".exr";
446 r_ext[ext_num++] =
".cin";
449 r_ext[ext_num++] =
".dpx";
456 r_ext[ext_num++] =
".jp2";
459 r_ext[ext_num++] =
".j2c";
462 BLI_assert_msg(0,
"Unsupported jp2 codec was specified in im_format->jp2_codec");
466 r_ext[ext_num++] =
".jp2";
472 r_ext[ext_num++] =
".webp";
477 r_ext[ext_num++] =
".jpg";
478 r_ext[ext_num++] =
".jpeg";
481 r_ext[ext_num] =
nullptr;
497 const size_t filepath_maxncpy,
517 const size_t filepath_maxncpy,
524 const size_t filepath_maxncpy,
537 const bool use_frames,
540 if (filepath ==
nullptr) {
565 const bool use_frames,
569 filepath, base, relbase, frame, im_format->
imtype, im_format, use_ext, use_frames, suffix);
578 const bool use_frames,
581 do_makepicstring(filepath, base, relbase, frame, imtype,
nullptr, use_ext, use_frames, suffix);
589 char imtype = imf->
imtype;
602 else if (
ELEM(imtype,
656 ibuf->
ftype = IMB_FTYPE_CINEON;
671 ibuf->
ftype = IMB_FTYPE_DPX;
698 ibuf->
ftype = IMB_FTYPE_JP2;
726 BLI_assert_msg(0,
"Unsupported jp2 codec was specified in im_format->jp2_codec");
732 ibuf->
ftype = IMB_FTYPE_WEBP;
749 int ftype = imbuf->
ftype;
809 else if (ftype == IMB_FTYPE_CINEON) {
812 else if (ftype == IMB_FTYPE_DPX) {
817 if (custom_flags &
RAWTGA) {
825 else if (ftype == IMB_FTYPE_JP2) {
829 if (custom_flags & JP2_16BIT) {
832 else if (custom_flags & JP2_12BIT) {
836 if (custom_flags & JP2_YCC) {
840 if (custom_flags & JP2_CINE) {
842 if (custom_flags & JP2_CINE_48FPS) {
847 if (custom_flags & JP2_JP2) {
850 else if (custom_flags & JP2_J2K) {
854 BLI_assert_msg(0,
"Unsupported jp2 codec was specified in file type");
859 else if (ftype == IMB_FTYPE_WEBP) {
904 const Scene *scene_src,
907 *imf = (imf_src) ? *imf_src : scene_src->
r.
im_format;
#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)
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define DNA_struct_default_get(struct_name)
@ R_IMF_JP2_FLAG_CINE_PRESET
@ R_IMF_IMTYPE_MULTILAYER
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_COLOR_MANAGEMENT_OVERRIDE
bool IMB_colormanagement_space_name_is_scene_linear(const char *name)
bool IMB_colormanagement_space_name_is_data(const char *name)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
@ COLOR_ROLE_DEFAULT_FLOAT
@ COLOR_ROLE_DEFAULT_BYTE
@ COLOR_ROLE_SCENE_LINEAR
Contains defines and structs used throughout the imbuf module.
#define TIF_COMPRESS_PACKBITS
#define TIF_COMPRESS_NONE
#define TIF_COMPRESS_DEFLATE
const char * imb_ext_image[]
CCL_NAMESPACE_BEGIN struct Options options
ImbFormatOptions foptions
struct ImageFormatData im_format
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings