|
|
@@ -1,14 +1,11 @@
|
|
|
#ifndef ANKI_RESOURCE_IMAGE_H
|
|
|
#define ANKI_RESOURCE_IMAGE_H
|
|
|
|
|
|
-#include "anki/util/StdTypes.h"
|
|
|
#include "anki/util/Util.h"
|
|
|
#include <vector>
|
|
|
|
|
|
-
|
|
|
namespace anki {
|
|
|
|
|
|
-
|
|
|
/// Image class.
|
|
|
/// Used in Texture::load. Supported types: TGA and PNG
|
|
|
class Image
|
|
|
@@ -49,12 +46,12 @@ public:
|
|
|
|
|
|
/// @name Accessors
|
|
|
/// @{
|
|
|
- uint getWidth() const
|
|
|
+ uint32_t getWidth() const
|
|
|
{
|
|
|
return width;
|
|
|
}
|
|
|
|
|
|
- uint getHeight() const
|
|
|
+ uint32_t getHeight() const
|
|
|
{
|
|
|
return height;
|
|
|
}
|
|
|
@@ -64,7 +61,7 @@ public:
|
|
|
return type;
|
|
|
}
|
|
|
|
|
|
- const uchar* getData() const
|
|
|
+ const uint8_t* getData() const
|
|
|
{
|
|
|
return &data[0];
|
|
|
}
|
|
|
@@ -87,16 +84,16 @@ public:
|
|
|
void load(const char* filename);
|
|
|
|
|
|
private:
|
|
|
- uint width; ///< Image width
|
|
|
- uint height; ///< Image height
|
|
|
+ uint32_t width; ///< Image width
|
|
|
+ uint32_t height; ///< Image height
|
|
|
ColorType type; ///< Image color type
|
|
|
- std::vector<uchar> data; ///< Image data
|
|
|
+ std::vector<uint8_t> data; ///< Image data
|
|
|
DataCompression dataCompression;
|
|
|
|
|
|
/// @name TGA headers
|
|
|
/// @{
|
|
|
- static uchar tgaHeaderUncompressed[12];
|
|
|
- static uchar tgaHeaderCompressed[12];
|
|
|
+ static uint8_t tgaHeaderUncompressed[12];
|
|
|
+ static uint8_t tgaHeaderCompressed[12];
|
|
|
/// @}
|
|
|
|
|
|
/// Load a TGA
|
|
|
@@ -108,13 +105,13 @@ private:
|
|
|
/// @param[in] fs The input
|
|
|
/// @param[out] bpp Bits per pixel
|
|
|
/// @exception Exception
|
|
|
- void loadUncompressedTga(std::fstream& fs, uint& bpp);
|
|
|
+ void loadUncompressedTga(std::fstream& fs, uint32_t& bpp);
|
|
|
|
|
|
/// Used by loadTga
|
|
|
/// @param[in] fs The input
|
|
|
/// @param[out] bpp Bits per pixel
|
|
|
/// @exception Exception
|
|
|
- void loadCompressedTga(std::fstream& fs, uint& bpp);
|
|
|
+ void loadCompressedTga(std::fstream& fs, uint32_t& bpp);
|
|
|
|
|
|
/// Load PNG. Dont throw exception because libpng is in C
|
|
|
/// @param[in] filename The file to load
|
|
|
@@ -127,8 +124,6 @@ private:
|
|
|
void loadDds(const char* filename);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
} // end namespace
|
|
|
|
|
|
-
|
|
|
#endif
|