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