diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/include/IImage.h | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IImage.h | 310 |
1 files changed, 155 insertions, 155 deletions
diff --git a/libraries/irrlicht-1.8/include/IImage.h b/libraries/irrlicht-1.8/include/IImage.h index 2cb1f8c..d484293 100644 --- a/libraries/irrlicht-1.8/include/IImage.h +++ b/libraries/irrlicht-1.8/include/IImage.h | |||
@@ -1,155 +1,155 @@ | |||
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 __I_IMAGE_H_INCLUDED__ | 5 | #ifndef __I_IMAGE_H_INCLUDED__ |
6 | #define __I_IMAGE_H_INCLUDED__ | 6 | #define __I_IMAGE_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IReferenceCounted.h" | 8 | #include "IReferenceCounted.h" |
9 | #include "position2d.h" | 9 | #include "position2d.h" |
10 | #include "rect.h" | 10 | #include "rect.h" |
11 | #include "SColor.h" | 11 | #include "SColor.h" |
12 | 12 | ||
13 | namespace irr | 13 | namespace irr |
14 | { | 14 | { |
15 | namespace video | 15 | namespace video |
16 | { | 16 | { |
17 | 17 | ||
18 | //! Interface for software image data. | 18 | //! Interface for software image data. |
19 | /** Image loaders create these images from files. IVideoDrivers convert | 19 | /** Image loaders create these images from files. IVideoDrivers convert |
20 | these images into their (hardware) textures. | 20 | these images into their (hardware) textures. |
21 | */ | 21 | */ |
22 | class IImage : public virtual IReferenceCounted | 22 | class IImage : public virtual IReferenceCounted |
23 | { | 23 | { |
24 | public: | 24 | public: |
25 | 25 | ||
26 | //! Lock function. Use this to get a pointer to the image data. | 26 | //! Lock function. Use this to get a pointer to the image data. |
27 | /** After you don't need the pointer anymore, you must call unlock(). | 27 | /** After you don't need the pointer anymore, you must call unlock(). |
28 | \return Pointer to the image data. What type of data is pointed to | 28 | \return Pointer to the image data. What type of data is pointed to |
29 | depends on the color format of the image. For example if the color | 29 | depends on the color format of the image. For example if the color |
30 | format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after | 30 | format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after |
31 | you don't need the pointer any more. */ | 31 | you don't need the pointer any more. */ |
32 | virtual void* lock() = 0; | 32 | virtual void* lock() = 0; |
33 | 33 | ||
34 | //! Unlock function. | 34 | //! Unlock function. |
35 | /** Should be called after the pointer received by lock() is not | 35 | /** Should be called after the pointer received by lock() is not |
36 | needed anymore. */ | 36 | needed anymore. */ |
37 | virtual void unlock() = 0; | 37 | virtual void unlock() = 0; |
38 | 38 | ||
39 | //! Returns width and height of image data. | 39 | //! Returns width and height of image data. |
40 | virtual const core::dimension2d<u32>& getDimension() const = 0; | 40 | virtual const core::dimension2d<u32>& getDimension() const = 0; |
41 | 41 | ||
42 | //! Returns bits per pixel. | 42 | //! Returns bits per pixel. |
43 | virtual u32 getBitsPerPixel() const = 0; | 43 | virtual u32 getBitsPerPixel() const = 0; |
44 | 44 | ||
45 | //! Returns bytes per pixel | 45 | //! Returns bytes per pixel |
46 | virtual u32 getBytesPerPixel() const = 0; | 46 | virtual u32 getBytesPerPixel() const = 0; |
47 | 47 | ||
48 | //! Returns image data size in bytes | 48 | //! Returns image data size in bytes |
49 | virtual u32 getImageDataSizeInBytes() const = 0; | 49 | virtual u32 getImageDataSizeInBytes() const = 0; |
50 | 50 | ||
51 | //! Returns image data size in pixels | 51 | //! Returns image data size in pixels |
52 | virtual u32 getImageDataSizeInPixels() const = 0; | 52 | virtual u32 getImageDataSizeInPixels() const = 0; |
53 | 53 | ||
54 | //! Returns a pixel | 54 | //! Returns a pixel |
55 | virtual SColor getPixel(u32 x, u32 y) const = 0; | 55 | virtual SColor getPixel(u32 x, u32 y) const = 0; |
56 | 56 | ||
57 | //! Sets a pixel | 57 | //! Sets a pixel |
58 | virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0; | 58 | virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0; |
59 | 59 | ||
60 | //! Returns the color format | 60 | //! Returns the color format |
61 | virtual ECOLOR_FORMAT getColorFormat() const = 0; | 61 | virtual ECOLOR_FORMAT getColorFormat() const = 0; |
62 | 62 | ||
63 | //! Returns mask for red value of a pixel | 63 | //! Returns mask for red value of a pixel |
64 | virtual u32 getRedMask() const = 0; | 64 | virtual u32 getRedMask() const = 0; |
65 | 65 | ||
66 | //! Returns mask for green value of a pixel | 66 | //! Returns mask for green value of a pixel |
67 | virtual u32 getGreenMask() const = 0; | 67 | virtual u32 getGreenMask() const = 0; |
68 | 68 | ||
69 | //! Returns mask for blue value of a pixel | 69 | //! Returns mask for blue value of a pixel |
70 | virtual u32 getBlueMask() const = 0; | 70 | virtual u32 getBlueMask() const = 0; |
71 | 71 | ||
72 | //! Returns mask for alpha value of a pixel | 72 | //! Returns mask for alpha value of a pixel |
73 | virtual u32 getAlphaMask() const = 0; | 73 | virtual u32 getAlphaMask() const = 0; |
74 | 74 | ||
75 | //! Returns pitch of image | 75 | //! Returns pitch of image |
76 | virtual u32 getPitch() const =0; | 76 | virtual u32 getPitch() const =0; |
77 | 77 | ||
78 | //! Copies the image into the target, scaling the image to fit | 78 | //! Copies the image into the target, scaling the image to fit |
79 | virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0; | 79 | virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0; |
80 | 80 | ||
81 | //! Copies the image into the target, scaling the image to fit | 81 | //! Copies the image into the target, scaling the image to fit |
82 | virtual void copyToScaling(IImage* target) =0; | 82 | virtual void copyToScaling(IImage* target) =0; |
83 | 83 | ||
84 | //! copies this surface into another | 84 | //! copies this surface into another |
85 | virtual void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) =0; | 85 | virtual void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) =0; |
86 | 86 | ||
87 | //! copies this surface into another | 87 | //! copies this surface into another |
88 | virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) =0; | 88 | virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) =0; |
89 | 89 | ||
90 | //! copies this surface into another, using the alpha mask and cliprect and a color to add with | 90 | //! copies this surface into another, using the alpha mask and cliprect and a color to add with |
91 | virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, | 91 | virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, |
92 | const core::rect<s32>& sourceRect, const SColor &color, | 92 | const core::rect<s32>& sourceRect, const SColor &color, |
93 | const core::rect<s32>* clipRect = 0) =0; | 93 | const core::rect<s32>* clipRect = 0) =0; |
94 | 94 | ||
95 | //! copies this surface into another, scaling it to fit, appyling a box filter | 95 | //! copies this surface into another, scaling it to fit, appyling a box filter |
96 | virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) = 0; | 96 | virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) = 0; |
97 | 97 | ||
98 | //! fills the surface with given color | 98 | //! fills the surface with given color |
99 | virtual void fill(const SColor &color) =0; | 99 | virtual void fill(const SColor &color) =0; |
100 | 100 | ||
101 | //! get the amount of Bits per Pixel of the given color format | 101 | //! get the amount of Bits per Pixel of the given color format |
102 | static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format) | 102 | static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format) |
103 | { | 103 | { |
104 | switch(format) | 104 | switch(format) |
105 | { | 105 | { |
106 | case ECF_A1R5G5B5: | 106 | case ECF_A1R5G5B5: |
107 | return 16; | 107 | return 16; |
108 | case ECF_R5G6B5: | 108 | case ECF_R5G6B5: |
109 | return 16; | 109 | return 16; |
110 | case ECF_R8G8B8: | 110 | case ECF_R8G8B8: |
111 | return 24; | 111 | return 24; |
112 | case ECF_A8R8G8B8: | 112 | case ECF_A8R8G8B8: |
113 | return 32; | 113 | return 32; |
114 | case ECF_R16F: | 114 | case ECF_R16F: |
115 | return 16; | 115 | return 16; |
116 | case ECF_G16R16F: | 116 | case ECF_G16R16F: |
117 | return 32; | 117 | return 32; |
118 | case ECF_A16B16G16R16F: | 118 | case ECF_A16B16G16R16F: |
119 | return 64; | 119 | return 64; |
120 | case ECF_R32F: | 120 | case ECF_R32F: |
121 | return 32; | 121 | return 32; |
122 | case ECF_G32R32F: | 122 | case ECF_G32R32F: |
123 | return 64; | 123 | return 64; |
124 | case ECF_A32B32G32R32F: | 124 | case ECF_A32B32G32R32F: |
125 | return 128; | 125 | return 128; |
126 | default: | 126 | default: |
127 | return 0; | 127 | return 0; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | //! test if the color format is only viable for RenderTarget textures | 131 | //! test if the color format is only viable for RenderTarget textures |
132 | /** Since we don't have support for e.g. floating point IImage formats | 132 | /** Since we don't have support for e.g. floating point IImage formats |
133 | one should test if the color format can be used for arbitrary usage, or | 133 | one should test if the color format can be used for arbitrary usage, or |
134 | if it is restricted to RTTs. */ | 134 | if it is restricted to RTTs. */ |
135 | static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format) | 135 | static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format) |
136 | { | 136 | { |
137 | switch(format) | 137 | switch(format) |
138 | { | 138 | { |
139 | case ECF_A1R5G5B5: | 139 | case ECF_A1R5G5B5: |
140 | case ECF_R5G6B5: | 140 | case ECF_R5G6B5: |
141 | case ECF_R8G8B8: | 141 | case ECF_R8G8B8: |
142 | case ECF_A8R8G8B8: | 142 | case ECF_A8R8G8B8: |
143 | return false; | 143 | return false; |
144 | default: | 144 | default: |
145 | return true; | 145 | return true; |
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | }; | 149 | }; |
150 | 150 | ||
151 | } // end namespace video | 151 | } // end namespace video |
152 | } // end namespace irr | 152 | } // end namespace irr |
153 | 153 | ||
154 | #endif | 154 | #endif |
155 | 155 | ||