Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-11-13 02:39:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-11-13 02:39:48 +0300
commitac299bb45328da8dc3586be25bcff78ddfc2e03a (patch)
tree03b7b54bc21d93b4cc8197b7ec8ad59025ed20a6 /source/blender/imbuf
parent9a73417337f5dffa08f893382acc29191d8405f6 (diff)
Cleanup: imbuf file format callback declaration
Use named members as this wasn't very readable given the number of unnamed NULL members.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/filetype.c312
1 files changed, 169 insertions, 143 deletions
diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c
index 1746be85131..d952da2d351 100644
--- a/source/blender/imbuf/intern/filetype.c
+++ b/source/blender/imbuf/intern/filetype.c
@@ -51,162 +51,188 @@ static int imb_ftype_iris(const ImFileType *type, const ImBuf *ibuf)
}
const ImFileType IMB_FILE_TYPES[] = {
- {NULL,
- NULL,
- imb_is_a_jpeg,
- imb_ftype_default,
- imb_load_jpeg,
- NULL,
- imb_savejpeg,
- NULL,
- 0,
- IMB_FTYPE_JPG,
- COLOR_ROLE_DEFAULT_BYTE},
- {NULL,
- NULL,
- imb_is_a_png,
- imb_ftype_default,
- imb_loadpng,
- NULL,
- imb_savepng,
- NULL,
- 0,
- IMB_FTYPE_PNG,
- COLOR_ROLE_DEFAULT_BYTE},
- {NULL,
- NULL,
- imb_is_a_bmp,
- imb_ftype_default,
- imb_bmp_decode,
- NULL,
- imb_savebmp,
- NULL,
- 0,
- IMB_FTYPE_BMP,
- COLOR_ROLE_DEFAULT_BYTE},
- {NULL,
- NULL,
- imb_is_a_targa,
- imb_ftype_default,
- imb_loadtarga,
- NULL,
- imb_savetarga,
- NULL,
- 0,
- IMB_FTYPE_TGA,
- COLOR_ROLE_DEFAULT_BYTE},
- {NULL,
- NULL,
- imb_is_a_iris,
- imb_ftype_iris,
- imb_loadiris,
- NULL,
- imb_saveiris,
- NULL,
- 0,
- IMB_FTYPE_IMAGIC,
- COLOR_ROLE_DEFAULT_BYTE},
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_jpeg,
+ .ftype = imb_ftype_default,
+ .load = imb_load_jpeg,
+ .load_filepath = NULL,
+ .save = imb_savejpeg,
+ .load_tile = NULL,
+ .flag = 0,
+ .filetype = IMB_FTYPE_JPG,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_png,
+ .ftype = imb_ftype_default,
+ .load = imb_loadpng,
+ .load_filepath = NULL,
+ .save = imb_savepng,
+ .load_tile = NULL,
+ .flag = 0,
+ .filetype = IMB_FTYPE_PNG,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_bmp,
+ .ftype = imb_ftype_default,
+ .load = imb_bmp_decode,
+ .load_filepath = NULL,
+ .save = imb_savebmp,
+ .load_tile = NULL,
+ .flag = 0,
+ .filetype = IMB_FTYPE_BMP,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_targa,
+ .ftype = imb_ftype_default,
+ .load = imb_loadtarga,
+ .load_filepath = NULL,
+ .save = imb_savetarga,
+ .load_tile = NULL,
+ .flag = 0,
+ .filetype = IMB_FTYPE_TGA,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_iris,
+ .ftype = imb_ftype_iris,
+ .load = imb_loadiris,
+ .load_filepath = NULL,
+ .save = imb_saveiris,
+ .load_tile = NULL,
+ .flag = 0,
+ .filetype = IMB_FTYPE_IMAGIC,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
#ifdef WITH_CINEON
- {NULL,
- NULL,
- imb_is_a_dpx,
- imb_ftype_default,
- imb_load_dpx,
- NULL,
- imb_save_dpx,
- NULL,
- IM_FTYPE_FLOAT,
- IMB_FTYPE_DPX,
- COLOR_ROLE_DEFAULT_FLOAT},
- {NULL,
- NULL,
- imb_is_a_cineon,
- imb_ftype_default,
- imb_load_cineon,
- NULL,
- imb_save_cineon,
- NULL,
- IM_FTYPE_FLOAT,
- IMB_FTYPE_CINEON,
- COLOR_ROLE_DEFAULT_FLOAT},
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_dpx,
+ .ftype = imb_ftype_default,
+ .load = imb_load_dpx,
+ .load_filepath = NULL,
+ .save = imb_save_dpx,
+ .load_tile = NULL,
+ .flag = IM_FTYPE_FLOAT,
+ .filetype = IMB_FTYPE_DPX,
+ .default_save_role = COLOR_ROLE_DEFAULT_FLOAT,
+ },
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_cineon,
+ .ftype = imb_ftype_default,
+ .load = imb_load_cineon,
+ .load_filepath = NULL,
+ .save = imb_save_cineon,
+ .load_tile = NULL,
+ .flag = IM_FTYPE_FLOAT,
+ .filetype = IMB_FTYPE_CINEON,
+ .default_save_role = COLOR_ROLE_DEFAULT_FLOAT,
+ },
#endif
#ifdef WITH_TIFF
- {imb_inittiff,
- NULL,
- imb_is_a_tiff,
- imb_ftype_default,
- imb_loadtiff,
- NULL,
- imb_savetiff,
- imb_loadtiletiff,
- 0,
- IMB_FTYPE_TIF,
- COLOR_ROLE_DEFAULT_BYTE},
+ {
+ .init = imb_inittiff,
+ .exit = NULL,
+ .is_a = imb_is_a_tiff,
+ .ftype = imb_ftype_default,
+ .load = imb_loadtiff,
+ .load_filepath = NULL,
+ .save = imb_savetiff,
+ .load_tile = imb_loadtiletiff,
+ .flag = 0,
+ .filetype = IMB_FTYPE_TIF,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
#endif
#ifdef WITH_HDR
- {NULL,
- NULL,
- imb_is_a_hdr,
- imb_ftype_default,
- imb_loadhdr,
- NULL,
- imb_savehdr,
- NULL,
- IM_FTYPE_FLOAT,
- IMB_FTYPE_RADHDR,
- COLOR_ROLE_DEFAULT_FLOAT},
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_hdr,
+ .ftype = imb_ftype_default,
+ .load = imb_loadhdr,
+ .load_filepath = NULL,
+ .save = imb_savehdr,
+ .load_tile = NULL,
+ .flag = IM_FTYPE_FLOAT,
+ .filetype = IMB_FTYPE_RADHDR,
+ .default_save_role = COLOR_ROLE_DEFAULT_FLOAT,
+ },
#endif
#ifdef WITH_OPENEXR
- {imb_initopenexr,
- imb_exitopenexr,
- imb_is_a_openexr,
- imb_ftype_default,
- imb_load_openexr,
- NULL,
- imb_save_openexr,
- NULL,
- IM_FTYPE_FLOAT,
- IMB_FTYPE_OPENEXR,
- COLOR_ROLE_DEFAULT_FLOAT},
+ {
+ .init = imb_initopenexr,
+ .exit = imb_exitopenexr,
+ .is_a = imb_is_a_openexr,
+ .ftype = imb_ftype_default,
+ .load = imb_load_openexr,
+ .load_filepath = NULL,
+ .save = imb_save_openexr,
+ .load_tile = NULL,
+ .flag = IM_FTYPE_FLOAT,
+ .filetype = IMB_FTYPE_OPENEXR,
+ .default_save_role = COLOR_ROLE_DEFAULT_FLOAT,
+ },
#endif
#ifdef WITH_OPENJPEG
- {NULL,
- NULL,
- imb_is_a_jp2,
- imb_ftype_default,
- imb_load_jp2,
- NULL,
- imb_save_jp2,
- NULL,
- IM_FTYPE_FLOAT,
- IMB_FTYPE_JP2,
- COLOR_ROLE_DEFAULT_BYTE},
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_jp2,
+ .ftype = imb_ftype_default,
+ .load = imb_load_jp2,
+ .load_filepath = NULL,
+ .save = imb_save_jp2,
+ .load_tile = NULL,
+ .flag = IM_FTYPE_FLOAT,
+ .filetype = IMB_FTYPE_JP2,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
#endif
#ifdef WITH_DDS
- {NULL,
- NULL,
- imb_is_a_dds,
- imb_ftype_default,
- imb_load_dds,
- NULL,
- NULL,
- NULL,
- 0,
- IMB_FTYPE_DDS,
- COLOR_ROLE_DEFAULT_BYTE},
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_dds,
+ .ftype = imb_ftype_default,
+ .load = imb_load_dds,
+ .load_filepath = NULL,
+ .save = NULL,
+ .load_tile = NULL,
+ .flag = 0,
+ .filetype = IMB_FTYPE_DDS,
+ .default_save_role = COLOR_ROLE_DEFAULT_BYTE,
+ },
#endif
#ifdef WITH_OPENIMAGEIO
- {NULL,
- NULL,
- imb_is_a_photoshop,
- imb_ftype_default,
- NULL,
- imb_load_photoshop,
- NULL,
- NULL,
- IM_FTYPE_FLOAT,
- IMB_FTYPE_PSD,
- COLOR_ROLE_DEFAULT_FLOAT},
+ {
+ .init = NULL,
+ .exit = NULL,
+ .is_a = imb_is_a_photoshop,
+ .ftype = imb_ftype_default,
+ .load = NULL,
+ .load_filepath = imb_load_photoshop,
+ .save = NULL,
+ .load_tile = NULL,
+ .flag = IM_FTYPE_FLOAT,
+ .filetype = IMB_FTYPE_PSD,
+ .default_save_role = COLOR_ROLE_DEFAULT_FLOAT,
+ },
#endif
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0},
};