1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #pragma once |
4 | |
5 | #include "BsCorePrerequisites.h" |
6 | #include "Importer/BsImportOptions.h" |
7 | #include "Image/BsPixelUtil.h" |
8 | |
9 | namespace bs |
10 | { |
11 | /** @addtogroup Importer |
12 | * @{ |
13 | */ |
14 | |
15 | /** Contains import options you may use to control how is a texture imported. */ |
16 | class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Importer,api:bsf,api:bed) TextureImportOptions : public ImportOptions |
17 | { |
18 | public: |
19 | TextureImportOptions() = default; |
20 | |
21 | /** Pixel format to import as. */ |
22 | BS_SCRIPT_EXPORT() |
23 | PixelFormat format = PF_RGBA8; |
24 | |
25 | /** Enables or disables mipmap generation for the texture. */ |
26 | BS_SCRIPT_EXPORT() |
27 | bool generateMips = false; |
28 | |
29 | /** |
30 | * Maximum mip level to generate when generating mipmaps. If 0 then maximum amount of mip levels will be generated. |
31 | */ |
32 | BS_SCRIPT_EXPORT() |
33 | UINT32 maxMip = 0; |
34 | |
35 | /** Determines whether the texture data is also stored in main memory, available for fast CPU access. */ |
36 | BS_SCRIPT_EXPORT() |
37 | bool cpuCached = false; |
38 | |
39 | /** |
40 | * Determines whether the texture data should be treated as if its in sRGB (gamma) space. Such texture will be |
41 | * converted by hardware to linear space before use on the GPU. |
42 | */ |
43 | BS_SCRIPT_EXPORT() |
44 | bool sRGB = false; |
45 | |
46 | /** |
47 | * Determines should the texture be imported as a cubemap. See setCubemapSource to choose how will the source |
48 | * texture be converted to a cubemap. |
49 | */ |
50 | BS_SCRIPT_EXPORT() |
51 | bool cubemap = false; |
52 | |
53 | /** |
54 | * Determines how should the source texture be interpreted when generating a cubemap. Only relevant when @p cubemap |
55 | * is set to true. |
56 | */ |
57 | BS_SCRIPT_EXPORT() |
58 | CubemapSourceType cubemapSourceType = CubemapSourceType::Faces; |
59 | |
60 | /** Creates a new import options object that allows you to customize how are textures imported. */ |
61 | BS_SCRIPT_EXPORT(ec:T) |
62 | static SPtr<TextureImportOptions> create(); |
63 | |
64 | /************************************************************************/ |
65 | /* SERIALIZATION */ |
66 | /************************************************************************/ |
67 | public: |
68 | friend class TextureImportOptionsRTTI; |
69 | static RTTITypeBase* getRTTIStatic(); |
70 | RTTITypeBase* getRTTI() const override; |
71 | }; |
72 | |
73 | /** @} */ |
74 | } |