]> git.vomp.tv Git - vompclient.git/commitdiff
DrawStyle: Add consts, add white and transparent statics
authorChris Tallon <chris@vomp.tv>
Tue, 26 May 2020 14:36:28 +0000 (15:36 +0100)
committerChris Tallon <chris@vomp.tv>
Tue, 26 May 2020 14:36:28 +0000 (15:36 +0100)
21 files changed:
boxx.cc
boxx.h
colour.cc
colour.h
surface.cc
surface.h
surfacevector.cc
surfacevector.h
vcolourtuner.cc
vcolourtuner.h
vepg.cc
vradiorec.cc
vradiorec.h
vscreensaver.cc
vvideolivetv.cc
vvideomedia.cc
vvideomedia.h
vvideorec.cc
vvideorec.h
wjpegcomplex.cc
wjpegcomplex.h

diff --git a/boxx.cc b/boxx.cc
index 84e3860259bc76ec96e1e9efac9894ef696faa03..c4e5735c744dd8c7dc5f36c8dac2ebe39c482859 100644 (file)
--- a/boxx.cc
+++ b/boxx.cc
@@ -496,7 +496,7 @@ void Boxx::drawJpeg(const char* fileName, int x, int y, int *width, int *height)
   else if (surface) surface->drawJpeg(fileName, x, y, width, height);
 }
 
-void Boxx::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour)
+void Boxx::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour)
 {
   if (parent) parent->drawMonoBitmap(base, area.x +dx, area.y + dy, height, width, nextColour);
   else if (surface) surface->drawMonoBitmap(base, dx,dy, height, width, nextColour);
diff --git a/boxx.h b/boxx.h
index c29a9756faa7436d9e19b641ccf69c8bfd2937fe..54ba03e36a6bf6e485b373116dc7a33d5d8e9ada 100644 (file)
--- a/boxx.h
+++ b/boxx.h
@@ -113,7 +113,7 @@ class Boxx
     void drawJpeg(const char *fileName,int x, int y,int *width, int *height);
 
     void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c);
-    void drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour);
+    void drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour);
 
     /* This is for system which need a locking of the drawing surface to speed up drawing */
     void startFastDraw();
index 904097b5550f366db66786f138f018fafca7f6e4..cf75ca8b70b5f33a79919d0aeabade6fed1c2e14 100644 (file)
--- a/colour.cc
+++ b/colour.cc
@@ -20,6 +20,8 @@
 #include "colour.h"
 #include "defines.h"
 
+DrawStyle DrawStyle::TRANSPARENT(0, 0, 0, 0);
+DrawStyle DrawStyle::WHITE(255, 255, 255);
 DrawStyle DrawStyle::BLACK(0, 0, 0);
 DrawStyle DrawStyle::RED(255, 0, 0);
 DrawStyle DrawStyle::GREEN(0, 255, 0);
index f5d5e3698c8ac24e7cd83b0910ce22b67e5a1ca8..9122f1bafcfd195b42e9137490f601a337e38b8c 100644 (file)
--- a/colour.h
+++ b/colour.h
@@ -71,7 +71,8 @@ class DrawStyle: public Colour
     { red = Tred; green = Tgreen; blue = Tblue; alpha = 255 ; ft = Color; ct = Global;  }
 
     DrawStyle(int Tred, int Tgreen, int Tblue, int Talpha)
-    { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; ft = Color; ct = Global;}
+    { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; ft = Color; ct = Global; }
+
     DrawStyle(unsigned int color)
     {
       red = (color & 0x00ff0000) >> 16;
@@ -96,6 +97,7 @@ class DrawStyle: public Colour
       GradientLinear,
       GradientRadial,
     };
+
     enum CoordType
     {
       Global,
@@ -109,6 +111,8 @@ class DrawStyle: public Colour
     Colour grad_col[4];
     float grad_pos[3]; //Last position is alway 1.0 and first 0.0
 
+    static DrawStyle TRANSPARENT;
+    static DrawStyle WHITE;
     static DrawStyle BLACK;
     static DrawStyle RED;
     static DrawStyle GREEN;
index 5782327dbd689bb7c8b3b13a0deac3ecd13cb487..25fd516c235e60b10a763b436ae833d8ab508d18 100644 (file)
@@ -327,7 +327,7 @@ void Surface::drawTTChar(int ox, int oy, int x, int y, cTeletextChar c)
 }
 
 void Surface::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,
