TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
iBitmap2D Struct Referenceabstract
Inheritance diagram for iBitmap2D:
iBitmapBase iUnknown

Detailed Description

2D Bitmap interface.

General

virtual tBool SetMemoryAddress (tPtr apAddr, tBool abFreeData, tU32 anPitch=eInvalidHandle)=0
 Set the memory address. More...
 
virtual tU32 GetPitch () const =0
 Get the number of bytes per line. {Property}. More...
 
virtual tPtr GetData () const =0
 Get the data pointer. {Property}. More...
 
virtual tU32 GetSize () const =0
 Get the size in bytes. {Property}. More...
 

Derived bitmaps creation

virtual iBitmap2DCreateResized (tI32 nW, tI32 nH) const =0
 Create a resized copy of this bitmap. More...
 
virtual iBitmap2DCreateResizedEx (tI32 nW, tI32 nH, tBool abPreserveMipMaps) const =0
 Create a resized copy of this bitmap. More...
 
virtual iBitmapCubeCreateCubeBitmap (tU32 anWidth, const sVec2i &avPX, ePixelFormatBlit aBlitPX, const sVec2i &avNX, ePixelFormatBlit aBlitNX, const sVec2i &avPY, ePixelFormatBlit aBlitPY, const sVec2i &avNY, ePixelFormatBlit aBlitNY, const sVec2i &avPZ, ePixelFormatBlit aBlitPZ, const sVec2i &avNZ, ePixelFormatBlit aBlitNZ) const =0
 Create a cube bitmap from the specified 6 rectangles. More...
 
virtual iBitmapCubeCreateCubeBitmapCross () const =0
 Create a cube bitmap from a vertical or horizontal cross unfolded cube. More...
 

Pixel format

virtual tBool BeginUnpackPixels ()=0
 Begin unpacking pixels. More...
 
virtual void EndUnpackPixels ()=0
 End unpacking pixels. More...
 

Mip maps

virtual iBitmap2DGetMipMap (tU32 ulIdx) const =0
 Get the mipmap at the specified index. More...
 
virtual iBitmap2DGetLevel (tU32 anIndex) const =0
 Get the bitmap at the specified level. More...
 

Blitting

virtual tBool Blit (const iBitmap2D *src, tI32 xs, tI32 ys, tI32 xd, tI32 yd, tI32 w, tI32 h, ePixelFormatBlit eBlit=ePixelFormatBlit_Normal)=0
 Blit a bitmap in this bitmap. More...
 
virtual tBool BlitStretch (const iBitmap2D *src, tI32 xs, tI32 ys, tI32 xd, tI32 yd, tI32 ws, tI32 hs, tI32 wd, tI32 hd)=0
 Blit stretch a bitmap in this bitmap. More...
 
virtual tBool BlitAlpha (const iBitmap2D *src, tI32 xs, tI32 ys, tI32 xd, tI32 yd, tI32 w, tI32 h, ePixelFormatBlit eBlit, const sColor4f &acolSource, const sColor4f &acolDest, eBlendMode aBlendMode)=0
 Blit, with alpha blending, a bitmap in this bitmap. More...
 
virtual tBool BlitAlphaStretch (const iBitmap2D *src, tI32 xs, tI32 ys, tI32 xd, tI32 yd, tI32 ws, tI32 hs, tI32 wd, tI32 hd, const sColor4f &acolSource, const sColor4f &acolDest, eBlendMode aBlendMode)=0
 Blit stretch, with alpha blending, a bitmap in this bitmap. More...
 

Primitives

virtual void PutPixel (tI32 x, tI32 y, tPtr col)=0
 Put a pixel at the specified position. {NoAutomation}. More...
 
virtual tPtr GetPixel (tI32 x, tI32 y, tPtr pOut) const =0
 Get a pixel at the specified position. {NoAutomation}. More...
 
virtual void Clear (tPtr pColor=NULL)=0
 Clear the bitmap {NoAutomation}. More...
 
virtual void ClearRect (const sRecti &aRect, tPtr pColor)=0
 Clear the bitmap. More...
 
virtual void PutPixelf (tI32 x, tI32 y, const sColor4f &avCol)=0
 Put a pixel at the specified position. More...
 
