1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __C_IMAGE_LOADER_TGA_H_INCLUDED__
\r
6 #define __C_IMAGE_LOADER_TGA_H_INCLUDED__
\r
8 #include "IrrCompileConfig.h"
\r
10 #include "IImageLoader.h"
\r
18 #if defined(_IRR_COMPILE_WITH_TGA_LOADER_) || defined(_IRR_COMPILE_WITH_TGA_WRITER_)
\r
20 // byte-align structures
\r
21 #include "irrpack.h"
\r
23 // these structs are also used in the TGA writer
\r
28 u8 FirstEntryIndex[2];
\r
30 u8 ColorMapEntrySize;
\r
41 u32 ExtensionOffset;
\r
42 u32 DeveloperOffset;
\r
46 // Default alignment
\r
47 #include "irrunpack.h"
\r
49 #endif // compiled with loader or reader
\r
51 #ifdef _IRR_COMPILE_WITH_TGA_LOADER_
\r
54 Surface Loader for targa images
\r
56 class CImageLoaderTGA : public IImageLoader
\r
60 //! returns true if the file maybe is able to be loaded by this class
\r
61 //! based on the file extension (e.g. ".tga")
\r
62 bool isALoadableFileExtension(const io::path& filename) const override;
\r
64 //! returns true if the file maybe is able to be loaded by this class
\r
65 bool isALoadableFileFormat(io::IReadFile* file) const override;
\r
67 //! creates a surface from the file
\r
68 IImage* loadImage(io::IReadFile* file) const override;
\r
72 //! loads a compressed tga. Was written and sent in by Jon Pry, thank you very much!
\r
73 u8* loadCompressedImage(io::IReadFile *file, const STGAHeader& header) const;
\r
76 #endif // compiled with loader
\r
78 } // end namespace video
\r
79 } // end namespace irr
\r