From 0ff825e0e6fe5fc7238e3964d24779a07cb53518 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 14 May 2014 14:24:34 +0200 Subject: Split miav server and client apart. Port client to Qt4. Replace libraw1994 with libiec61883. Add unit tests for multiplexer and fix some bugs in it. --- src/yuv_draw.cc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src/yuv_draw.cc') diff --git a/src/yuv_draw.cc b/src/yuv_draw.cc index 06aff5c..9d10867 100644 --- a/src/yuv_draw.cc +++ b/src/yuv_draw.cc @@ -24,20 +24,15 @@ * along with MIaV; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include "config.h" -#ifdef USE_GUI #include "yuv_draw.h" -// for miav_app -#include "miav.h" - //#include "font.h" #include #define TEXT_MARGIN 10 #include "mainwindow.h" -static QImage *loadIcon( char *name, int height ) +static QImage *loadIcon(const char *name, int height ) { QImage scaled; QImage *img; @@ -48,7 +43,7 @@ static QImage *loadIcon( char *name, int height ) int h = height; int w = (int)((float)img->width() / (float)(img->height() / (float)h)); - scaled = img->smoothScale(w, h); + scaled = img->scaled(w, h, Qt::KeepAspectRatio, Qt::SmoothTransformation); delete img; img = new QImage(scaled); @@ -106,9 +101,9 @@ void YUVDraw::addPixel(int x, int y, int val) } -void YUVDraw::setTopText(char* text) +void YUVDraw::setTopText(const char* text) { - miav_app->lock(); + // miav_app->lock(); // TODO top_pixmap->fill(); QPainter painter; @@ -118,19 +113,19 @@ void YUVDraw::setTopText(char* text) painter.drawText(64, 15, text); painter.end(); - QImage image = top_pixmap->convertToImage(); + QImage image = top_pixmap->toImage(); for(int x = 64; x < 720 - TEXT_MARGIN; x++) { for(int y = 0; y < 20; y++) { top_grey[x][y] = qGray(image.pixel(x, y)); } } - miav_app->unlock(); + // miav_app->unlock();// TODO } -void YUVDraw::setBottomText(char* text) +void YUVDraw::setBottomText(const char* text) { - miav_app->lock(); + //miav_app->lock(); // TODO bottom_pixmap->fill(); QPainter painter; @@ -140,14 +135,14 @@ void YUVDraw::setBottomText(char* text) painter.drawText(0, 15, text); painter.end(); - QImage image = bottom_pixmap->convertToImage(); + QImage image = bottom_pixmap->toImage(); for(int x = 0; x < 720 - TEXT_MARGIN; x++) { for(int y = 0; y < 20; y++) { bottom_grey[x][y] = qGray(image.pixel(x, y)); } } - miav_app->unlock(); + // miav_app->unlock(); // TODO } void YUVDraw::draw() @@ -238,5 +233,3 @@ typedef struct{ Uint32 hw_overlay:1; } SDL_Overlay; */ - -#endif/*USE_GUI*/ -- cgit v1.2.3