3
0

ImageLoaders.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/std/string/string.h>
  10. #include <AzCore/IO/SystemFile.h>
  11. #include <AzCore/IO/GenericStreams.h>
  12. #include <Atom/ImageProcessing/ImageObject.h>
  13. namespace ImageProcessingAtom
  14. {
  15. IImageObject* LoadImageFromFile(const AZStd::string& filename);
  16. bool IsExtensionSupported(const char* extension);
  17. const AZStd::string LoadEmbeddedSettingFromFile(const AZStd::string& filename);
  18. // Tiff loader. The loader support uncompressed tiff with with 1~4 channels and 8bit and 16bit uint or 16bits and 32bits float per channel
  19. // QImage also support tiff (tiff plugin), but it only supports 8bits uint
  20. namespace TIFFLoader
  21. {
  22. bool IsExtensionSupported(const char* extension);
  23. // Load a tiff file to an image object.
  24. IImageObject* LoadImageFromTIFF(const AZStd::string& filename);
  25. };// namespace TIFFLoader
  26. // Tga loader. The loader support 24bits and 32bits true color or colormapped tga, uncompressed or with RLE
  27. namespace TgaLoader
  28. {
  29. bool IsExtensionSupported(const char* extension);
  30. // Load a tga file to an image object.
  31. IImageObject* LoadImageFromFile(const AZStd::string& filename);
  32. };// namespace TgaLoader
  33. // Image loader through Qt's QImage with image formats supported native and through plugins
  34. namespace QtImageLoader
  35. {
  36. bool IsExtensionSupported(const char* extension);
  37. // Load image file which supported by QtImage to an image object
  38. IImageObject* LoadImageFromFile(const AZStd::string& filename);
  39. };// namespace QtImageLoader
  40. // Load dds files to ImageObject. The QtImageLoader can load dds file but it only can load dds with non-compressed formats.
  41. namespace DdsLoader
  42. {
  43. bool IsExtensionSupported(const char* extension);
  44. IImageObject* LoadImageFromFile(const AZStd::string& filename);
  45. };// namespace DdsLoader
  46. // Load .exr files to an image object
  47. namespace ExrLoader
  48. {
  49. bool IsExtensionSupported(const char* extension);
  50. IImageObject* LoadImageFromFile(const AZStd::string& filename);
  51. };// namespace ExrLoader
  52. }// namespace ImageProcessingAtom