diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderPSD.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderPSD.h | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderPSD.h b/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderPSD.h index 72f4b43..1e81105 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderPSD.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderPSD.h | |||
@@ -1,72 +1,72 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_IMAGE_LOADER_PSD_H_INCLUDED__ | 5 | #ifndef __C_IMAGE_LOADER_PSD_H_INCLUDED__ |
6 | #define __C_IMAGE_LOADER_PSD_H_INCLUDED__ | 6 | #define __C_IMAGE_LOADER_PSD_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IrrCompileConfig.h" | 8 | #include "IrrCompileConfig.h" |
9 | 9 | ||
10 | #ifdef _IRR_COMPILE_WITH_PSD_LOADER_ | 10 | #ifdef _IRR_COMPILE_WITH_PSD_LOADER_ |
11 | 11 | ||
12 | #include "IImageLoader.h" | 12 | #include "IImageLoader.h" |
13 | 13 | ||
14 | namespace irr | 14 | namespace irr |
15 | { | 15 | { |
16 | namespace video | 16 | namespace video |
17 | { | 17 | { |
18 | 18 | ||
19 | 19 | ||
20 | // byte-align structures | 20 | // byte-align structures |
21 | #include "irrpack.h" | 21 | #include "irrpack.h" |
22 | 22 | ||
23 | struct PsdHeader | 23 | struct PsdHeader |
24 | { | 24 | { |
25 | c8 signature [4]; // Always equal to 8BPS. | 25 | c8 signature [4]; // Always equal to 8BPS. |
26 | u16 version; // Always equal to 1 | 26 | u16 version; // Always equal to 1 |
27 | c8 reserved [6]; // Must be zero | 27 | c8 reserved [6]; // Must be zero |
28 | u16 channels; // Number of any channels inc. alphas | 28 | u16 channels; // Number of any channels inc. alphas |
29 | u32 height; // Rows Height of image in pixel | 29 | u32 height; // Rows Height of image in pixel |
30 | u32 width; // Colums Width of image in pixel | 30 | u32 width; // Colums Width of image in pixel |
31 | u16 depth; // Bits/channel | 31 | u16 depth; // Bits/channel |
32 | u16 mode; // Color mode of the file (Bitmap/Grayscale..) | 32 | u16 mode; // Color mode of the file (Bitmap/Grayscale..) |
33 | } PACK_STRUCT; | 33 | } PACK_STRUCT; |
34 | 34 | ||
35 | 35 | ||
36 | // Default alignment | 36 | // Default alignment |
37 | #include "irrunpack.h" | 37 | #include "irrunpack.h" |
38 | 38 | ||
39 | /*! | 39 | /*! |
40 | Surface Loader for psd images | 40 | Surface Loader for psd images |
41 | */ | 41 | */ |
42 | class CImageLoaderPSD : public IImageLoader | 42 | class CImageLoaderPSD : public IImageLoader |
43 | { | 43 | { |
44 | public: | 44 | public: |
45 | 45 | ||
46 | //! constructor | 46 | //! constructor |
47 | CImageLoaderPSD(); | 47 | CImageLoaderPSD(); |
48 | 48 | ||
49 | //! returns true if the file maybe is able to be loaded by this class | 49 | //! returns true if the file maybe is able to be loaded by this class |
50 | //! based on the file extension (e.g. ".tga") | 50 | //! based on the file extension (e.g. ".tga") |
51 | virtual bool isALoadableFileExtension(const io::path& filename) const; | 51 | virtual bool isALoadableFileExtension(const io::path& filename) const; |
52 | 52 | ||
53 | //! returns true if the file maybe is able to be loaded by this class | 53 | //! returns true if the file maybe is able to be loaded by this class |
54 | virtual bool isALoadableFileFormat(io::IReadFile* file) const; | 54 | virtual bool isALoadableFileFormat(io::IReadFile* file) const; |
55 | 55 | ||
56 | //! creates a surface from the file | 56 | //! creates a surface from the file |
57 | virtual IImage* loadImage(io::IReadFile* file) const; | 57 | virtual IImage* loadImage(io::IReadFile* file) const; |
58 | 58 | ||
59 | private: | 59 | private: |
60 | 60 | ||
61 | bool readRawImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const; | 61 | bool readRawImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const; |
62 | bool readRLEImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const; | 62 | bool readRLEImageData(io::IReadFile* file, const PsdHeader& header, u32* imageData) const; |
63 | s16 getShiftFromChannel(c8 channelNr, const PsdHeader& header) const; | 63 | s16 getShiftFromChannel(c8 channelNr, const PsdHeader& header) const; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | 66 | ||
67 | } // end namespace video | 67 | } // end namespace video |
68 | } // end namespace irr | 68 | } // end namespace irr |
69 | 69 | ||
70 | #endif | 70 | #endif |
71 | #endif | 71 | #endif |
72 | 72 | ||