virtual sColor4f GetPixelf (tI32 x, tI32 y) const =0
 Get a pixel at the specified position. More...
 
virtual void Clearf (const sColor4f &avCol)=0
 Clear the bitmap. More...
 
virtual void ClearRectf (const sRecti &aRect, const sColor4f &avCol)=0
 Clear the bitmap. More...
 

Additional Inherited Members

- Public Member Functions inherited from iBitmapBase
virtual eBitmapType GetType () const =0
 Return the bitmap type. {Property}. More...
 
virtual tU32 GetWidth () const =0
 Get the texture width. {Property}. More...
 
virtual tU32 GetHeight () const =0
 Get the texture height. {Property}. More...
 
virtual tU32 GetDepth () const =0
 Get the texture depth. {Property}. More...
 
virtual iPixelFormatGetPixelFormat () const =0
 Get the pixel format of the texture. {Property}. More...
 
virtual tBool CreateMipMaps (tU32 anNumMipMaps, tBool abCompute)=0
 Create the mipmaps. More...
 
virtual void RemoveMipMaps ()=0
 Remove the mipmaps. More...
 
virtual tU32 GetNumMipMaps () const =0
 Get the number of mipmaps. {Property}. More...
 
virtual iBitmapBaseClone (ePixelFormatBlit eBlit=ePixelFormatBlit_Normal) const =0
 Create a copy of the bitmap. More...
 
virtual iBitmapBaseCreateConvertedFormat (const iPixelFormat *pFmt) const =0
 Create a copy of the bitmap that use the given format. More...
 
virtual iBitmapBaseCreateGammaCorrected (tF32 factor) const =0
 Create a gamma corrected bitmap. More...
 
virtual tBool GammaCorrect (tF32 factor)=0
 Correct gamma of the bitmap. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual tBool SetMemoryAddress ( tPtr  apAddr,
tBool  abFreeData,
tU32  anPitch = eInvalidHandle 
)
pure virtual

Set the memory address.

Parameters
apAddris the address of the bitmap's data.
abFreeDataif eTrue the data will be freed automatically when the bitmap is released.
anPitchif != eInvalidHandle will adjust the bitmap's pitch.
Returns
eFalse if apAddre is NULL, else eTrue.
Remarks
If abFreeData the memory must have been allocated with niNew or niMalloc.
virtual tU32 GetPitch ( ) const
pure virtual

Get the number of bytes per line. {Property}.

virtual tPtr GetData ( ) const
pure virtual

Get the data pointer. {Property}.

virtual tU32 GetSize ( ) const
pure virtual

Get the size in bytes. {Property}.

virtual iBitmap2D* CreateResized ( tI32  nW,
tI32  nH 
) const
pure virtual

Create a resized copy of this bitmap.

virtual iBitmap2D* CreateResizedEx ( tI32  nW,
tI32  nH,
tBool  abPreserveMipMaps 
) const
pure virtual

Create a resized copy of this bitmap.

Remarks
This variant of CreateResized as an additional parameter that allows to specify whether the mipmaps should be resized as-well or just dropped in the resized version.
virtual iBitmapCube* CreateCubeBitmap ( tU32  anWidth,
const sVec2i avPX,
ePixelFormatBlit  aBlitPX,
const sVec2i avNX,
ePixelFormatBlit  aBlitNX,
const sVec2i avPY,
ePixelFormatBlit  aBlitPY,
const sVec2i avNY,
ePixelFormatBlit  aBlitNY,
const sVec2i avPZ,
ePixelFormatBlit  aBlitPZ,
const sVec2i avNZ,
ePixelFormatBlit  aBlitNZ 
) const
pure virtual

Create a cube bitmap from the specified 6 rectangles.

virtual iBitmapCube* CreateCubeBitmapCross ( ) const
pure virtual

Create a cube bitmap from a vertical or horizontal cross unfolded cube.

Remarks
Wheter a vertical or horizontal cross is contained in the bitmap is determined from the ratio between the width and height of the bitmap. If the width is greater an horizontal cross is assumed, else if the height is greater then a vertical cross is assumed.
The cross is assumed to be on the 'top'/'left' of the bitmap.
Horizontal cross :
    |------------------------
    |     | PY  |           |
    |     |     |           |
    |------------------------
    | NX  | PZ  | PX  | NZ  |
    |     |     |     |     |
    |------------------------
    |     | NY  |           |
    |     |     |           |
    |------------------------
    
