22#ifndef __SOFTHDDEVICE_OPENGLOSD_H
23#define __SOFTHDDEVICE_OPENGLOSD_H
26#include <EGL/eglext.h>
27#include <EGL/eglplatform.h>
39#include <GLES2/gl2ext.h>
41#include <drm_fourcc.h>
44#include <glm/gtc/matrix_transform.hpp>
45#include <glm/gtc/type_ptr.hpp>
50#include FT_LCD_FILTER_H
54#define FT_ERRORDEF( e, v, s ) { e, s },
55#define FT_ERROR_START_LIST {
56#define FT_ERROR_END_LIST { 0, 0 } };
66#include <vdr/plugin.h>
68#include <vdr/thread.h>
73#include <libavcodec/avcodec.h>
110 bool Compile(
const char *vertexCode,
const char *fragmentCode);
117 void SetFloat (
const GLchar *name, GLfloat value);
118 void SetInteger (
const GLchar *name, GLint value);
119 void SetVector2f (
const GLchar *name, GLfloat x, GLfloat y);
120 void SetVector3f (
const GLchar *name, GLfloat x, GLfloat y, GLfloat z);
121 void SetVector4f (
const GLchar *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
122 void SetMatrix4 (
const GLchar *name,
const glm::mat4 &matrix);
205#define MIN_CHARCODE 32
206#define MAX_CHARCODE 255
238 cOglFont(
const char *fontName,
int charHeight);
239 static void Init(
void);
271 virtual bool Init(
void);
275 virtual void Unbind(
void);
277 void Blit(GLint destX1, GLint destY1, GLint destX2, GLint destY2);
296 virtual bool Init(
void);
298 virtual void Unbind(
void);
365 virtual const char*
Description(
void) {
return "InitOutputFramebuffer"; }
375 virtual const char*
Description(
void) {
return "InitFramebuffer"; }
383 virtual const char*
Description(
void) {
return "DeleteFramebuffer"; }
401 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);
403 virtual const char*
Description(
void) {
return "Render Framebuffer to Buffer"; }
418 virtual const char*
Description(
void) {
return "Copy buffer to OutputFramebuffer"; }
551#define OGL_MAX_OSDIMAGES 512
552#define OGL_CMDQUEUE_SIZE 200
576 virtual void Action(
void);
598 void DrawGridRect(
const cRect &Rect,
int offset,
int size, tColor clr, tColor bg,
const cFont *Font);
599 void DrawGridText(
const cPoint &Point,
const char *s, tColor ColorFg, tColor ColorBg,
const cFont *Font,
int Width = 0,
int Height = 0,
int Alignment = taDefault);
602 cOglPixmap(std::shared_ptr<cOglThread>
oglThread,
int Layer,
const cRect &ViewPort,
const cRect &DrawPort = cRect::Null);
605 int X(
void) {
return ViewPort().X(); };
606 int Y(
void) {
return ViewPort().Y(); };
611 virtual void SetTile(
bool Tile);
614 virtual void Clear(
void);
615 virtual void Fill(tColor Color);
616 virtual void DrawImage(
const cPoint &Point,
const cImage &Image);
617 virtual void DrawImage(
const cPoint &Point,
int ImageHandle);
618 virtual void DrawScaledImage(
const cPoint &Point,
const cImage &Image,
double FactorX = 1.0f,
double FactorY = 1.0f,
bool AntiAlias =
false);
619 virtual void DrawScaledImage(
const cPoint &Point,
int ImageHandle,
double FactorX = 1.0f,
double FactorY = 1.0f,
bool AntiAlias =
false);
620 virtual void DrawPixel(
const cPoint &Point, tColor Color);
621 virtual void DrawBitmap(
const cPoint &Point,
const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0,
bool Overlay =
false);
622 virtual void DrawText(
const cPoint &Point,
const char *s, tColor ColorFg, tColor ColorBg,
const cFont *Font,
int Width = 0,
int Height = 0,
int Alignment = taDefault);
624 virtual void DrawEllipse(
const cRect &Rect, tColor Color,
int Quadrants = 0);
625 virtual void DrawSlope(
const cRect &Rect, tColor Color,
int Type);
626 virtual void Render(
const cPixmap *Pixmap,
const cRect &Source,
const cPoint &Dest);
627 virtual void Copy(
const cPixmap *Pixmap,
const cRect &Source,
const cPoint &Dest);
628 virtual void Scroll(
const cPoint &Dest,
const cRect &Source = cRect::Null);
629 virtual void Pan(
const cPoint &Dest,
const cRect &Source = cRect::Null);
651 virtual eOsdError
SetAreas(
const tArea *Areas,
int NumAreas);
652 virtual cPixmap *
CreatePixmap(
int Layer,
const cRect &ViewPort,
const cRect &DrawPort = cRect::Null);
654 virtual void Flush(
void);
656 virtual void DrawScaledBitmap(
int x,
int y,
const cBitmap &Bitmap,
double FactorX,
double FactorY,
bool AntiAlias =
false);
Audio and alsa module header file.
int BearingTop(void) const
void SetKerningCache(FT_ULong prevSym, int kerning)
cVector< tKerning > kerningCache
int BearingLeft(void) const
int GetKerningCache(FT_ULong prevSym)
float YOffset(void) const
cOglAtlasGlyph(FT_ULong charCode, float advanceX, float advanceY, float width, float height, float bearingLeft, float bearingTop, float xoffset, float yoffset)
float XOffset(void) const
virtual ~cOglAtlasGlyph()
virtual ~cOglCmdBufferFill(void)
cOglCmdBufferFill(cOglFb *fb, GLint color)
virtual const char * Description(void)
virtual bool Execute(void)
virtual const char * Description(void)
cOglCmdCopyBufferToOutputFb(cOglFb *fb, cOglOutputFb *oFb, GLint x, GLint y, int active, cSoftHdDevice *device, cVideoRender *render)
virtual ~cOglCmdCopyBufferToOutputFb(void)
virtual bool Execute(void)
virtual ~cOglCmdDeleteFb(void)
virtual bool Execute(void)
virtual const char * Description(void)
cOglCmdDeleteFb(cOglFb *fb)
GLfloat * CreateVerticesFull(int &numVertices)
virtual ~cOglCmdDrawEllipse(void)
virtual const char * Description(void)
GLfloat * CreateVerticesQuadrant(int &numVertices)
virtual bool Execute(void)
GLfloat * CreateVerticesHalf(int &numVertices)
cOglCmdDrawEllipse(cOglFb *fb, GLint x, GLint y, GLint width, GLint height, GLint color, GLint quadrants)
quadrants: 0 draws the entire ellipse 1..4 draws only the first, second, third or fourth quadrant,...
virtual bool Execute(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 ~cOglCmdDrawImage(void)
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)
type: 0: horizontal, rising, lower 1: horizontal, rising, upper 2: horizontal, falling,...
cOglCmdDrawText(cOglFb *fb, GLint x, GLint y, unsigned int *symbols, GLint limitX, const char *name, int fontSize, tColor colorText, int length)
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)
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)
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)
virtual void BindWrite(void)
GLint ViewportWidth(void)
void Blit(GLint destX1, GLint destY1, GLint destX2, GLint destY2)
cOglFb(GLint width, GLint height, GLint viewPortWidth, GLint viewPortHeight)
cOglAtlasGlyph * GetGlyph(int sym) const
int FontHeight(void) const
virtual ~cOglFontAtlas(void)
cOglAtlasGlyph * Glyph[MAX_CHARCODE - MIN_CHARCODE+1]
cOglFontAtlas(FT_Face face, int height)
static cList< cOglFont > * fonts
static void Cleanup(void)
cOglFontAtlas * Atlas(void)
static cOglFont * Get(const char *name, int charHeight)
cList< cOglGlyph > glyphCache
int Kerning(cOglGlyph *glyph, FT_ULong prevSym) const
cOglFont(const char *fontName, int charHeight)
int AtlasKerning(cOglAtlasGlyph *glyph, FT_ULong prevSym) const
cOglGlyph * Glyph(FT_ULong charCode) const
void SetKerningCache(FT_ULong prevSym, int kerning)
int BearingTop(void) const
void LoadTexture(FT_BitmapGlyph ftGlyph)
int BearingLeft(void) const
cOglGlyph(FT_ULong charCode, FT_BitmapGlyph ftGlyph)
cVector< tKerning > kerningCache
int GetKerningCache(FT_ULong prevSym)
static cOglOutputFb * oFb
virtual cPixmap * CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null)
cOglOsd(int Left, int Top, uint Level, std::shared_ptr< cOglThread > oglThread, cSoftHdDevice *device)
std::shared_ptr< cOglThread > oglThread
virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias=false)
virtual const cSize & MaxPixmapSize(void) const
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
virtual void DestroyPixmap(cPixmap *Pixmap)
cVector< cOglPixmap * > oglPixmaps
virtual ~cOglOutputFb(void)
virtual void Unbind(void)
cOglOutputFb(GLint width, GLint height)
virtual void BindWrite(void)
virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX=1.0f, double FactorY=1.0f, bool AntiAlias=false)
virtual void DrawImage(const cPoint &Point, const cImage &Image)
virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX=1.0f, double FactorY=1.0f, bool AntiAlias=false)
virtual void SetClean(void)
virtual void Fill(tColor Color)
virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest)
virtual void SetAlpha(int Alpha)
virtual void MarkViewPortDirty(const cRect &Rect)
virtual bool IsDirty(void)
virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest)
virtual ~cOglPixmap(void)
virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty=true)
virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants=0)
virtual void SetViewPort(const cRect &Rect)
virtual void Scroll(const cPoint &Dest, const cRect &Source=cRect::Null)
virtual void SetDirty(bool dirty=true)
cOglPixmap(std::shared_ptr< cOglThread > oglThread, int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null)
virtual void Pan(const cPoint &Dest, const cRect &Source=cRect::Null)
virtual void DrawRectangle(const cRect &Rect, tColor Color)
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)
virtual void DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault)
virtual void DrawPixel(const cPoint &Point, tColor Color)
std::shared_ptr< cOglThread > oglThread
virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false)
virtual void SetLayer(int Layer)
virtual void SetTile(bool Tile)
std::queue< cOglCmd * > commands
int StoreImage(const cImage &image)
sOglImage * GetImageRef(int slot)
bool InitVertexBuffers(void)
void eglReleaseContext(void)
sOglImage imageCache[OGL_MAX_OSDIMAGES]
cOglThread(cCondWait *startWait, int maxCacheSize, cSoftHdDevice *device)
virtual void Action(void)
void DropImageData(int imageHandle)
void DeleteVertexBuffers(void)
void eglAcquireContext(void)
void EnableBlending(void)
void SetVertexSubData(GLfloat *vertices, int count=0)
void SetShaderProjectionMatrix(GLint width, GLint height)
void SetShaderTexture(GLint value)
void SetShaderColor(GLint color)
void DisableBlending(void)
void SetShaderBorderColor(GLint bcolor)
void DrawArrays(int count=0)
void SetShaderAlpha(GLint alpha)
void ActivateShader(void)
void SetVertexData(GLfloat *vertices, int count=0)
void SetMatrix4(const GLchar *name, const glm::mat4 &matrix)
void SetInteger(const GLchar *name, GLint value)
void SetVector2f(const GLchar *name, GLfloat x, GLfloat y)
void SetFloat(const GLchar *name, GLfloat value)
bool Compile(const char *vertexCode, const char *fragmentCode)
void SetVector3f(const GLchar *name, GLfloat x, GLfloat y, GLfloat z)
bool CheckCompileErrors(GLuint object, bool program=false)
void SetVector4f(const GLchar *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
bool Load(eShaderType type)
cVideoRender - Video render class
#define OGL_MAX_OSDIMAGES
const struct @0 FT_Errors[]
void ConvertColor(const GLint &colARGB, glm::vec4 &col)
Device class header file.
tKerning(FT_ULong prevSym, GLfloat kerning=0.0f)
tKerning(FT_ULong prevSym, GLfloat kerning=0.0f)
Rendering class header file.
Videostream class header file.