Loading...
Searching...
No Matches
irr::video::IImage Class Referenceabstract

Interface for software image data. More...

`#include <IImage.h>`

Inheritance diagram for irr::video::IImage:

## Public Member Functions

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
virtual void | copyTo (IImage *target, const core::position2d< s32 > &pos=core::position2d< s32 >(0, 0))=0
| copies this surface into another
virtual void | copyToScaling (IImage *target)=0
| Copies the image into the target, scaling the image to fit.
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.
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
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 | fill (const SColor &color)=0
| fills the surface with given color
virtual u32 | getAlphaMask () const =0
| Returns mask for alpha value of a pixel.
virtual u32 | getBitsPerPixel () const =0
| Returns bits per pixel.
virtual u32 | getBlueMask () const =0
| Returns mask for blue value of a pixel.
virtual u32 | getBytesPerPixel () const =0
| Returns bytes per pixel.
virtual ECOLOR_FORMAT | getColorFormat () const =0
| Returns the color format.
virtual const core::dimension2d< u32 > & | getDimension () const =0
| Returns width and height of image data.
virtual u32 | getGreenMask () const =0
| Returns mask for green value of a pixel.
virtual u32 | getImageDataSizeInBytes () const =0
| Returns image data size in bytes.
virtual u32 | getImageDataSizeInPixels () const =0
| Returns image data size in pixels.
virtual u32 | getPitch () const =0
| Returns pitch of image.
virtual SColor | getPixel (u32 x, u32 y) const =0
| Returns a pixel.
virtual u32 | getRedMask () const =0
| Returns mask for red value of a pixel.
virtual void * | lock ()=0
| Lock function. Use this to get a pointer to the image data.
virtual void | setPixel (u32 x, u32 y, const SColor &color, bool blend=false)=0
| Sets a pixel.
virtual void | unlock ()=0
| Unlock function.
Public Member Functions inherited from irr::IReferenceCounted
| IReferenceCounted ()
| Constructor.
virtual | ~IReferenceCounted ()
| Destructor.
bool | drop () const
| Drops the object. Decrements the reference counter by one.
const c8 * | getDebugName () const
| Returns the debug name of the object.
s32 | getReferenceCount () const
| Get the reference count.
void | grab () const
| Grabs the object. Increments the reference counter by one.

## Static Public Member Functions

static u32 | getBitsPerPixelFromFormat (const ECOLOR_FORMAT format)
| get the amount of Bits per Pixel of the given color format
static bool | isRenderTargetOnlyFormat (const ECOLOR_FORMAT format)
| test if the color format is only viable for RenderTarget textures

## Additional Inherited Members

Protected Member Functions inherited from irr::IReferenceCounted
void | setDebugName (const c8 *newName)
| Sets the debug name of the object.

## Detailed Description

Interface for software image data.

Image loaders create these images from files. IVideoDrivers convert these images into their (hardware) textures.

Definition at line 22 of file IImage.h.

## Member Function Documentation

## copyTo() [1/2]

virtual void irr::video::IImage::copyTo | ( | IImage * | target,
|  | const core::position2d< s32 > & | pos,
|  | const core::rect< s32 > & | sourceRect,
|  | const core::rect< s32 > * | clipRect = 0 )

pure virtual

copies this surface into another

## copyTo() [2/2]

virtual void irr::video::IImage::copyTo | ( | IImage * | target,
|  | const core::position2d< s32 > & | pos = core::position2d< s32 >(0, 0) )

pure virtual

copies this surface into another

## copyToScaling() [1/2]

virtual void irr::video::IImage::copyToScaling | ( | IImage * | target | ) |

pure virtual

Copies the image into the target, scaling the image to fit.

## copyToScaling() [2/2]

virtual void irr::video::IImage::copyToScaling | ( | void * | target,
|  | u32 | width,
|  | u32 | height,
|  | ECOLOR_FORMAT | format = ECF_A8R8G8B8,
|  | u32 | pitch = 0 )

pure virtual

Copies the image into the target, scaling the image to fit.

References irr::video::ECF_A8R8G8B8.

## copyToScalingBoxFilter()

virtual void irr::video::IImage::copyToScalingBoxFilter | ( | IImage * | target,
|  | s32 | bias = 0,
|  | bool | blend = false )

pure virtual

copies this surface into another, scaling it to fit, appyling a box filter

## copyToWithAlpha()

