Description

Collection of Bitmap related operations.

Classes

   
struct Util::BitmapUtils::BitmapAlteringContext

Typedefs

   
   
typedef std::function< Color4f (const BitmapAlteringContext &)> BitmapAlteringFunction

Functions

   
   
void alterBitmap( Bitmap & bitmap, const BitmapAlteringFunction & op)
   
Reference < Bitmap > blendTogether(const AttributeFormat & targetFormat, const std::vector< Reference < Bitmap > > & sources)
Blend all given images into one having the given format.
   
Reference < Bitmap > combineInterleaved(const AttributeFormat & targetFormat, const std::vector< Reference < Bitmap > > & sources)
   
Reference < Bitmap > convertBitmap(const Bitmap & source, const AttributeFormat & newFormat)
   
Reference < Bitmap > createBitmapFromBitMask(const uint32_t width, const uint32_t height, const AttributeFormat & format, const size_t dataSize, const uint8_t * data)
   
void normalizeBitmap( Bitmap & bitmap)
Normalizes each pixel to the range [0,1].
   
Reference < Bitmap > createBitmapFromSDLSurface(SDL_Surface * surface)
Conversion between Bitmap and SDL_Surface.
   
SDL_Surface * createSDLSurfaceFromBitmap(const Bitmap & bitmap)
Conversion between SDL_Surface and Bitmap .

Documentation

typedef
Util::BitmapUtils::BitmapAlteringFunction

public
 
 
typedef std::function< Color4f (const BitmapAlteringContext &)> BitmapAlteringFunction

Defined in Util/Graphics/BitmapUtils.h:41


function
Util::BitmapUtils::alterBitmap

public
     
     
void alterBitmap( Bitmap & bitmap,
  const BitmapAlteringFunction & op
)    

Change the content of a Bitmap .

Note: this function is designed for flexibility and not for high performance. For real-time applications use a specialized implementation.

Parameters

bitmap
Bitmap that is to be changed
op
Operation that is called for every pixel of the bitmap

Defined in Util/Graphics/BitmapUtils.h:51


function
Util::BitmapUtils::blendTogether

public
     
     
Reference < Bitmap > blendTogether( const AttributeFormat & targetFormat,
  const std::vector< Reference < Bitmap > > & sources
)    

Blend all given images into one having the given format.

Defined in Util/Graphics/BitmapUtils.h:55


function
Util::BitmapUtils::combineInterleaved

public
     
     
Reference < Bitmap > combineInterleaved( const AttributeFormat & targetFormat,
  const std::vector< Reference < Bitmap > > & sources
)    

Combines all given images into one having the given format.

Note: first pixel of first bitmap, first pixel of second bitmap, etc…

Defined in Util/Graphics/BitmapUtils.h:62


function
Util::BitmapUtils::convertBitmap

public
     
     
Reference < Bitmap > convertBitmap( const Bitmap & source,
  const AttributeFormat & newFormat
)    

internal method, used for saving images which are in a format that can’t be saved directly because of the limitations of png, bmp, etc…

Parameters

source
the bitmap to be converted
newFormat
the Pixelformat into which the bitmap schould be converted

Returns

a new bitmap of the specified format with the content of the given bitmap

Defined in Util/Graphics/BitmapUtils.h:73


function
Util::BitmapUtils::createBitmapFromBitMask

public
     
     
Reference < Bitmap > createBitmapFromBitMask( const uint32_t width,
  const uint32_t height,
  const AttributeFormat & format,
  const size_t dataSize,
  const uint8_t * data
)    

Create a black/transparent - white bitmap with the given format based on a bitmask given as raw data. This is used for storing bitmap-font-data directly in a source file.

Defined in Util/Graphics/BitmapUtils.h:81


function
Util::BitmapUtils::normalizeBitmap

public
     
     
void normalizeBitmap( Bitmap & bitmap )

Normalizes each pixel to the range [0,1].

Defined in Util/Graphics/BitmapUtils.h:88


function
Util::BitmapUtils::createBitmapFromSDLSurface

public
     
     
Reference < Bitmap > createBitmapFromSDLSurface( SDL_Surface * surface )

Conversion between Bitmap and SDL_Surface.

Defined in Util/Graphics/BitmapUtils.h:92


function
Util::BitmapUtils::createSDLSurfaceFromBitmap

public
     
     
SDL_Surface * createSDLSurfaceFromBitmap( const Bitmap & bitmap )

Conversion between SDL_Surface and Bitmap .

Defined in Util/Graphics/BitmapUtils.h:94