diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-03-11 19:50:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-03-21 18:38:13 +0300 |
commit | 6e4d2fa9140864a13356b07ffca082817822987f (patch) | |
tree | cb8894c3b6898e82410f3edffe2fb9d85a3a2399 /source/blender/io | |
parent | 4abb8a14a2133f876c7718a8e09284baa62b1cf5 (diff) |
Cleanup: add image_format.cc for functions related to ImageFormatData
Also fixes missing code to read/write/free/copy color management settings
in various places. This can't be set through the UI currently, but still
should be handled consistently.
Diffstat (limited to 'source/blender/io')
-rw-r--r-- | source/blender/io/collada/ImageExporter.cpp | 3 | ||||
-rw-r--r-- | source/blender/io/usd/intern/usd_writer_material.cc | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/io/collada/ImageExporter.cpp b/source/blender/io/collada/ImageExporter.cpp index f57c5dd5e53..1223abbaf95 100644 --- a/source/blender/io/collada/ImageExporter.cpp +++ b/source/blender/io/collada/ImageExporter.cpp @@ -14,6 +14,7 @@ #include "BKE_customdata.h" #include "BKE_global.h" #include "BKE_image.h" +#include "BKE_image_format.h" #include "BKE_main.h" #include "BKE_mesh.h" @@ -48,7 +49,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies) bool is_dirty = BKE_image_is_dirty(image); ImageFormatData imageFormat; - BKE_imbuf_to_image_format(&imageFormat, imbuf); + BKE_image_format_from_imbuf(&imageFormat, imbuf); short image_source = image->source; bool is_generated = image_source == IMA_SRC_GENERATED; diff --git a/source/blender/io/usd/intern/usd_writer_material.cc b/source/blender/io/usd/intern/usd_writer_material.cc index 09cb0d07493..29ab0479f6e 100644 --- a/source/blender/io/usd/intern/usd_writer_material.cc +++ b/source/blender/io/usd/intern/usd_writer_material.cc @@ -6,6 +6,7 @@ #include "usd_exporter_context.h" #include "BKE_image.h" +#include "BKE_image_format.h" #include "BKE_main.h" #include "BKE_node.h" @@ -335,7 +336,7 @@ static std::string get_in_memory_texture_filename(Image *ima) } ImageFormatData imageFormat; - BKE_imbuf_to_image_format(&imageFormat, imbuf); + BKE_image_format_from_imbuf(&imageFormat, imbuf); char file_name[FILE_MAX]; /* Use the image name for the file name. */ @@ -368,7 +369,7 @@ static void export_in_memory_texture(Image *ima, } ImageFormatData imageFormat; - BKE_imbuf_to_image_format(&imageFormat, imbuf); + BKE_image_format_from_imbuf(&imageFormat, imbuf); /* This image in its current state only exists in Blender memory. * So we have to export it. The export will keep the image state intact, |