virtual void irr::video::IImage::copyToWithAlpha | ( | IImage * | target,
|  | const core::position2d< s32 > & | pos,
|  | const core::rect< s32 > & | sourceRect,
|  | const SColor & | color,
|  | const core::rect< s32 > * | clipRect = 0 )

pure virtual

copies this surface into another, using the alpha mask and cliprect and a color to add with

## fill()

virtual void irr::video::IImage::fill | ( | const SColor & | color | ) |

pure virtual

fills the surface with given color

## getAlphaMask()

virtual u32 irr::video::IImage::getAlphaMask | ( |  | ) | const

pure virtual

Returns mask for alpha value of a pixel.

## getBitsPerPixel()

virtual u32 irr::video::IImage::getBitsPerPixel | ( |  | ) | const

pure virtual

Returns bits per pixel.

## getBitsPerPixelFromFormat()

u32 irr::video::IImage::getBitsPerPixelFromFormat | ( | const ECOLOR_FORMAT | format | ) |

inline static

get the amount of Bits per Pixel of the given color format

Definition at line 102 of file IImage.h.

References irr::video::ECF_A16B16G16R16F, irr::video::ECF_A1R5G5B5, irr::video::ECF_A32B32G32R32F, irr::video::ECF_A8R8G8B8, irr::video::ECF_G16R16F, irr::video::ECF_G32R32F, irr::video::ECF_R16F, irr::video::ECF_R32F, irr::video::ECF_R5G6B5, and irr::video::ECF_R8G8B8.

## getBlueMask()

virtual u32 irr::video::IImage::getBlueMask | ( |  | ) | const

pure virtual

Returns mask for blue value of a pixel.

## getBytesPerPixel()

virtual u32 irr::video::IImage::getBytesPerPixel | ( |  | ) | const

pure virtual

Returns bytes per pixel.

## getColorFormat()

virtual ECOLOR_FORMAT irr::video::IImage::getColorFormat | ( |  | ) | const

pure virtual

Returns the color format.

## getDimension()

virtual const core::dimension2d< u32 > & irr::video::IImage::getDimension | ( |  | ) | const

pure virtual

Returns width and height of image data.

## getGreenMask()

virtual u32 irr::video::IImage::getGreenMask | ( |  | ) | const

pure virtual

Returns mask for green value of a pixel.

## getImageDataSizeInBytes()

virtual u32 irr::video::IImage::getImageDataSizeInBytes | ( |  | ) | const

pure virtual

Returns image data size in bytes.

## getImageDataSizeInPixels()

virtual u32 irr::video::IImage::getImageDataSizeInPixels | ( |  | ) | const

pure virtual

Returns image data size in pixels.

## getPitch()

virtual u32 irr::video::IImage::getPitch | ( |  | ) | const

pure virtual

Returns pitch of image.

## getPixel()

virtual SColor irr::video::IImage::getPixel | ( | u32 | x,
|  | u32 | y ) const

pure virtual

Returns a pixel.

## getRedMask()

virtual u32 irr::video::IImage::getRedMask | ( |  | ) | const

pure virtual

Returns mask for red value of a pixel.

## isRenderTargetOnlyFormat()

bool irr::video::IImage::isRenderTargetOnlyFormat | ( | const ECOLOR_FORMAT | format | ) |

inline static

test if the color format is only viable for RenderTarget textures

Since we don't have support for e.g. floating point IImage formats one should test if the color format can be used for arbitrary usage, or if it is restricted to RTTs.

Definition at line 135 of file IImage.h.

References irr::video::ECF_A1R5G5B5, irr::video::ECF_A8R8G8B8, irr::video::ECF_R5G6B5, and irr::video::ECF_R8G8B8.

## lock()

virtual void * irr::video::IImage::lock | ( |  | ) |

pure virtual

Lock function. Use this to get a pointer to the image data.

After you don't need the pointer anymore, you must call unlock().

Returns
  Pointer to the image data. What type of data is pointed to depends on the color format of the image. For example if the color format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after you don't need the pointer any more.

## setPixel()

virtual void irr::video::IImage::setPixel | ( | u32 | x,
|  | u32 | y,
|  | const SColor & | color,
|  | bool | blend = false )

pure virtual

Sets a pixel.

## unlock()

virtual void irr::video::IImage::unlock | ( |  | ) |

pure virtual

Unlock function.

Should be called after the pointer received by lock() is not needed anymore.

The documentation for this class was generated from the following file:

- IImage.h

- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0