mmsfbbase.h File Reference

#include <cstring>
#include <string.h>
#include "mmstools/base.h"
#include "mmstools/mmstypes.h"
#include "mmstools/mmsmutex.h"
#include "mmstools/mmstafffile.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XShm.h>
#include <direct/debug.h>
#include <direct/trace.h>
#include <directfb.h>
#include <directfb_keynames.h>
#include <directfb_strings.h>
#include <directfb_util.h>

Include dependency graph for mmsfbbase.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Classes

struct  MMSFBPixelDef

Defines

#define MMSFB_TRACE()   do {} while (0)
#define MMSFB_BREAK()   do {} while (0)
#define USE_MMSFB_WINMAN
#define MMSFB_BLIT_CNT   0x40
 max combination of blitting flags
#define MMSFB_BLIT_NOFX   0x00000000
 surface blitting flag: no effects
#define MMSFB_BLIT_BLEND_ALPHACHANNEL   0x00000001
 surface blitting flag: use alphachannel from source
#define MMSFB_BLIT_BLEND_COLORALPHA   0x00000002
 surface blitting flag: use alphachannel from color
#define MMSFB_BLIT_COLORIZE   0x00000004
 surface blitting flag: modulates source pixel with color
#define MMSFB_BLIT_SRC_PREMULTIPLY   0x00000008
 surface blitting flag: modulates the source color with the source alpha
#define MMSFB_BLIT_SRC_PREMULTCOLOR   0x00000010
 surface blitting flag: modulates the source color with the color alpha
#define MMSFB_BLIT_ANTIALIASING   0x00000020
 surface blitting flag: antialiasing (stretchBlit(), not all pixelformats will be supported)
#define MMSFB_DRAW_CNT   0x04
 max combination of drawing flags
#define MMSFB_DRAW_NOFX   0x00000000
 surface drawing flag: no effects
#define MMSFB_DRAW_BLEND   0x00000001
 surface drawing flag: alpha from surface color
#define MMSFB_DRAW_SRC_PREMULTIPLY   0x00000002
 surface drawing flag: multiplies the color with the alpha channel
#define MMSFB_FLIP_NONE   0x00000000
 surface flip flag: none
#define MMSFB_FLIP_WAIT   0x00000001
 surface flip flag: returns upon vertical sync
#define MMSFB_FLIP_ONSYNC   0x00000002
 surface flip flag: flip upon the next vertical sync
#define MMSFB_FLIP_WAITFORSYNC   0x00000004
 surface flip flag: WAIT and ONSYNC
#define MMSFB_FLIP_FLUSH   0x00000008
 surface flip flag: send pan event to fbdev every time the display buffer has changed
#define MMSFB_LOCK_NONE   0x00000000
 surface lock flag: none
#define MMSFB_LOCK_READ   0x00000001
 surface lock flag: read access
#define MMSFB_LOCK_WRITE   0x00000002
 surface lock flag: write access
#define MMSFB_BM_NONE   ""
 buffer mode: none
#define MMSFB_BM_FRONTONLY   "FRONTONLY"
 buffer mode: no backbuffer
#define MMSFB_BM_BACKVIDEO   "BACKVIDEO"
 buffer mode: backbuffer in video memory
#define MMSFB_BM_BACKSYSTEM   "BACKSYSTEM"
 buffer mode: backbuffer in system memory
#define MMSFB_BM_TRIPLE   "TRIPLE"
 buffer mode: triple buffering
#define MMSFB_BM_WINDOWS   "WINDOWS"
 buffer mode: no layer buffers at all, using buffer of each window
#define MMSFB_LO_NONE   ""
 layer option: none
#define MMSFB_LO_ALPHACHANNEL   "ALPHACHANNEL"
 layer option: Make usage of alpha channel for blending on a pixel per pixel basis.
#define MMSFB_LO_FLICKER_FILTERING   "FLICKER_FILTERING"
 layer option: Enable flicker filtering.
#define MMSFB_LO_DEINTERLACING   "DEINTERLACING"
 layer option: Enable deinterlacing of an interlaced (video) source.
#define MMSFB_LO_SRC_COLORKEY   "SRC_COLORKEY"
 layer option: Enable source color key.
#define MMSFB_LO_DST_COLORKEY   "DST_COLORKEY"
 layer option: Enable dest. color key.
#define MMSFB_LO_OPACITY   "OPACITY"
 layer option: Make usage of the global alpha factor set by SetOpacity.
#define MMSFB_LO_FIELD_PARITY   "FIELD_PARITY"
 layer option: Set field parity.
