5#ifndef __I_IMAGE_H_INCLUDED__
6#define __I_IMAGE_H_INCLUDED__
8#include "IReferenceCounted.h"
85 virtual void copyTo(
IImage* target,
const core::position2d<s32>& pos=core::position2d<s32>(0,0)) =0;
108 virtual void swapBG() = 0;
168 u32 compressedImageSize = 0;
173 compressedImageSize = ((width + 3) / 4) * ((height + 3) / 4) * 8;
179 compressedImageSize = ((width + 3) / 4) * ((height + 3) / 4) * 16;
190 compressedImageSize = core::ceil32(width / 8.0f) * core::ceil32(height / 4.0f) * 8;
195 compressedImageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 8;
198 compressedImageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 16;
202 compressedImageSize = width * height * 2;
205 compressedImageSize = width * height * 3;
208 compressedImageSize = width * height * 4;
214 return compressedImageSize;
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:50
Specifies a 2 dimensional size.
Definition dimension2d.h:21
Rectangle template.
Definition rect.h:27
Interface for software image data.
Definition IImage.h:23
virtual void fill(const SColor &color)=0
fills the surface with given color
virtual SColor getPixel(u32 x, u32 y) const =0
Returns a pixel.
virtual u32 getBytesPerPixel() const =0
Returns bytes per pixel.
virtual u32 getGreenMask() const =0
Returns mask for green value of a pixel.
virtual const core::dimension2d< u32 > & getDimension() const =0
Returns width and height of image data.
static bool isCompressedFormat(const ECOLOR_FORMAT format)
test if this is compressed color format
Definition IImage.h:218
virtual u32 getBlueMask() const =0
Returns mask for blue value of a pixel.
virtual u32 getAlphaMask() const =0
Returns mask for alpha value of a pixel.
virtual bool hasMipMaps() const =0
Check whether the image has MipMaps.
virtual void copyToScalingBoxFilter(IImage *target, s32 bias=0, bool blend=false)=0
copies this surface into another, scaling it to fit, appyling a box filter
static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format)
get the amount of Bits per Pixel of the given color format
Definition IImage.h:111
virtual void copyToWithAlpha(IImage *target, const core::position2d< s32 > &pos, const core::rect< s32 > &sourceRect, const SColor &color, const core::rect< s32 > *clipRect=0)=0
copies this surface into another, using the alpha mask and cliprect and a color to add with
virtual void copyToScaling(void *target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0, bool swapBG=false)=0
Copies the image into the target, scaling the image to fit.
virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend=false)=0
Sets a pixel.
virtual u32 getImageDataSizeInPixels() const =0
Returns image data size in pixels.
static u32 getCompressedImageSize(ECOLOR_FORMAT format, u32 width, u32 height)
calculate compressed image size for selected width and height.
Definition IImage.h:163
virtual void copyToScaling(IImage *target)=0
Copies the image into the target, scaling the image to fit.
virtual u32 getPitch() const =0
Returns pitch of image.
virtual u32 getImageDataSizeInBytes() const =0
Returns image data size in bytes.
virtual u32 getRedMask() const =0
Returns mask for red value of a pixel.
static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)
test if the color format is only viable for RenderTarget textures
Definition IImage.h:264
virtual void copyTo(IImage *target, const core::position2d< s32 > &pos, const core::rect< s32 > &sourceRect, const core::rect< s32 > *clipRect=0)=0
copies this surface into another
static bool isDepthFormat(const ECOLOR_FORMAT format)
test if the color format is only viable for depth/stencil textures
Definition IImage.h:247
virtual void * lock()=0
Lock function. Use this to get a pointer to the image data.
virtual ECOLOR_FORMAT getColorFormat() const =0
Returns the color format.
virtual void unlock()=0
Unlock function.
virtual bool isCompressed() const =0
Inform whether the image is compressed.
virtual u32 getBitsPerPixel() const =0
Returns bits per pixel.
virtual void copyTo(IImage *target, const core::position2d< s32 > &pos=core::position2d< s32 >(0, 0))=0
copies this surface into another
Class representing a 32 bit ARGB color.
Definition SColor.h:285
const T & max_(const T &a, const T &b)
returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)
Definition irrMath.h:137
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
Definition SColor.h:18
@ ECT_PVRTC2_RGBA4444
PVRTC2 RGBA 4444.
Definition SColor.h:70
@ ECF_A1R5G5B5
16 bit color format used by the software driver.
Definition SColor.h:23
@ ECF_D16
16 bit format using 16 bits for depth.
Definition SColor.h:115
@ ECF_DXT5
DXT5 color format.
Definition SColor.h:49
@ ECT_PVRTC2_RGB565
ECT_PVRTC2_RGB 565.
Definition SColor.h:73
@ ECF_A32B32G32R32F
128 bit format using 32 bits for the red, green, blue and alpha channels.
Definition SColor.h:110
@ ECF_D24S8
32 bit format using 24 bits for depth and 8 bits for stencil.
Definition SColor.h:121
@ ECF_R8G8B8
24 bit color, no alpha channel, but 8 bit for red, green and blue.
Definition SColor.h:29
@ ECF_R5G6B5
Standard 16 bit color format.
Definition SColor.h:26
@ ECF_DXT3
DXT3 color format.
Definition SColor.h:43
@ ECF_A8R8G8B8
Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
Definition SColor.h:32
@ ECT_PVRTC2_RGB888
ECT_PVRTC2_RGB 888.
Definition SColor.h:76
@ ECF_ETC2_RGB
ETC2 RGB.
Definition SColor.h:85
@ ECF_PVRTC2_ARGB4
PVRTC2 ARGB 4bpp.
Definition SColor.h:67
@ ECF_ETC1
ETC1 RGB.
Definition SColor.h:82
@ ECT_PVRTC2_RGBA8888
ECT_PVRTC2_RGBA 8888.
Definition SColor.h:79
@ ECF_ETC2_ARGB
ETC2 ARGB.
Definition SColor.h:88
@ ECF_A16B16G16R16F
64 bit format using 16 bits for the red, green, blue and alpha channels.
Definition SColor.h:101
@ ECF_G32R32F
64 bit format using 32 bits for the red and green channels.
Definition SColor.h:107
@ ECF_PVRTC_RGB2
PVRTC RGB 2bpp.
Definition SColor.h:52
@ ECF_PVRTC_RGB4
PVRTC RGB 4bpp.
Definition SColor.h:58
@ ECF_DXT2
DXT2 color format.
Definition SColor.h:40
@ ECF_R16F
16 bit format using 16 bits for the red channel.
Definition SColor.h:95
@ ECF_PVRTC_ARGB4
PVRTC ARGB 4bpp.
Definition SColor.h:61
@ ECF_D32
32 bit format using 32 bits for depth.
Definition SColor.h:118
@ ECF_PVRTC2_ARGB2
PVRTC2 ARGB 2bpp.
Definition SColor.h:64
@ ECF_DXT1
DXT1 color format.
Definition SColor.h:37
@ ECF_DXT4
DXT4 color format.
Definition SColor.h:46
@ ECF_R32F
32 bit format using 32 bits for the red channel.
Definition SColor.h:104
@ ECF_PVRTC_ARGB2
PVRTC ARGB 2bpp.
Definition SColor.h:55
@ ECF_G16R16F
32 bit format using 16 bits for the red and green channels.
Definition SColor.h:98
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
signed int s32
32 bit signed variable.
Definition irrTypes.h:66