-                             unsigned int width, DrawStyle& nextColour)
+                             unsigned int width, const DrawStyle& nextColour)
 {
   startFastDraw();
   unsigned int x, y;
@@ -351,7 +351,7 @@ void Surface::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,
   endFastDraw();
 }
 
-void Surface::drawPoint(int x, int y, DrawStyle& c, bool fastdraw)
+void Surface::drawPoint(int x, int y, const DrawStyle& c, bool fastdraw)
 {
   drawPixel(x, y, c, fastdraw);
 }
index bf720f8e5b5e4259af5848dc9035fc67aaaa9df5..561c28ed187f00668a4afd8ba8b652bc90185682 100644 (file)
--- a/surface.h
+++ b/surface.h
@@ -86,8 +86,8 @@ class Surface
     virtual void drawHorzLine(int x1, int x2, int y, const DrawStyle& c) = 0;
     virtual void drawVertLine(int x, int y1, int y2, const DrawStyle& c) = 0;
     virtual void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region) = 0;
-    virtual void drawPoint(int x, int y, DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel
-    virtual void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, DrawStyle& nextColour);
+    virtual void drawPoint(int x, int y, const DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel
+    virtual void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour);
     virtual int updateToScreen(int sx, int sy, int w, int h, int dx, int dy) = 0;
     virtual void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b) = 0;
     virtual bool screenShot(const char* fileName) = 0;
@@ -111,7 +111,7 @@ class Surface
 #endif
 
     virtual void drawPixel(int x, int y, unsigned int c, bool fastdraw = false) = 0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation
-    virtual void drawPixel(int x, int y, Colour& c, bool fastdraw = false) = 0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation
+    virtual void drawPixel(int x, int y, const Colour& c, bool fastdraw = false) = 0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation
 
   private:
     void initpol_tables();
index fd18002f1c69fc77158d6e70bde637c47c2319d9..035cf7b7ed4fb9635764bb60e13e04d4ef46b516 100644 (file)
@@ -357,7 +357,7 @@ void SurfaceVector::drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegi
   command_mutex.unlock();
 }
 
-void SurfaceVector::drawPoint(int x, int y, DrawStyle& c, bool fastdraw)
+void SurfaceVector::drawPoint(int x, int y, const DrawStyle& c, bool fastdraw)
 {
   if (!fastdraw) command_mutex.lock();
 
@@ -366,7 +366,8 @@ void SurfaceVector::drawPoint(int x, int y, DrawStyle& c, bool fastdraw)
 
   if (!fastdraw)  command_mutex.unlock();
 }
-void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, DrawStyle& nextColour)
+
+void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour)
 {
   command_mutex.lock();
   ImageIndex image = osd->getMonoBitmapRef(base, width, height);
@@ -376,7 +377,6 @@ void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int hei
   command_mutex.unlock();
 }
 
-
 int SurfaceVector::removeCommands(float x, float y, float width, float height)
 {
   // we iterate through all old commands in order to remove commands hidden by this rectangle
index e523023c3d79ebca6c88f758cfbf7b85a5373a82..ce20315413d85b4c2def11f648a028892d78e030 100644 (file)
@@ -54,8 +54,8 @@ class SurfaceVector : public Surface
     void drawHorzLine(int x1, int x2, int y, const DrawStyle& c);
     void drawVertLine(int x, int y1, int y2, const DrawStyle& c);
     void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region);
-    void drawPoint(int x, int y, DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel
-    void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, DrawStyle& nextColour);
+    void drawPoint(int x, int y, const DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel
+    void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour);
     int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);
 
     /* This is for system which need a locking of the drawing surface to speed up drawing */
@@ -77,7 +77,7 @@ class SurfaceVector : public Surface
     OsdVector* osd;
 
     void drawPixel(int /* x */, int /* y */, unsigned int /* c */, bool /* fastdraw */) {}; // these are not supported!
-    void drawPixel(int /* x */, int /* y */, Colour& /* c */, bool /* fastdraw */) {};
+    void drawPixel(int /* x */, int /* y */, const Colour& /* c */, bool /* fastdraw */) {};
 };
 
 #endif
index b1fc472ff3d1463a8d459d4018abf0aff0f6106a..32507c938914b4077654d3c540cf1fa268e46348 100644 (file)
@@ -58,7 +58,7 @@ VColourTuner::~VColourTuner()
   Log::getInstance()->log("VColourTuner",Log::DEBUG,"deleted %p",this);
 }
 