#define MMSFBPERF_START_MEASURING
#define MMSFBPERF_STOP_MEASURING_FILLRECT(surface, dw, dh)
#define MMSFBPERF_STOP_MEASURING_DRAWLINE(surface, x1, y1, x2, y2)
#define MMSFBPERF_STOP_MEASURING_DRAWSTRING(surface, clipreg, text, len, x, y)
#define MMSFBPERF_STOP_MEASURING_BLIT(surface, src_pixelformat, sw, sh)
#define MMSFBPERF_STOP_MEASURING_STRETCHBLIT(surface, source, sw, sh, dw, dh)
#define MMSFBPERF_STOP_MEASURING_XSHMPUTIMAGE(surface, sw, sh)
#define MMSFBPERF_STOP_MEASURING_XVSHMPUTIMAGE(surface, sw, sh, dw, dh)
#define MMSFBPERF_STOP_MEASURING_VSYNC(surface)
#define MMSFBPERF_STOP_MEASURING_SWAPDISPLAY(surface)

Typedefs

typedef unsigned int MMSFBBlittingFlags
 surface blitting flags
typedef unsigned int MMSFBDrawingFlags
 surface drawing flags
typedef unsigned int MMSFBFlipFlags
 surface flip flags
typedef unsigned int MMSFBLockFlags
 surface lock flags

Enumerations

enum  MMSFBMergingMode { MMSFB_MM_ANAGLYPH_RED_CYAN = 0, MMSFB_MM_LINE_INTERLEAVED }
 surface merging mode More...

Functions

string MMSFB_ErrorString (const int rc, const string msg)
void MMSFB_SetError (const int rc, const string msg)
bool isAlphaPixelFormat (MMSFBSurfacePixelFormat pf)
bool isIndexedPixelFormat (MMSFBSurfacePixelFormat pf)
bool isRGBPixelFormat (MMSFBSurfacePixelFormat pf)
void getBitsPerPixel (MMSFBSurfacePixelFormat pf, MMSFBPixelDef *pixeldef)
MMSFBSurfacePixelFormat getMMSFBPixelFormatFromDFBPixelFormat (DFBSurfacePixelFormat pf)
DFBSurfacePixelFormat getDFBPixelFormatFromMMSFBPixelFormat (MMSFBSurfacePixelFormat pf)
string getDFBLayerBufferModeString (DFBDisplayLayerBufferMode bm)
DFBDisplayLayerBufferMode getDFBLayerBufferModeFromString (string bm)
string getDFBLayerOptionsString (DFBDisplayLayerOptions opts)
DFBDisplayLayerOptions getDFBLayerOptionsFromString (string opts)
DFBSurfaceBlittingFlags getDFBSurfaceBlittingFlagsFromMMSFBBlittingFlags (MMSFBBlittingFlags flags)
DFBSurfaceDrawingFlags getDFBSurfaceDrawingFlagsFromMMSFBDrawingFlags (MMSFBDrawingFlags flags)
DFBSurfaceFlipFlags getDFBSurfaceFlipFlagsFromMMSFBFlipFlags (MMSFBFlipFlags flags)
DFBSurfaceLockFlags getDFBSurfaceLockFlagsFromMMSFBLockFlags (MMSFBLockFlags flags)
void calcAspectRatio (int sw, int sh, int dw, int dh, MMSFBRectangle &dest, bool aspect_ratio, bool even_aligned)

Variables

string MMSFB_LastErrorString
bool MMSFBBase_rotate180

Define Documentation

#define MMSFB_BLIT_ANTIALIASING   0x00000020

surface blitting flag: antialiasing (stretchBlit(), not all pixelformats will be supported)

Definition at line 113 of file mmsfbbase.h.

#define MMSFB_BLIT_BLEND_ALPHACHANNEL   0x00000001

surface blitting flag: use alphachannel from source

Definition at line 103 of file mmsfbbase.h.

#define MMSFB_BLIT_BLEND_COLORALPHA   0x00000002

surface blitting flag: use alphachannel from color

Definition at line 105 of file mmsfbbase.h.

#define MMSFB_BLIT_CNT   0x40

max combination of blitting flags

Definition at line 98 of file mmsfbbase.h.

#define MMSFB_BLIT_COLORIZE   0x00000004

surface blitting flag: modulates source pixel with color

Definition at line 107 of file mmsfbbase.h.

#define MMSFB_BLIT_NOFX   0x00000000

surface blitting flag: no effects

Definition at line 101 of file mmsfbbase.h.

#define MMSFB_BLIT_SRC_PREMULTCOLOR   0x00000010

surface blitting flag: modulates the source color with the color alpha

Definition at line 111 of file mmsfbbase.h.

#define MMSFB_BLIT_SRC_PREMULTIPLY   0x00000008

surface blitting flag: modulates the source color with the source alpha

Definition at line 109 of file mmsfbbase.h.

#define MMSFB_BM_BACKSYSTEM   "BACKSYSTEM"

buffer mode: backbuffer in system memory