Vertical cross :
    |-----------------|
    |     | NX  |     |
    |     |     |     |
    |-----|-----|-----|
    | NY  | PZ  | PY  |
    |     |     |     |
    |-----|-----|-----|
    |     | PX  |     |
    |     |     |     |
    |     |-----|     |
    |     | NZ  |     |
    |     |     |     |
    |-----|-----|-----|
    
virtual tBool BeginUnpackPixels ( )
pure virtual

Begin unpacking pixels.

virtual void EndUnpackPixels ( )
pure virtual

End unpacking pixels.

virtual iBitmap2D* GetMipMap ( tU32  ulIdx) const
pure virtual

Get the mipmap at the specified index.

Remarks
Mip map zero is not the main surface but the first mip map. {Property}
virtual iBitmap2D* GetLevel ( tU32  anIndex) const
pure virtual

Get the bitmap at the specified level.

Remarks
0 is the main surface, 1 is the first mip map, and so on. {Property}
virtual tBool Blit ( const iBitmap2D src,
tI32  xs,
tI32  ys,
tI32  xd,
tI32  yd,
tI32  w,
tI32  h,
ePixelFormatBlit  eBlit = ePixelFormatBlit_Normal 
)
pure virtual

Blit a bitmap in this bitmap.

Remarks
Clipping and pixel format conversion are automatically performed.
virtual tBool BlitStretch ( const iBitmap2D src,
tI32  xs,
tI32  ys,
tI32  xd,
tI32  yd,
tI32  ws,
tI32  hs,
tI32  wd,
tI32  hd 
)
pure virtual

Blit stretch a bitmap in this bitmap.

Remarks
Clipping and pixel format conversion are automatically performed.
virtual tBool BlitAlpha ( const iBitmap2D src,
tI32  xs,
tI32  ys,
tI32  xd,
tI32  yd,
tI32  w,
tI32  h,
ePixelFormatBlit  eBlit,
const sColor4f acolSource,
const sColor4f acolDest,
eBlendMode  aBlendMode 
)
pure virtual

Blit, with alpha blending, a bitmap in this bitmap.

Remarks
The source and destination color are used to replace missing components in the source/destination format.
Clipping and pixel format conversion are automatically performed.
virtual tBool BlitAlphaStretch ( const iBitmap2D src,
tI32  xs,
tI32  ys,
tI32  xd,
tI32  yd,
tI32  ws,
tI32  hs,
tI32  wd,
tI32  hd,
const sColor4f acolSource,
const sColor4f acolDest,
eBlendMode  aBlendMode 
)
pure virtual

Blit stretch, with alpha blending, a bitmap in this bitmap.

Remarks
The source and destination color are used to replace missing components in the source/destination format.
Clipping and pixel format conversion are automatically performed.
virtual void PutPixel ( tI32  x,
tI32  y,
tPtr  col 
)
pure virtual

Put a pixel at the specified position. {NoAutomation}.

virtual tPtr GetPixel ( tI32  x,
tI32  y,
tPtr  pOut 
) const
pure virtual

Get a pixel at the specified position. {NoAutomation}.

virtual void Clear ( tPtr  pColor = NULL)
pure virtual

Clear the bitmap {NoAutomation}.

virtual void ClearRect ( const sRecti aRect,
tPtr  pColor 
)
pure virtual

Clear the bitmap.

Remarks
The right and bottom edges are not filled. {NoAutomation}
virtual void PutPixelf ( tI32  x,
tI32  y,
const sColor4f avCol 
)
pure virtual

Put a pixel at the specified position.

virtual sColor4f GetPixelf ( tI32  x,
tI32  y 
) const
pure virtual

Get a pixel at the specified position.

virtual void Clearf ( const sColor4f avCol)
pure virtual

Clear the bitmap.

virtual void ClearRectf ( const sRecti aRect,
const sColor4f avCol 
)
pure virtual

Clear the bitmap.

Remarks
The right and bottom edges are not filled.