mirror of
https://github.com/jojo61/vdr-plugin-softhdcuvid.git
synced 2025-03-01 10:39:28 +00:00
Enable Fastscale for vdr 2.6.6
This commit is contained in:
parent
f3e5a14fdf
commit
7e387fa3f1
@ -1289,8 +1289,8 @@ bool cOglCmdDrawImage::Execute(void) {
|
|||||||
|
|
||||||
GLfloat x1 = x; // left
|
GLfloat x1 = x; // left
|
||||||
GLfloat y1 = y; // top
|
GLfloat y1 = y; // top
|
||||||
GLfloat x2 = x + width; // right
|
GLfloat x2 = x + width * scaleX; // right
|
||||||
GLfloat y2 = y + height; // bottom
|
GLfloat y2 = y + height * scaleY; // bottom
|
||||||
|
|
||||||
GLfloat quadVertices[] = {
|
GLfloat quadVertices[] = {
|
||||||
x1, y2, 0.0, 1.0, // left bottom
|
x1, y2, 0.0, 1.0, // left bottom
|
||||||
@ -1324,10 +1324,12 @@ bool cOglCmdDrawImage::Execute(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------ cOglCmdDrawTexture --------------------
|
//------------------ cOglCmdDrawTexture --------------------
|
||||||
cOglCmdDrawTexture::cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y) : cOglCmd(fb) {
|
cOglCmdDrawTexture::cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX, double scaleY) : cOglCmd(fb) {
|
||||||
this->imageRef = imageRef;
|
this->imageRef = imageRef;
|
||||||
this->x = x;
|
this->x = x;
|
||||||
this->y = y;
|
this->y = y;
|
||||||
|
this->scaleX = scaleX;
|
||||||
|
this->scaleY = scaleY;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cOglCmdDrawTexture::Execute(void) {
|
bool cOglCmdDrawTexture::Execute(void) {
|
||||||
@ -1335,8 +1337,8 @@ bool cOglCmdDrawTexture::Execute(void) {
|
|||||||
return false;
|
return false;
|
||||||
GLfloat x1 = x; // top
|
GLfloat x1 = x; // top
|
||||||
GLfloat y1 = y; // left
|
GLfloat y1 = y; // left
|
||||||
GLfloat x2 = x + imageRef->width; // right
|
GLfloat x2 = x + imageRef->width * scaleX; // right
|
||||||
GLfloat y2 = y + imageRef->height; // bottom
|
GLfloat y2 = y + imageRef->height * scaleY; // bottom
|
||||||
|
|
||||||
GLfloat quadVertices[] = {
|
GLfloat quadVertices[] = {
|
||||||
// Pos // TexCoords
|
// Pos // TexCoords
|
||||||
@ -1830,6 +1832,10 @@ void cOglPixmap::Fill(tColor Color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
|
void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
|
||||||
|
DrawScaledImage(Point, Image);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cOglPixmap::DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias) {
|
||||||
if (!oglThread->Active())
|
if (!oglThread->Active())
|
||||||
return;
|
return;
|
||||||
tColor *argb = MALLOC(tColor, Image.Width() * Image.Height());
|
tColor *argb = MALLOC(tColor, Image.Width() * Image.Height());
|
||||||
@ -1838,19 +1844,25 @@ void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
|
|||||||
return;
|
return;
|
||||||
memcpy(argb, Image.Data(), sizeof(tColor) * Image.Width() * Image.Height());
|
memcpy(argb, Image.Data(), sizeof(tColor) * Image.Width() * Image.Height());
|
||||||
|
|
||||||
oglThread->DoCmd(new cOglCmdDrawImage(fb, argb, Image.Width(), Image.Height(), Point.X(), Point.Y()));
|
oglThread->DoCmd(new cOglCmdDrawImage(fb, argb, Image.Width(), Image.Height(), Point.X(), Point.Y(), true, FactorX, FactorY));
|
||||||
SetDirty();
|
SetDirty();
|
||||||
MarkDrawPortDirty(cRect(Point, cSize(Image.Width(), Image.Height())).Intersected(DrawPort().Size()));
|
MarkDrawPortDirty(cRect(Point, cSize(Image.Width() * FactorX, Image.Height() * FactorY)).Intersected(DrawPort().Size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) {
|
void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) {
|
||||||
|
DrawScaledImage(Point, ImageHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cOglPixmap::DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias) {
|
||||||
if (!oglThread->Active())
|
if (!oglThread->Active())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ImageHandle < 0 && oglThread->GetImageRef(ImageHandle)) {
|
if (ImageHandle < 0 && oglThread->GetImageRef(ImageHandle)) {
|
||||||
sOglImage *img = oglThread->GetImageRef(ImageHandle);
|
sOglImage *img = oglThread->GetImageRef(ImageHandle);
|
||||||
|
|
||||||
oglThread->DoCmd(new cOglCmdDrawTexture(fb, img, Point.X(), Point.Y()));
|
oglThread->DoCmd(new cOglCmdDrawTexture(fb, img, Point.X(), Point.Y(), FactorX, FactorY));
|
||||||
|
SetDirty();
|
||||||
|
MarkDrawPortDirty(cRect(Point, cSize(img->width * FactorX, img->height * FactorY)).Intersected(DrawPort().Size()));
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Fallback to VDR implementation, needs to separate cSoftOsdProvider from
|
Fallback to VDR implementation, needs to separate cSoftOsdProvider from
|
||||||
@ -1858,8 +1870,6 @@ void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) {
|
|||||||
DrawImage(Point, *cSoftOsdProvider::GetImageData(ImageHandle));
|
DrawImage(Point, *cSoftOsdProvider::GetImageData(ImageHandle));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
SetDirty();
|
|
||||||
MarkDrawPortDirty(DrawPort());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cOglPixmap::DrawPixel(const cPoint &Point, tColor Color) {
|
void cOglPixmap::DrawPixel(const cPoint &Point, tColor Color) {
|
||||||
|
@ -403,9 +403,10 @@ class cOglCmdDrawTexture : public cOglCmd {
|
|||||||
private:
|
private:
|
||||||
sOglImage *imageRef;
|
sOglImage *imageRef;
|
||||||
GLint x, y;
|
GLint x, y;
|
||||||
|
GLfloat scaleX, scaleY;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y);
|
cOglCmdDrawTexture(cOglFb *fb, sOglImage *imageRef, GLint x, GLint y, double scaleX = 1.0f, double scaleY = 1.0f);
|
||||||
virtual ~cOglCmdDrawTexture(void){};
|
virtual ~cOglCmdDrawTexture(void){};
|
||||||
virtual const char *Description(void) { return "Draw Texture"; }
|
virtual const char *Description(void) { return "Draw Texture"; }
|
||||||
virtual bool Execute(void);
|
virtual bool Execute(void);
|
||||||
@ -501,6 +502,8 @@ class cOglPixmap : public cPixmap {
|
|||||||
virtual void Fill(tColor Color);
|
virtual void Fill(tColor Color);
|
||||||
virtual void DrawImage(const cPoint &Point, const cImage &Image);
|
virtual void DrawImage(const cPoint &Point, const cImage &Image);
|
||||||
virtual void DrawImage(const cPoint &Point, int ImageHandle);
|
virtual void DrawImage(const cPoint &Point, int ImageHandle);
|
||||||
|
virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX = 1.0f, double FactorY = 1.0f, bool AntiAlias = false);
|
||||||
|
virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX = 1.0f, double FactorY = 1.0f, bool AntiAlias = false);
|
||||||
virtual void DrawPixel(const cPoint &Point, tColor Color);
|
virtual void DrawPixel(const cPoint &Point, tColor Color);
|
||||||
virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0,
|
virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0,
|
||||||
bool Overlay = false);
|
bool Overlay = false);
|
||||||
|
@ -61,7 +61,7 @@ extern void ToggleLUT();
|
|||||||
/// vdr-plugin version number.
|
/// vdr-plugin version number.
|
||||||
/// Makefile extracts the version number for generating the file name
|
/// Makefile extracts the version number for generating the file name
|
||||||
/// for the distribution archive.
|
/// for the distribution archive.
|
||||||
static const char *const VERSION = "3.15"
|
static const char *const VERSION = "3.16"
|
||||||
#ifdef GIT_REV
|
#ifdef GIT_REV
|
||||||
"-GIT" GIT_REV
|
"-GIT" GIT_REV
|
||||||
#endif
|
#endif
|
||||||
@ -658,6 +658,20 @@ class cDummyPixmap : public cPixmap {
|
|||||||
(void)Point;
|
(void)Point;
|
||||||
(void)ImageHandle;
|
(void)ImageHandle;
|
||||||
}
|
}
|
||||||
|
virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias) {
|
||||||
|
(void)Point;
|
||||||
|
(void)Image;
|
||||||
|
(void)FactorX;
|
||||||
|
(void)FactorY;
|
||||||
|
(void)AntiAlias;
|
||||||
|
}
|
||||||
|
virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias) {
|
||||||
|
(void)Point;
|
||||||
|
(void)ImageHandle;
|
||||||
|
(void)FactorX;
|
||||||
|
(void)FactorY;
|
||||||
|
(void)AntiAlias;
|
||||||
|
}
|
||||||
virtual void DrawPixel(const cPoint &Point, tColor Color) {
|
virtual void DrawPixel(const cPoint &Point, tColor Color) {
|
||||||
(void)Point;
|
(void)Point;
|
||||||
(void)Color;
|
(void)Color;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user