Definition at line 173 of file mmsfbbase.h.

#define MMSFB_BM_BACKVIDEO   "BACKVIDEO"

buffer mode: backbuffer in video memory

Definition at line 171 of file mmsfbbase.h.

#define MMSFB_BM_FRONTONLY   "FRONTONLY"

buffer mode: no backbuffer

Definition at line 169 of file mmsfbbase.h.

#define MMSFB_BM_NONE   ""

buffer mode: none

Definition at line 167 of file mmsfbbase.h.

#define MMSFB_BM_TRIPLE   "TRIPLE"

buffer mode: triple buffering

Definition at line 175 of file mmsfbbase.h.

#define MMSFB_BM_WINDOWS   "WINDOWS"

buffer mode: no layer buffers at all, using buffer of each window

Definition at line 177 of file mmsfbbase.h.

 
#define MMSFB_BREAK (  )     do {} while (0)

Definition at line 77 of file mmsfbbase.h.

#define MMSFB_DRAW_BLEND   0x00000001

surface drawing flag: alpha from surface color

Definition at line 124 of file mmsfbbase.h.

#define MMSFB_DRAW_CNT   0x04

max combination of drawing flags

Definition at line 119 of file mmsfbbase.h.

#define MMSFB_DRAW_NOFX   0x00000000

surface drawing flag: no effects

Definition at line 122 of file mmsfbbase.h.

#define MMSFB_DRAW_SRC_PREMULTIPLY   0x00000002

surface drawing flag: multiplies the color with the alpha channel

Definition at line 126 of file mmsfbbase.h.

#define MMSFB_FLIP_FLUSH   0x00000008

surface flip flag: send pan event to fbdev every time the display buffer has changed

Definition at line 141 of file mmsfbbase.h.

#define MMSFB_FLIP_NONE   0x00000000

surface flip flag: none

Definition at line 133 of file mmsfbbase.h.

#define MMSFB_FLIP_ONSYNC   0x00000002

surface flip flag: flip upon the next vertical sync

Definition at line 137 of file mmsfbbase.h.

#define MMSFB_FLIP_WAIT   0x00000001

surface flip flag: returns upon vertical sync

Definition at line 135 of file mmsfbbase.h.

#define MMSFB_FLIP_WAITFORSYNC   0x00000004

surface flip flag: WAIT and ONSYNC

Definition at line 139 of file mmsfbbase.h.

#define MMSFB_LO_ALPHACHANNEL   "ALPHACHANNEL"

layer option: Make usage of alpha channel for blending on a pixel per pixel basis.

Definition at line 183 of file mmsfbbase.h.

#define MMSFB_LO_DEINTERLACING   "DEINTERLACING"

layer option: Enable deinterlacing of an interlaced (video) source.

Definition at line 187 of file mmsfbbase.h.

#define MMSFB_LO_DST_COLORKEY   "DST_COLORKEY"

layer option: Enable dest. color key.

Definition at line 191 of file mmsfbbase.h.

#define MMSFB_LO_FIELD_PARITY   "FIELD_PARITY"

layer option: Set field parity.

Definition at line 195 of file mmsfbbase.h.

#define MMSFB_LO_FLICKER_FILTERING   "FLICKER_FILTERING"

layer option: Enable flicker filtering.

Definition at line 185 of file mmsfbbase.h.

#define MMSFB_LO_NONE   ""

layer option: none

Definition at line 181 of file mmsfbbase.h.

#define MMSFB_LO_OPACITY   "OPACITY"

layer option: Make usage of the global alpha factor set by SetOpacity.

Definition at line 193 of file mmsfbbase.h.

#define MMSFB_LO_SRC_COLORKEY   "SRC_COLORKEY"

layer option: Enable source color key.

Definition at line 189 of file mmsfbbase.h.

#define MMSFB_LOCK_NONE   0x00000000

surface lock flag: none

Definition at line 148 of file mmsfbbase.h.

#define MMSFB_LOCK_READ   0x00000001

surface lock flag: read access

Definition at line 150 of file mmsfbbase.h.

#define MMSFB_LOCK_WRITE   0x00000002

surface lock flag: write access

Definition at line 152 of file mmsfbbase.h.

 
#define MMSFB_TRACE (  )     do {} while (0)

Definition at line 71 of file mmsfbbase.h.

#define MMSFBPERF_START_MEASURING

Definition at line 302 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_BLIT ( surface,
src_pixelformat,
sw,
sh   ) 

Definition at line 306 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_DRAWLINE ( surface,
x1,
y1,
x2,
y2   ) 

Definition at line 304 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_DRAWSTRING ( surface,
clipreg,
text,
len,
x,
 ) 

Definition at line 305 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_FILLRECT ( surface,
dw,
dh   ) 