-void VColourTuner::drawBox(int x, int y, int w, int h, DrawStyle &c) {
+void VColourTuner::drawBox(int x, int y, int w, int h, const DrawStyle& c) {
   for (int row=y;row<y+h;row++)
     for (int col=x;col<x+w;col++) {
       surface->drawPixel(col,row,c);
@@ -79,7 +79,7 @@ void VColourTuner::draw()
     int picx=picture.getX();
     DrawStyle bc=DrawStyle(140,140,140);
     fillColour(bc);
-    bc=DrawStyle(255,255,255);
+    bc=DrawStyle::WHITE;
     drawText(tr("Colour Tuning"), x+20, y+5, DrawStyle::LIGHTTEXT);
     drawBox(x, y+50, bw, bh, DrawStyle::RED);
     drawBox(x, y+130, bw, bh, DrawStyle::GREEN);
index c816cca4d26d8ae1a124f3a51b06d8420b702c1b..4a8c2612917fea89f68b292e435eb83c940e69e3 100644 (file)
@@ -47,7 +47,7 @@ class VColourTuner : public TBBoxx
     //amount in +/- %
     void updateFactor(int color, int amount);
     //draw a box with the picture drawing function
-    void drawBox(int x, int y, int w, int h, DrawStyle &c);
+    void drawBox(int x, int y, int w, int h, const DrawStyle& c);
     static int rfactor;
     static int bfactor;
     static int gfactor;
diff --git a/vepg.cc b/vepg.cc
index 091a0b78037da9d95ab3dfab9b8de40b27c334f2..8024fdbff59ad0696acbf24c2d91defa974b84c3 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -112,8 +112,7 @@ VEpg::VEpg(void* tparent, UINT tcurrentChannelIndex, ChannelList* tchanList)
   setPosition(0, 0);
 
   // beautify
-//  DrawStyle transparent = DrawStyle(0, 0, 0, 0);
-//  setBackgroundColour(transparent);
+//  setBackgroundColour(DrawStyle::TRANSPARENT);
 
 //  progTitle.setSurface(surface);
   progTitle.setPosition(0,0);
@@ -249,8 +248,7 @@ void VEpg::draw()
 {
 //  View::draw(); // draw pallet
   // beautify
-  DrawStyle transparent = DrawStyle(0, 0, 0, 0);
-  fillColour(transparent);
+  fillColour(DrawStyle::TRANSPARENT);
   
   
   // Moved all the dynamic data drawing to a seperate function
@@ -529,10 +527,8 @@ void VEpg::drawgrid() // redraws grid and select programme
     ltime = prevHour(&selTime);
     updateEventList();
   }
-  // draw time scale
-  DrawStyle white = DrawStyle(255, 255, 255, 255);
-  
 
+  // draw time scale
   t = ltime;
   struct tm tms;
   LOCALTIME_R(&t, &tms);
@@ -543,17 +539,17 @@ void VEpg::drawgrid() // redraws grid and select programme
   strftime(timeString, 19, "%H:%M", &tms);
   drawText(timeString, timex, timey, DrawStyle::LIGHTTEXT); // print left time
 
-  rectangle(155, timey + getFontHeight(), 2, 7, white);
+  rectangle(155, timey + getFontHeight(), 2, 7, DrawStyle::WHITE);
   t = t + 3600;
   LOCALTIME_R(&t, &tms);
   strftime(timeString, 19, "%H:%M", &tms);
   drawText(timeString, timex + 180, timey, DrawStyle::LIGHTTEXT); // print middle time
-  rectangle(335, timey + getFontHeight(), 2, 7, white);
+  rectangle(335, timey + getFontHeight(), 2, 7, DrawStyle::WHITE);
   t = t + 3600;
   LOCALTIME_R(&t, &tms);
   strftime(timeString, 19, "%H:%M", &tms);
   drawText(timeString, timex + 360, timey, DrawStyle::LIGHTTEXT); // print right time
-  rectangle(515, timey + getFontHeight(), 2, 7, white);
+  rectangle(515, timey + getFontHeight(), 2, 7, DrawStyle::WHITE);
   // pointer to selTime
   //rectangle(155 + (selTime - ltime) / 20, timey + getFontHeight(), 2, 7, DrawStyle(255, 50, 50, 255));
 
index df787f4c040cfdee192d02d82e83e6e87e3ac2b9..08656f627832f384aa65ce37258b0b6683f32426 100644 (file)
@@ -74,8 +74,7 @@ VRadioRec::VRadioRec(Recording* rec)
 
   setSize(video->getScreenWidth(), video->getScreenHeight());
   createBuffer();
-  transparent.set(0, 0, 0, 0);
-  setBackgroundColour(transparent);
+  setBackgroundColour(DrawStyle::TRANSPARENT);
   setPosition(0, 0);
 
   barRegion.x = 0;
@@ -113,7 +112,7 @@ VRadioRec::~VRadioRec()
 
 void VRadioRec::draw()
 {
-  fillColour(transparent);
+  fillColour(DrawStyle::TRANSPARENT);
 }
 
 void VRadioRec::go(bool resume)
@@ -521,7 +520,7 @@ void VRadioRec::removeBar()
   if (!barShowing) return;
   timers->cancelTimer(this, 2);
   barShowing = false;
-  rectangle(barRegion, transparent);
+  rectangle(barRegion, DrawStyle::TRANSPARENT);
   boxstack->update(this, &barRegion);
 }
 
index b333628694e7a88eca85546f21d1a358967f5310..278da9303a4a8caaff095c31f6bb1a2efedd33f6 100644 (file)
@@ -55,7 +55,6 @@ class VRadioRec : public Boxx, public TimerReceiver
     BoxStack* boxstack;
 
     DrawStyle barBlue;
-    DrawStyle transparent;
 
     bool playing;
     bool barShowing;
index 154a3680d842ff48952796381986501dce07d3e7..0d8f38340e46ff8d8dc55aeffd46e5c3c2343edc 100644 (file)
@@ -98,9 +98,6 @@ void VScreensaver::threadMethod()
   fx = x[0] = 50.0;
   fy = y[0] = 50.0;
 
-  DrawStyle &black=DrawStyle::BLACK;
-  DrawStyle &light=DrawStyle::SELECTHIGHLIGHT;
-
   while(1)
   {
     if (++head == h) head = 0;
@@ -109,7 +106,7 @@ void VScreensaver::threadMethod()
     if (tail == h) tail = 0;
 
     // Undraw oldest point
-    if (x[tail] != -1) surface->drawPoint(x[tail], y[tail], black);// was rgba
+    if (x[tail] != -1) surface->drawPoint(x[tail], y[tail], DrawStyle::BLACK);// was rgba
 
     dd = ((rand() / (double)RAND_MAX) * deviation) - halfdeviation;
     direction += dd;
@@ -128,7 +125,7 @@ void VScreensaver::threadMethod()
     x[head] = static_cast<int>(fx);
     y[head] = static_cast<int>(fy);
 
-    surface->drawPoint(x[head], y[head], light); // was rgba
+    surface->drawPoint(x[head], y[head], DrawStyle::SELECTHIGHLIGHT); // was rgba
 
     if (threadReqStop) return;
     MILLISLEEP(10);
index 27c7290442495b8a4175517a9b1c664ade909573..46c630597c0d24ea80314ec3c715118fb4b54d2f 100644 (file)
@@ -99,8 +99,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V
 
   setSize(video->getScreenWidth(), video->getScreenHeight());
   createBuffer();
-  DrawStyle transparent(0, 0, 0, 0);
-  setBackgroundColour(transparent);
+  setBackgroundColour(DrawStyle::TRANSPARENT);
 
   OsdVector* osdv = dynamic_cast<OsdVector*>(Osd::getInstance());
   if (osdv)
@@ -1352,7 +1351,7 @@ void VVideoLiveTV::drawOSDBitmap(UINT posX, UINT posY, const Bitmap& bm, const D
 
 void VVideoLiveTV::clearOSD()
 {
-  rectangle(area, DrawStyle(0,0,0,0));
+  rectangle(area, DrawStyle::TRANSPARENT);
   boxstack->update(this, &area);
 }
 
@@ -1367,6 +1366,6 @@ void VVideoLiveTV::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, c
   r.y = static_cast<UINT>(floor(scaley * static_cast<float>(r.y)));
   r.w = static_cast<UINT>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
   r.h = static_cast<UINT>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
-  rectangle(r, DrawStyle(0,0,0,0));
+  rectangle(r, DrawStyle::TRANSPARENT);
   boxstack->update(this, &r);
 }
index ca02084f9aed7c7eb4f3a8a32ca1597f50d909ca..ccf9d7a1fd92f9ad1ca043ab6d9274883b5c0846 100644 (file)
@@ -66,8 +66,7 @@ VVideoMedia::VVideoMedia(Media* media, VMediaList *p)
 
   setSize(video->getScreenWidth(), video->getScreenHeight());
   createBuffer();
-  transparent.set(0, 0, 0, 0);
-  setBackgroundColour(transparent);
+  setBackgroundColour(DrawStyle::TRANSPARENT);
 
   barRegion.x = 0;
   barRegion.y = video->getScreenHeight() - 58;   // FIXME, need to be - 1? and below?
@@ -671,7 +670,7 @@ void VVideoMedia::removeBar()
   barGenHold = false;
   barScanHold = false;
   barVasHold = false;
-  rectangle(barRegion, transparent);
+  rectangle(barRegion, DrawStyle::TRANSPARENT);
   BoxStack::getInstance()->update(this, &barRegion);
 }
 
index da513379c064328676a6c18b20ed179ed84c32d1..dbf7a53eceb0f4514778c0cc91647ac442a730d0 100644 (file)
@@ -62,7 +62,6 @@ class VVideoMedia : public Boxx, public TimerReceiver
 
     VAudioSelector* vas;
 
-    DrawStyle transparent;
     DrawStyle barBlue;
 
     UCHAR videoMode;
index e64c88e510cac2c69742c958ada1404e0b72bf71..efcc59973bbb4c954436c4a168a59075930926c2 100644 (file)
@@ -85,8 +85,7 @@ VVideoRec::VVideoRec(Recording* rec, bool ish264)
 
   setSize(video->getScreenWidth(), video->getScreenHeight());
   createBuffer();
-  transparent.set(0, 0, 0, 0);
-  setBackgroundColour(transparent);
+  setBackgroundColour(DrawStyle::TRANSPARENT);
 
   OsdVector* osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
   if (osdv)
@@ -1029,7 +1028,7 @@ void VVideoRec::removeBar()
   barGenHold = false;
   barScanHold = false;
   barVasHold = false;
-  rectangle(barRegion, transparent);
+  rectangle(barRegion, DrawStyle::TRANSPARENT);
   boxstack->update(this, &barRegion);
   player->tellSubtitlesOSDVisible(false);
 }
@@ -1082,7 +1081,7 @@ void VVideoRec::drawOSDBitmap(UINT posX, UINT posY, const Bitmap& bm, const Disp
 
 void VVideoRec::clearOSD()
 {
-  rectangle(area, transparent);
+  rectangle(area, DrawStyle::TRANSPARENT);
   boxstack->update(this, &area);
 }
 
@@ -1097,6 +1096,6 @@ void VVideoRec::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, cons
   r.w = static_cast<UINT>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
   r.h = static_cast<UINT>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
 
-  rectangle(r, transparent);
+  rectangle(r, DrawStyle::TRANSPARENT);
   boxstack->update(this, &r);
 }
index a5a65355b5789ed2f35c31c133d8f6be807eae05..b041e08d2254f8bf1ccdb822955ed5d6824ce4da 100644 (file)
@@ -70,7 +70,6 @@ class VVideoRec : public Boxx, public TimerReceiver, public OSDReceiver
 
     VAudioSelector* vas;
 
-    DrawStyle transparent;
     DrawStyle barBlue;
 
     int videoMode;
index e96ccf204f144b73ac9cc1db6342035604a01900..2965f4f69746017bf38abd9b73236f7a9be9f08d 100644 (file)
@@ -607,7 +607,7 @@ void WJpegComplex::draw()
 
 #ifndef __ANDROID__
 
-bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, DrawStyle & backgroundColour) {
+bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, const DrawStyle& backgroundColour) {
   Log* logger = Log::getInstance();
   if (! rdr || ! sfc) {
     logger->log("BJpeg", Log::ERR, "JPEG error rdr=NULL or sfc=NULL");
@@ -876,7 +876,7 @@ bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, Dra
 
 
 #else
-bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, DrawStyle & backgroundColour) {
+bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, const DrawStyle& backgroundColour) {
        return true;
 }
 #endif
index 64ad624f7fd9f90ddf1d3f39ac6445a6a4f7d77e..0228f98ea819fbc1e6e61c57cc1437624b417877 100644 (file)
@@ -143,7 +143,7 @@ class WJpegComplex : public WJpeg
     //the reader has to be initialized before
     //calling this function does not need a WJpeg being instantiated
     //it simply draws into the surface
-    bool static drawJpeg(JpegControl * control, Surface* sfc, JpegReader *rdr, DrawStyle & backgroundColour);
+    bool static drawJpeg(JpegControl * control, Surface* sfc, JpegReader *rdr, const DrawStyle& backgroundColour);
 
   private:
     //our drawPixel with considers rotation