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
@ -1287,10 +1287,10 @@ bool cOglCmdDrawImage::Execute(void) {
|
||||
pthread_mutex_unlock(&OSDMutex);
|
||||
#endif
|
||||
|
||||
GLfloat x1 = x; // left
|
||||
GLfloat y1 = y; // top
|
||||
GLfloat x2 = x + width; // right
|
||||
GLfloat y2 = y + height; // bottom
|
||||
GLfloat x1 = x; // left
|
||||
GLfloat y1 = y; // top
|
||||
GLfloat x2 = x + width * scaleX; // right
|
||||
GLfloat y2 = y + height * scaleY; // bottom
|
||||
|
||||
GLfloat quadVertices[] = {
|
||||
x1, y2, 0.0, 1.0, // left bottom
|
||||
@ -1324,19 +1324,21 @@ bool cOglCmdDrawImage::Execute(void) {
|
||||
}
|
||||
|
||||
//------------------ 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->x = x;
|
||||
this->y = y;
|
||||
this->scaleX = scaleX;
|
||||
this->scaleY = scaleY;
|
||||
}
|
||||
|
||||
bool cOglCmdDrawTexture::Execute(void) {
|
||||
if (imageRef->width <= 0 || imageRef->height <= 0)
|
||||
return false;
|
||||
GLfloat x1 = x; // top
|
||||
GLfloat y1 = y; // left
|
||||
GLfloat x2 = x + imageRef->width; // right
|
||||
GLfloat y2 = y + imageRef->height; // bottom
|
||||
GLfloat x1 = x; // top
|
||||
GLfloat y1 = y; // left
|
||||
GLfloat x2 = x + imageRef->width * scaleX; // right
|
||||
GLfloat y2 = y + imageRef->height * scaleY; // bottom
|
||||
|
||||
GLfloat quadVertices[] = {
|
||||
// Pos // TexCoords
|
||||
@ -1830,6 +1832,10 @@ void cOglPixmap::Fill(tColor Color) {
|
||||
}
|
||||
|
||||
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())
|
||||
return;
|
||||
tColor *argb = MALLOC(tColor, Image.Width() * Image.Height());
|
||||
@ -1838,19 +1844,25 @@ void cOglPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
|
||||
return;
|
||||
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();
|
||||
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) {
|
||||
DrawScaledImage(Point, ImageHandle);
|
||||
}
|
||||
|
||||
void cOglPixmap::DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias) {
|
||||
if (!oglThread->Active())
|
||||
return;
|
||||
|
||||
if (ImageHandle < 0 && 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
|
||||
@ -1858,8 +1870,6 @@ void cOglPixmap::DrawImage(const cPoint &Point, int ImageHandle) {
|
||||
DrawImage(Point, *cSoftOsdProvider::GetImageData(ImageHandle));
|
||||
}
|
||||
*/
|
||||
SetDirty();
|
||||
MarkDrawPortDirty(DrawPort());
|
||||
}
|
||||
|
||||
void cOglPixmap::DrawPixel(const cPoint &Point, tColor Color) {
|
||||
|
@ -403,9 +403,10 @@ class cOglCmdDrawTexture : public cOglCmd {
|
||||
private:
|
||||
sOglImage *imageRef;
|
||||
GLint x, y;
|
||||
GLfloat scaleX, scaleY;
|
||||
|
||||
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 const char *Description(void) { return "Draw Texture"; }
|
||||
virtual bool Execute(void);
|
||||
@ -501,6 +502,8 @@ class cOglPixmap : public cPixmap {
|
||||
virtual void Fill(tColor Color);
|
||||
virtual void DrawImage(const cPoint &Point, const cImage &Image);
|
||||
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 DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0,
|
||||
bool Overlay = false);
|
||||
|
@ -61,7 +61,7 @@ extern void ToggleLUT();
|
||||
/// vdr-plugin version number.
|
||||
/// Makefile extracts the version number for generating the file name
|
||||
/// for the distribution archive.
|
||||
static const char *const VERSION = "3.15"
|
||||
static const char *const VERSION = "3.16"
|
||||
#ifdef GIT_REV
|
||||
"-GIT" GIT_REV
|
||||
#endif
|
||||
@ -658,6 +658,20 @@ class cDummyPixmap : public cPixmap {
|
||||
(void)Point;
|
||||
(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) {
|
||||
(void)Point;
|
||||
(void)Color;
|
||||
|
Loading…
x
Reference in New Issue
Block a user