Definition at line 303 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_STRETCHBLIT ( surface,
source,
sw,
sh,
dw,
dh   ) 

Definition at line 307 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_SWAPDISPLAY ( surface   ) 

Definition at line 311 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_VSYNC ( surface   ) 

Definition at line 310 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_XSHMPUTIMAGE ( surface,
sw,
sh   ) 

Definition at line 308 of file mmsfbbase.h.

#define MMSFBPERF_STOP_MEASURING_XVSHMPUTIMAGE ( surface,
sw,
sh,
dw,
dh   ) 

Definition at line 309 of file mmsfbbase.h.

#define USE_MMSFB_WINMAN

Definition at line 84 of file mmsfbbase.h.


Typedef Documentation

typedef unsigned int MMSFBBlittingFlags

surface blitting flags

Definition at line 95 of file mmsfbbase.h.

typedef unsigned int MMSFBDrawingFlags

surface drawing flags

Definition at line 116 of file mmsfbbase.h.

typedef unsigned int MMSFBFlipFlags

surface flip flags

Definition at line 130 of file mmsfbbase.h.

typedef unsigned int MMSFBLockFlags

surface lock flags

Definition at line 145 of file mmsfbbase.h.


Enumeration Type Documentation

surface merging mode

Enumerator:
MMSFB_MM_ANAGLYPH_RED_CYAN  surface merging mode: anaglyph red-cyan (red channel from first, green and blue channels from second source surface)
MMSFB_MM_LINE_INTERLEAVED  surface merging mode: line interleaved (even lines from first, odd lines from second source surface)

Definition at line 156 of file mmsfbbase.h.


Function Documentation

void calcAspectRatio ( int  sw,
int  sh,
int  dw,
int  dh,
MMSFBRectangle dest,
bool  aspect_ratio,
bool  even_aligned 
)

Definition at line 549 of file mmsfbbase.cpp.

void getBitsPerPixel ( MMSFBSurfacePixelFormat  pf,
MMSFBPixelDef pixeldef 
)

Definition at line 107 of file mmsfbbase.cpp.

DFBDisplayLayerBufferMode getDFBLayerBufferModeFromString ( string  bm  ) 

Definition at line 437 of file mmsfbbase.cpp.

string getDFBLayerBufferModeString ( DFBDisplayLayerBufferMode  bm  ) 

Definition at line 416 of file mmsfbbase.cpp.

DFBDisplayLayerOptions getDFBLayerOptionsFromString ( string  opts  ) 

Definition at line 480 of file mmsfbbase.cpp.

string getDFBLayerOptionsString ( DFBDisplayLayerOptions  opts  ) 

Definition at line 456 of file mmsfbbase.cpp.

DFBSurfacePixelFormat getDFBPixelFormatFromMMSFBPixelFormat ( MMSFBSurfacePixelFormat  pf  ) 

Definition at line 380 of file mmsfbbase.cpp.

DFBSurfaceBlittingFlags getDFBSurfaceBlittingFlagsFromMMSFBBlittingFlags ( MMSFBBlittingFlags  flags  ) 

Definition at line 503 of file mmsfbbase.cpp.

DFBSurfaceDrawingFlags getDFBSurfaceDrawingFlagsFromMMSFBDrawingFlags ( MMSFBDrawingFlags  flags  ) 

Definition at line 518 of file mmsfbbase.cpp.

DFBSurfaceFlipFlags getDFBSurfaceFlipFlagsFromMMSFBFlipFlags ( MMSFBFlipFlags  flags  ) 

Definition at line 527 of file mmsfbbase.cpp.

DFBSurfaceLockFlags getDFBSurfaceLockFlagsFromMMSFBLockFlags ( MMSFBLockFlags  flags  ) 

Definition at line 538 of file mmsfbbase.cpp.

MMSFBSurfacePixelFormat getMMSFBPixelFormatFromDFBPixelFormat ( DFBSurfacePixelFormat  pf  ) 

Definition at line 346 of file mmsfbbase.cpp.

bool isAlphaPixelFormat ( MMSFBSurfacePixelFormat  pf  ) 

Definition at line 64 of file mmsfbbase.cpp.

bool isIndexedPixelFormat ( MMSFBSurfacePixelFormat  pf  ) 

Definition at line 86 of file mmsfbbase.cpp.

bool isRGBPixelFormat ( MMSFBSurfacePixelFormat  pf  ) 

Definition at line 93 of file mmsfbbase.cpp.

string MMSFB_ErrorString ( const int  rc,
const string  msg 
)

Definition at line 44 of file mmsfbbase.cpp.

void MMSFB_SetError ( const int  rc,
const string  msg 
)

Definition at line 59 of file mmsfbbase.cpp.


Variable Documentation

Definition at line 38 of file mmsfbbase.cpp.

Definition at line 41 of file mmsfbbase.cpp.