22#ifndef __SOFTHDDEVICE_OPENGLOSD_H
23#define __SOFTHDDEVICE_OPENGLOSD_H
31#include FT_LCD_FILTER_H
35#define FT_ERRORDEF( e, v, s ) { e, s },
36#define FT_ERROR_START_LIST {
37#define FT_ERROR_END_LIST { 0, 0 } };
46#include <glm/gtc/matrix_transform.hpp>
51#define BORDERCOLOR 0x00000000
83 void SetFloat (
const GLchar *, GLfloat);
85 void SetVector2f (
const GLchar *, GLfloat, GLfloat);
86 void SetVector3f (
const GLchar *, GLfloat, GLfloat, GLfloat);
87 void SetVector4f (
const GLchar *, GLfloat, GLfloat, GLfloat, GLfloat);
88 void SetMatrix4 (
const GLchar *,
const glm::mat4 &);
94 bool Compile(
const char *,
const char *);
148 cOglAtlasGlyph(FT_ULong charCode, FT_BitmapGlyph ftGlyph,
float offsetX,
float offsetY)
175#define MIN_CHARCODE 32
176#define MAX_CHARCODE 255
225 static void Init(
void);
236 cOglFb(GLint, GLint, GLint, GLint);
240 virtual bool Init(
void);
242 virtual void Unbind(
void);
244 void Blit(GLint, GLint, GLint, GLint);
270 virtual bool Init(
void);
271 virtual void Unbind(
void);
350 virtual const char*
Description(
void) {
return "InitOutputFramebuffer"; }
363 virtual const char*
Description(
void) {
return "InitFramebuffer"; }
375 virtual const char*
Description(
void) {
return "DeleteFramebuffer"; }
382 cOglCmdRenderFbToBufferFb(
cOglFb *fb,
cOglFb *buffer, GLint x, GLint y, GLint transparency, GLint drawPortX, GLint drawPortY, GLint dirtyX, GLint dirtyTop, GLint dirtyWidth, GLint dirtyHeight,
bool alphablending,
cSoftHdDevice *device)
398 virtual const char*
Description(
void) {
return "Render Framebuffer to Buffer"; }
426 virtual const char*
Description(
void) {
return "Copy buffer to OutputFramebuffer"; }
530 cOglCmdDrawText(
cOglFb *fb, GLint x, GLint y,
unsigned int *symbols, GLint limitX,
const char *name,
int fontSize, tColor colorText,
int length)
556 cOglCmdDrawImage(
cOglFb *fb, tColor *argb, GLint width, GLint height, GLint x, GLint y,
bool overlay =
true,
double scaleX = 1.0f,
double scaleY = 1.0f)
639#define OGL_MAX_OSDIMAGES 512
640#define OGL_CMDQUEUE_SIZE 200
655 virtual void Action(
void);
687 cOglPixmap(std::shared_ptr<cOglThread>,
int,
const cRect &,
const cRect &DrawPort = cRect::Null);
691 int X(
void) {
return ViewPort().X(); };
692 int Y(
void) {
return ViewPort().Y(); };
700 virtual void Clear(
void);
701 virtual void Fill(tColor);
702 virtual void DrawImage(
const cPoint &,
const cImage &);
703 virtual void DrawImage(
const cPoint &,
int);
704 virtual void DrawScaledImage(
const cPoint &,
const cImage &,
double FactorX = 1.0f,
double FactorY = 1.0f,
bool AntiAlias =
false);
705 virtual void DrawScaledImage(
const cPoint &,
int,
double FactorX = 1.0f,
double FactorY = 1.0f,
bool AntiAlias =
false);
706 virtual void DrawPixel(
const cPoint &, tColor);
707 virtual void DrawBitmap(
const cPoint &,
const cBitmap &, tColor ColorFg = 0, tColor ColorBg = 0,
bool Overlay =
false);
708 virtual void DrawText(
const cPoint &,
const char *, tColor, tColor,
const cFont *,
int Width = 0,
int Height = 0,
int Alignment = taDefault);
710 virtual void DrawEllipse(
const cRect &, tColor,
int Quadrants = 0);
711 virtual void DrawSlope(
const cRect &, tColor,
int);
712 virtual void Render(
const cPixmap *,
const cRect &,
const cPoint &);
713 virtual void Copy(
const cPixmap *,
const cRect &,
const cPoint &);
714 virtual void Scroll(
const cPoint &,
const cRect &Source = cRect::Null);
715 virtual void Pan(
const cPoint &,
const cRect &Source = cRect::Null);
725 void DrawGridRect(
const cRect &,
int,
int, tColor, tColor,
const cFont *);
726 void DrawGridText(
const cPoint &,
const char *, tColor, tColor,
const cFont *,
int Width = 0,
int Height = 0,
int Alignment = taDefault);
728 void DrawTextInternal(
const cPoint &,
const char *, tColor, tColor,
const cFont *,
int Width = 0,
int Height = 0,
int Alignment = taDefault,
bool isGridText =
false);
742 virtual eOsdError
SetAreas(
const tArea *,
int);
743 virtual cPixmap *
CreatePixmap(
int,
const cRect &,
const cRect &DrawPort = cRect::Null);
745 virtual void Flush(
void);
747 virtual void DrawScaledBitmap(
int,
int,
const cBitmap &,
double,
double,
bool AntiAlias =
false);
float OffsetY(void) const
float OffsetX(void) const
cOglAtlasGlyph(FT_ULong charCode, FT_BitmapGlyph ftGlyph, float offsetX, float offsetY)
virtual ~cOglCmdBufferFill(void)
cOglCmdBufferFill(cOglFb *fb, GLint color)
virtual const char * Description(void)
virtual bool Execute(void)
virtual const char * Description(void)
cOglOutputFb * m_pOutputFramebuffer
virtual ~cOglCmdCopyBufferToOutputFb(void)
virtual bool Execute(void)
cOglCmdCopyBufferToOutputFb(cOglFb *fb, cOglOutputFb *oFb, GLint x, GLint y, int active, cSoftHdDevice *device)
cSoftHdDevice * m_pDevice
virtual ~cOglCmdDeleteFb(void)
virtual bool Execute(void)
virtual const char * Description(void)
cOglCmdDeleteFb(cOglFb *fb)
virtual ~cOglCmdDrawEllipse(void)
GLfloat * CreateVerticesFull(int &)
GLfloat * CreateVerticesHalf(int &)
GLfloat * CreateVerticesQuadrant(int &)
virtual const char * Description(void)
virtual bool Execute(void)
cOglCmdDrawEllipse(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color, GLint quadrants)
virtual bool Execute(void)
virtual ~cOglCmdDrawImage(void)
virtual const char * Description(void)
cOglCmdDrawImage(cOglFb *fb, tColor *argb, GLint width, GLint height, GLint x, GLint y, bool overlay=true, double scaleX=1.0f, double scaleY=1.0f)
virtual bool Execute(void)
cOglCmdDrawRectangle(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color)
virtual ~cOglCmdDrawRectangle(void)
virtual const char * Description(void)
virtual bool Execute(void)
virtual const char * Description(void)
virtual ~cOglCmdDrawSlope(void)
cOglCmdDrawSlope(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color, GLint type)
cOglCmdDrawText(cOglFb *fb, GLint x, GLint y, unsigned int *symbols, GLint limitX, const char *name, int fontSize, tColor colorText, int length)
unsigned int * m_pSymbols
virtual bool Execute(void)
virtual ~cOglCmdDrawText(void)
virtual const char * Description(void)
virtual const char * Description(void)
virtual bool Execute(void)
virtual ~cOglCmdDrawTexture(void)
cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX=1.0f, double scaleY=1.0f)
virtual ~cOglCmdDropImage(void)
cOglCmdDropImage(sOglImage *imageRef, cCondWait *wait)
virtual const char * Description(void)
virtual bool Execute(void)
virtual const char * Description(void)
cOglCmdFill(cOglFb *fb, GLint color)
virtual ~cOglCmdFill(void)
virtual bool Execute(void)
virtual ~cOglCmdInitFb(void)
virtual bool Execute(void)
cOglCmdInitFb(cOglFb *fb, cCondWait *wait=NULL)
virtual const char * Description(void)
virtual const char * Description(void)
cOglCmdInitOutputFb(cOglOutputFb *oFb)
cOglOutputFb * m_pOutputFramebuffer
virtual ~cOglCmdInitOutputFb(void)
virtual bool Execute(void)
virtual bool Execute(void)
cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency, GLint drawPortX, GLint drawPortY, GLint dirtyX, GLint dirtyTop, GLint dirtyWidth, GLint dirtyHeight, bool alphablending, cSoftHdDevice *device)
virtual ~cOglCmdRenderFbToBufferFb(void)
virtual const char * Description(void)
cSoftHdDevice * m_pDevice
virtual bool Execute(void)
cOglCmdStoreImage(sOglImage *imageRef, tColor *argb)
virtual ~cOglCmdStoreImage(void)
virtual const char * Description(void)
virtual bool Execute(void)=0
virtual const char * Description(void)=0
virtual void Unbind(void)
GLint ViewportHeight(void)
void Blit(GLint, GLint, GLint, GLint)
GLint ViewportWidth(void)
cOglAtlasGlyph * GetGlyph(int) const
virtual ~cOglFontAtlas(void)
cOglAtlasGlyph * m_pGlyph[MAX_CHARCODE - MIN_CHARCODE+1]
static void Cleanup(void)
cOglFontAtlas * Atlas(void)
cOglGlyph * Glyph(FT_ULong) const
static cOglFont * Get(const char *, int)
int Kerning(cOglGlyph *glyph, FT_ULong prevSym) const
cList< cOglGlyph > m_glyphCache
static FT_Library s_ftLib
static cList< cOglFont > * s_pFonts
unsigned char * m_pBuffer
int BearingTop(void) const
void SetKerningCache(FT_ULong, int)
int BearingLeft(void) const
int GetKerningCache(FT_ULong)
cVector< tKerning > m_pKerningCache
std::shared_ptr< cOglThread > m_pOglThread
pointer to thread, which executes the commands
bool m_isSubtitleOsd
true, if this is a subtitle osd
cSoftHdDevice * m_pDevice
pointer to cSofthdDevice
cOglFb * m_pBufferFramebuffer
all pixmaps are composed onto this framebuffer after each other, before this one is blit onto the OSD...
static cOglOutputFb * OutputFramebuffer
main OSD output framebuffer - this keeps our finished "OSD" (one per OSD)
virtual eOsdError SetAreas(const tArea *, int)
cRect m_pDirtyViewport
the dirty viewport
virtual void DrawScaledBitmap(int, int, const cBitmap &, double, double, bool AntiAlias=false)
virtual const cSize & MaxPixmapSize(void) const
virtual cPixmap * CreatePixmap(int, const cRect &, const cRect &DrawPort=cRect::Null)
cVector< cOglPixmap * > m_pOglPixmaps
array of pixmaps
cSize m_maxPixmapSize
maximum allowed size of a pixmap (depends on the maximum OpenGL texture size)
virtual void DestroyPixmap(cPixmap *)
virtual void Unbind(void)
cOglOutputFb(GLint width, GLint height)
virtual void SetClean(void)
virtual void DrawRectangle(const cRect &, tColor)
virtual void Pan(const cPoint &, const cRect &Source=cRect::Null)
virtual bool IsDirty(void)
virtual void DrawPixel(const cPoint &, tColor)
void DrawTextInternal(const cPoint &, const char *, tColor, tColor, const cFont *, int Width=0, int Height=0, int Alignment=taDefault, bool isGridText=false)
virtual void DrawImage(const cPoint &, const cImage &)
virtual ~cOglPixmap(void)
virtual void DrawSlope(const cRect &, tColor, int)
virtual void DrawText(const cPoint &, const char *, tColor, tColor, const cFont *, int Width=0, int Height=0, int Alignment=taDefault)
cOglFb * m_pFramebuffer
everything is drawn onto this framebuffer (one per pixmap)
std::shared_ptr< cOglThread > m_pOglThread
cOglFb * Framebuffer(void)
virtual void SetTile(bool)
virtual void SetDirty(bool dirty=true)
virtual void MarkViewPortDirty(const cRect &)
virtual void Scroll(const cPoint &, const cRect &Source=cRect::Null)
virtual void SetLayer(int)
virtual void DrawScaledImage(const cPoint &, int, double FactorX=1.0f, double FactorY=1.0f, bool AntiAlias=false)
virtual void Fill(tColor)
virtual void SetDrawPortPoint(const cPoint &, bool Dirty=true)
virtual void DrawBitmap(const cPoint &, const cBitmap &, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false)
bool m_dirty
true, if there was draw activity on the pixmap
virtual void Render(const cPixmap *, const cRect &, const cPoint &)
virtual void Copy(const cPixmap *, const cRect &, const cPoint &)
virtual void DrawEllipse(const cRect &, tColor, int Quadrants=0)
virtual void SetAlpha(int)
virtual void DrawScaledImage(const cPoint &, const cImage &, double FactorX=1.0f, double FactorY=1.0f, bool AntiAlias=false)
virtual void SetViewPort(const cRect &)
bool CheckCompileErrors(GLuint, bool program=false)
void SetMatrix4(const GLchar *, const glm::mat4 &)
void SetVector4f(const GLchar *, GLfloat, GLfloat, GLfloat, GLfloat)
void SetFloat(const GLchar *, GLfloat)
void SetInteger(const GLchar *, GLint)
void SetVector3f(const GLchar *, GLfloat, GLfloat, GLfloat)
bool Compile(const char *, const char *)
void SetVector2f(const GLchar *, GLfloat, GLfloat)
bool InitVertexBuffers(void)
void eglReleaseContext(void)
sOglImage m_imageCache[OGL_MAX_OSDIMAGES]
virtual ~cOglThread(void)
virtual void Action(void)
int StoreImage(const cImage &)
sOglImage * GetImageRef(int)
void DeleteVertexBuffers(void)
std::queue< cOglCmd * > m_commands
void eglAcquireContext(void)
void EnableBlending(void)
void SetShaderColor(GLint)
void SetShaderTexture(GLint)
void DisableBlending(void)
void SetVertexSubData(GLfloat *, int count=0)
void SetShaderProjectionMatrix(GLint, GLint)
void SetVertexData(GLfloat *, int count=0)
void DrawArrays(int count=0)
void ActivateShader(void)
void SetShaderAlpha(GLint)
void SetShaderBorderColor(GLint)
cVideoRender - Video render class
#define OGL_MAX_OSDIMAGES
const struct @0 FT_Errors[]
tKerning(FT_ULong prevSym, GLfloat kerning=0.0f)