Loading...
Searching...
No Matches
IImage.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_IMAGE_H_INCLUDED__
#define __I_IMAGE_H_INCLUDED__
#include "IReferenceCounted.h"
#include "position2d.h"
#include "rect.h"
#include "SColor.h"
namespace irr
{
namespace video
{
class IImage : public virtual IReferenceCounted
{
public:
virtual void* lock() = 0;
virtual void unlock() = 0;
virtual const core::dimension2d<u32>& getDimension() const = 0;
virtual u32 getBitsPerPixel() const = 0;
virtual u32 getBytesPerPixel() const = 0;
virtual u32 getImageDataSizeInBytes() const = 0;
virtual u32 getImageDataSizeInPixels() const = 0;
virtual SColor getPixel(u32 x, u32 y) const = 0;
virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0;
virtual ECOLOR_FORMAT getColorFormat() const = 0;
virtual u32 getRedMask() const = 0;
virtual u32 getGreenMask() const = 0;
virtual u32 getBlueMask() const = 0;
virtual u32 getAlphaMask() const = 0;
virtual u32 getPitch() const =0;
virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0;
virtual void copyToScaling(IImage* target) =0;
virtual void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) =0;
virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) =0;
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;
virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) = 0;
virtual void fill(const SColor &color) =0;
static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format)
{
switch(format)
{
case ECF_A1R5G5B5:
return 16;
case ECF_R5G6B5:
return 16;
case ECF_R8G8B8:
return 24;
case ECF_A8R8G8B8:
return 32;
case ECF_R16F:
return 16;
case ECF_G16R16F:
return 32;
case ECF_A16B16G16R16F:
return 64;
case ECF_R32F:
return 32;
case ECF_G32R32F:
return 64;
case ECF_A32B32G32R32F:
return 128;
default:
return 0;
}
}
static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)
{
switch(format)
{
case ECF_A1R5G5B5:
case ECF_R5G6B5:
case ECF_R8G8B8:
case ECF_A8R8G8B8:
return false;
default:
return true;
}
}
};
} // end namespace video
} // end namespace irr
#endif
IReferenceCounted.h
SColor.h
irr::IReferenceCounted::IReferenceCounted
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:46
irr::core::dimension2d
Specifies a 2 dimensional size.
Definition dimension2d.h:21
irr::core::rect
Rectangle template.
Definition rect.h:27
irr::video::IImage
Interface for software image data.
Definition IImage.h:23
irr::video::IImage::fill
virtual void fill(const SColor &color)=0
fills the surface with given color
irr::video::IImage::getPixel
virtual SColor getPixel(u32 x, u32 y) const =0
Returns a pixel.
irr::video::IImage::getBytesPerPixel
virtual u32 getBytesPerPixel() const =0
Returns bytes per pixel.
irr::video::IImage::getGreenMask
virtual u32 getGreenMask() const =0
Returns mask for green value of a pixel.
irr::video::IImage::getDimension
virtual const core::dimension2d< u32 > & getDimension() const =0
Returns width and height of image data.
irr::video::IImage::getBlueMask
virtual u32 getBlueMask() const =0
Returns mask for blue value of a pixel.
irr::video::IImage::getAlphaMask
virtual u32 getAlphaMask() const =0
Returns mask for alpha value of a pixel.
irr::video::IImage::copyToScalingBoxFilter
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
irr::video::IImage::copyToScaling
virtual void copyToScaling(void *target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0)=0
Copies the image into the target, scaling the image to fit.
irr::video::IImage::getBitsPerPixelFromFormat
static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format)
get the amount of Bits per Pixel of the given color format
Definition IImage.h:102
irr::video::IImage::copyToWithAlpha
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
irr::video::IImage::setPixel
virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend=false)=0
Sets a pixel.
irr::video::IImage::getImageDataSizeInPixels
virtual u32 getImageDataSizeInPixels() const =0
Returns image data size in pixels.
irr::video::IImage::copyToScaling
virtual void copyToScaling(IImage *target)=0
Copies the image into the target, scaling the image to fit.
irr::video::IImage::getPitch
virtual u32 getPitch() const =0
Returns pitch of image.
irr::video::IImage::getImageDataSizeInBytes
virtual u32 getImageDataSizeInBytes() const =0
Returns image data size in bytes.
irr::video::IImage::getRedMask
virtual u32 getRedMask() const =0
Returns mask for red value of a pixel.
irr::video::IImage::isRenderTargetOnlyFormat
static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)
test if the color format is only viable for RenderTarget textures
Definition IImage.h:135
irr::video::IImage::copyTo
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
irr::video::IImage::lock
virtual void * lock()=0
Lock function. Use this to get a pointer to the image data.
irr::video::IImage::getColorFormat
virtual ECOLOR_FORMAT getColorFormat() const =0
Returns the color format.
irr::video::IImage::unlock
virtual void unlock()=0
Unlock function.
irr::video::IImage::getBitsPerPixel
virtual u32 getBitsPerPixel() const =0
Returns bits per pixel.
irr::video::IImage::copyTo
virtual void copyTo(IImage *target, const core::position2d< s32 > &pos=core::position2d< s32 >(0, 0))=0
copies this surface into another
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition SColor.h:202
irr::video
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
irr::video::ECOLOR_FORMAT
ECOLOR_FORMAT
An enum for the color format of textures used by the Irrlicht Engine.
Definition SColor.h:18
irr::video::ECF_A1R5G5B5
@ ECF_A1R5G5B5
16 bit color format used by the software driver.
Definition SColor.h:23
irr::video::ECF_A32B32G32R32F
@ ECF_A32B32G32R32F
128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels.
Definition SColor.h:52
irr::video::ECF_R8G8B8
@ ECF_R8G8B8
24 bit color, no alpha channel, but 8 bit for red, green and blue.
Definition SColor.h:29
irr::video::ECF_R5G6B5
@ ECF_R5G6B5
Standard 16 bit color format.
Definition SColor.h:26
irr::video::ECF_A8R8G8B8
@ ECF_A8R8G8B8
Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
Definition SColor.h:32
irr::video::ECF_A16B16G16R16F
@ ECF_A16B16G16R16F
64 bit floating point format 16 bits are used for the red, green, blue and alpha channels.
Definition SColor.h:43
irr::video::ECF_G32R32F
@ ECF_G32R32F
64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel.
Definition SColor.h:49
irr::video::ECF_R16F
@ ECF_R16F
16 bit floating point format using 16 bits for the red channel.
Definition SColor.h:37
irr::video::ECF_R32F
@ ECF_R32F
32 bit floating point format using 32 bits for the red channel.
Definition SColor.h:46
irr::video::ECF_G16R16F
@ ECF_G16R16F
32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel.
Definition SColor.h:40
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
position2d.h
rect.h
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0