| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsImportOptions.h"
- #include "BsGpuProgram.h"
- #include "BsPixelUtil.h"
- namespace BansheeEngine
- {
- /**
- * @brief Contains import options you may use to control how is a texture imported.
- */
- class BS_CORE_EXPORT TextureImportOptions : public ImportOptions
- {
- public:
- TextureImportOptions();
- /**
- * @brief Sets the pixel format that the imported texture will have.
- */
- void setFormat(PixelFormat format) { mFormat = format; }
- /**
- * @brief Enables or disables mipmap generation for the texture.
- */
- void setGenerateMipmaps(bool generate) { mGenerateMips = generate; }
- /**
- * @brief Sets the maximum mip level to generate when generating mipmaps. If 0
- * then maximum amount of mip levels will be generated.
- */
- void setMaxMip(UINT32 maxMip) { mMaxMip = maxMip; }
- /**
- * @brief Sets whether the texture data is also stored in CPU memory.
- */
- void setCPUReadable(bool readable) { mCPUReadable = readable; }
- /**
- * @brief Sets whether the texture data should be treated as if its in sRGB (gamma) space.
- * Such texture will be converted by hardware to linear space before use.
- */
- void setSRGB(bool sRGB) { mSRGB = sRGB; }
- /**
- * @brief Gets the pixel format that the imported texture will have.
- */
- PixelFormat getFormat() const { return mFormat; }
- /**
- * @brief Checks will be imported texture have automatically generated mipmaps.
- */
- bool getGenerateMipmaps() const { return mGenerateMips; }
- /**
- * @brief Gets the maximum mip level to generate when generating mipmaps. If 0
- * then maximum amount of mip levels will be generated.
- */
- UINT32 getMaxMip() const { return mMaxMip; }
- /**
- * @brief Retrieves whether the texture data is also stored in CPU memory.
- */
- bool getCPUReadable() const { return mCPUReadable; }
- /**
- * @brief Retrieves whether the texture data should be treated as if its in sRGB (gamma) space.
- * Such texture will be converted by hardware to linear space before use.
- */
- bool getSRGB() const { return mSRGB; }
- /************************************************************************/
- /* SERIALIZATION */
- /************************************************************************/
- public:
- friend class TextureImportOptionsRTTI;
- static RTTITypeBase* getRTTIStatic();
- virtual RTTITypeBase* getRTTI() const;
- private:
- PixelFormat mFormat;
- bool mGenerateMips;
- UINT32 mMaxMip;
- bool mCPUReadable;
- bool mSRGB;
- };
- }
|