summaryrefslogtreecommitdiff
path: root/src/yuv_draw.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-05-14 14:24:34 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-05-14 14:24:34 +0200
commit0ff825e0e6fe5fc7238e3964d24779a07cb53518 (patch)
tree7b47a9fe58a09e12ed99fdfacc84fff198ce5ce1 /src/yuv_draw.cc
parent29ae5ac36d4ffc520232ff393b2455130ec0227e (diff)
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.
Diffstat (limited to 'src/yuv_draw.cc')
-rw-r--r--src/yuv_draw.cc27
1 files changed, 10 insertions, 17 deletions
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 <string.h>
#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*/