diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_image_format.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image_format.cc | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 12 |
3 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_image_format.h b/source/blender/blenkernel/BKE_image_format.h index 8f71e1f4648..e3254c59ca4 100644 --- a/source/blender/blenkernel/BKE_image_format.h +++ b/source/blender/blenkernel/BKE_image_format.h @@ -52,7 +52,7 @@ int BKE_image_path_ensure_ext_from_imtype(char *string, char imtype); #define IMA_CHAN_FLAG_BW 1 #define IMA_CHAN_FLAG_RGB 2 -#define IMA_CHAN_FLAG_ALPHA 4 +#define IMA_CHAN_FLAG_RGBA 4 char BKE_ftype_to_imtype(int ftype, const struct ImbFormatOptions *options); int BKE_imtype_to_ftype(char imtype, struct ImbFormatOptions *r_options); diff --git a/source/blender/blenkernel/intern/image_format.cc b/source/blender/blenkernel/intern/image_format.cc index 57763e1670f..8bff6c376b3 100644 --- a/source/blender/blenkernel/intern/image_format.cc +++ b/source/blender/blenkernel/intern/image_format.cc @@ -272,7 +272,7 @@ char BKE_imtype_valid_channels(const char imtype, bool write_file) case R_IMF_IMTYPE_JP2: case R_IMF_IMTYPE_DPX: case R_IMF_IMTYPE_WEBP: - chan_flag |= IMA_CHAN_FLAG_ALPHA; + chan_flag |= IMA_CHAN_FLAG_RGBA; break; } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a1612159806..da30b7f2136 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1238,8 +1238,10 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value) (is_render ? IMA_CHAN_FLAG_BW : 0); /* ensure depth and color settings match */ - if (((imf->planes == R_IMF_PLANES_BW) && !(chan_flag & IMA_CHAN_FLAG_BW)) || - ((imf->planes == R_IMF_PLANES_RGBA) && !(chan_flag & IMA_CHAN_FLAG_ALPHA))) { + if ((imf->planes == R_IMF_PLANES_BW) && !(chan_flag & IMA_CHAN_FLAG_BW)) { + imf->planes = R_IMF_PLANES_RGBA; + } + if ((imf->planes == R_IMF_PLANES_RGBA) && !(chan_flag & IMA_CHAN_FLAG_RGBA)) { imf->planes = R_IMF_PLANES_RGB; } @@ -1319,12 +1321,12 @@ static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext RenderData *rd = &scene->r; if (BKE_ffmpeg_alpha_channel_is_supported(rd)) { - chan_flag |= IMA_CHAN_FLAG_ALPHA; + chan_flag |= IMA_CHAN_FLAG_RGBA; } } # endif - if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_ALPHA)) { + if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_RGBA)) { return rna_enum_image_color_mode_items; } else { @@ -1337,7 +1339,7 @@ static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext if (chan_flag & IMA_CHAN_FLAG_RGB) { RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB); } - if (chan_flag & IMA_CHAN_FLAG_ALPHA) { + if (chan_flag & IMA_CHAN_FLAG_RGBA) { RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA); } |