]> git.vomp.tv Git - vompclient.git/commitdiff
Rename ImageIndex to VectorHandleImage, rename some variables
authorChris Tallon <chris@vomp.tv>
Sun, 3 Oct 2021 16:47:26 +0000 (17:47 +0100)
committerChris Tallon <chris@vomp.tv>
Sun, 3 Oct 2021 16:47:26 +0000 (17:47 +0100)
osdopenvg.cc
osdopenvg.h
osdvector.cc
osdvector.h
osdwinvector.cc
osdwinvector.h
surfacevector.cc

index 795988d946583441f90b40aff515a917c191116a..7f2e4915fc4d89e80d901b21c831ae9dcc9f7d9e 100644 (file)
@@ -615,21 +615,21 @@ void OsdOpenVG::purgeAllReferences()
        drawstyleHandlesRefCounts.clear(); // remove all references
 
 
-       map<void *,ImageIndex>::iterator mitty=monobitmaps.begin();
+       map<void *,VectorHandleImage>::iterator mitty=monobitmaps.begin();
        while (mitty!=monobitmaps.end()) {
                vgDestroyImage((VGImage)(*mitty).second);
                mitty++;
        }
        monobitmaps.clear();
 
-       / *map<string,ImageIndex>::iterator jitty=jpegs.begin();
+       / *map<string,VectorHandleImage>::iterator jitty=jpegs.begin();
        while (jitty!=jpegs.end()) {
                vgDestroyImage((VGImage)(*jitty).second);
                jitty++;
        }
        jpegs.clear();* /
 
-       map<TVMediaInfo,ImageIndex>::iterator titty=tvmedias.begin();
+       map<TVMediaInfo,VectorHandleImage>::iterator titty=tvmedias.begin();
        while (titty!=tvmedias.end()) {
                vgDestroyImage((VGImage)(*titty).second);
                titty++;
@@ -1583,11 +1583,11 @@ unsigned int OsdOpenVG::handleOpenVGCommand(OpenVGCommand& command)
   return 0;
 }
 
-void OsdOpenVG::destroyImageRef(ImageIndex index)
+void OsdOpenVG::destroyImageRef(VectorHandleImage handle)
 {
   struct OpenVGCommand comm;
   comm.task = OVGdestroyImageRef;
-  comm.param1 = index;
+  comm.param1 = handle;
   putOpenVGCommand(comm, false);
 }
 
@@ -1639,7 +1639,7 @@ bool OsdOpenVG::getEGLPicture(struct OsdVector::PictureInfo& info, EGLDisplay* d
   return  putOpenVGCommand(comm, true);
 }
 
-ImageIndex OsdOpenVG::createMonoBitmap(void* base, int width, int height)
+VectorHandleImage OsdOpenVG::createMonoBitmap(void* base, int width, int height)
 {
   struct OpenVGCommand comm;
   comm.task = OVGcreateMonoBitmap;
@@ -1649,7 +1649,7 @@ ImageIndex OsdOpenVG::createMonoBitmap(void* base, int width, int height)
   return putOpenVGCommand(comm, true);
 }
 
-ImageIndex OsdOpenVG::createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data)
+VectorHandleImage OsdOpenVG::createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data)
 {
   struct OpenVGCommand comm;
   comm.task = OVGcreateImagePalette;
index 00d1ecf794eef48c1b4c885cce6e917a5dac3629..da9acb28c710f62b5717dc5df71dff47f7826f6b 100644 (file)
@@ -108,10 +108,10 @@ class OsdOpenVG : public OsdVector
     void doRender();
 
     /*osd vector implementation*/
-    void destroyImageRef(ImageIndex index);
-    // ImageIndex createJpeg(const char* fileName, int *width,int *height);
-    ImageIndex createMonoBitmap(void* base, int width, int height);
-    ImageIndex createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data);
+    void destroyImageRef(VectorHandleImage handle);
+    // VectorHandleImage createJpeg(const char* fileName, int *width,int *height);
+    VectorHandleImage createMonoBitmap(void* base, int width, int height);
+    VectorHandleImage createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data);
     void createPicture(struct PictureInfo& pict_inf);
     void destroyDrawStyleHandle(VectorHandle index);
     VectorHandle createDrawStyleHandle(const DrawStyle& c);
index 26072c20d3ba85d2422b69ad7c2c077575dd628a..90d918469c2e095706f53888c562adbcc277508d 100644 (file)
@@ -376,8 +376,8 @@ void OsdVector::decrementAllRefCounts(std::vector<SVGCommand>& commands)
     if (handle != 0) // command might not have a handle
       decrementDrawStyleHandleRefCount(handle);
 
-    ImageIndex ii = command.getImageIndex();
-    if (ii) removeImageRef(ii);
+    VectorHandleImage imageHandle = command.getImageHandle();
+    if (imageHandle) removeImageRef(imageHandle);
 
     LoadIndex li = command.getLoadIndex();
     if (li) removeLoadIndexRef(li);
@@ -392,29 +392,29 @@ void OsdVector::incrementAllRefCounts(std::vector<SVGCommand>& commands)
     if (handle != 0) // command might not have a handle
       incrementDrawStyleHandleRefCount(handle);
 
-    ImageIndex ii = command.getImageIndex();
-    if (ii) incImageRef(ii);
+    VectorHandleImage imageHandle = command.getImageHandle();
+    if (imageHandle) incImageRef(imageHandle);
 
     LoadIndex li = command.getLoadIndex();
     if (li) incLoadIndexRef(li);
   }
 }
 
-void OsdVector::incImageRef(ImageIndex index)
+void OsdVector::incImageRef(VectorHandleImage handle)
 {
-  if (images_ref.find(index) == images_ref.end())
+  if (images_ref.find(handle) == images_ref.end())
   {
-    images_ref[index] = 1;
+    images_ref[handle] = 1;
   }
   else
   {
-    images_ref[index]++;
+    images_ref[handle]++;
   }
 }
 
-void OsdVector::removeImageRef(const ImageIndex ref)
+void OsdVector::removeImageRef(const VectorHandleImage handle)
 {
-  images_ref[ref]--;
+  images_ref[handle]--;
 }
 
 int OsdVector::getLoadIndexRef(LoadIndex index)
@@ -452,7 +452,7 @@ void OsdVector::removeLoadIndexRef(const LoadIndex ref)
   if (loadindex_ref[ref] == 0)
   {
     //now check, if it is already loaded
-    std::map<LoadIndex, ImageIndex>::iterator itty = tvmedias_loaded.find(ref);
+    std::map<LoadIndex, VectorHandleImage>::iterator itty = tvmedias_loaded.find(ref);
 
     if ( itty != tvmedias_loaded.end())
     {
@@ -472,48 +472,48 @@ void OsdVector::cleanupOrphanedRefs()
 {
   // Do some garbage collection
 
-  std::map<void*, ImageIndex>::iterator mitty = monobitmaps.begin();
+  std::map<void*, VectorHandleImage>::iterator mitty = monobitmaps.begin();
 
   while (mitty != monobitmaps.end())
   {
-    std::map<ImageIndex, int>::iterator curitty = images_ref.find((*mitty).second);
+    std::map<VectorHandleImage, int>::iterator curitty = images_ref.find((*mitty).second);
     int count = (*curitty).second;
 
     if (count == 0)
     {
-      ImageIndex ref = (*curitty).first;
+      VectorHandleImage handle = (*curitty).first;
       monobitmaps.erase(mitty++);
       images_ref.erase(curitty++);
-      destroyImageRef(ref);
+      destroyImageRef(handle);
     }
     else ++mitty;
   }
 
-  /*map<string,ImageIndex>::iterator jitty=jpegs.begin();
+  /*map<string,VectorHandleImage>::iterator jitty=jpegs.begin();
   while (jitty!=jpegs.end()) {
-       map<ImageIndex,int>::iterator curitty=images_ref.find((*jitty).second);
+       map<VectorHandleImage,int>::iterator curitty=images_ref.find((*jitty).second);
        int count=(*curitty).second;
        if (count==0) {
-               ImageIndex ref=(*curitty).first;
+               VectorHandleImage handle=(*curitty).first;
                jpegs.erase(jitty++);
                images_ref.erase(curitty++);
-               destroyImageRef(ref);
+               destroyImageRef(handle);
        } else ++jitty;
   }*/
 
-  std::map<TVMediaInfo, ImageIndex>::iterator titty = tvmedias.begin();
+  std::map<TVMediaInfo, VectorHandleImage>::iterator titty = tvmedias.begin();
 
   while (titty != tvmedias.end())
   {
-    std::map<ImageIndex, int>::iterator curitty = images_ref.find((*titty).second);
+    std::map<VectorHandleImage, int>::iterator curitty = images_ref.find((*titty).second);
     int count = (*curitty).second;
 
     if (count == 0)
     {
-      ImageIndex ref = (*curitty).first;
+      VectorHandleImage handle = (*curitty).first;
       tvmedias.erase(titty++);
       images_ref.erase(curitty);
-      destroyImageRef(ref);
+      destroyImageRef(handle);
     }
     else ++titty;
   }
@@ -535,24 +535,24 @@ void OsdVector::cleanupOrphanedRefs()
     else ++litty;
   }
 
-  std::list<ImageIndex>::iterator pitty = palettepics.begin();
+  std::list<VectorHandleImage>::iterator pitty = palettepics.begin();
 
   while (pitty != palettepics.end())
   {
-    std::map<ImageIndex, int>::iterator curitty = images_ref.find((*pitty));
+    std::map<VectorHandleImage, int>::iterator curitty = images_ref.find((*pitty));
     int count = (*curitty).second;
 
     if (count == 0)
     {
-      ImageIndex ref = (*curitty).first;
+      VectorHandleImage handle = (*curitty).first;
       palettepics.erase(pitty++);
       images_ref.erase(curitty++);
-      destroyImageRef(ref);
+      destroyImageRef(handle);
     }
     else ++pitty;
   }
 
-  std::map<ImageIndex, int>::iterator citty = images_ref.begin();
+  std::map<VectorHandleImage, int>::iterator citty = images_ref.begin();
 
   while (citty != images_ref.end())
   {
@@ -560,9 +560,9 @@ void OsdVector::cleanupOrphanedRefs()
 
     if (count == 0)
     {
-      ImageIndex ref = (*citty).first;
+      VectorHandleImage handle = (*citty).first;
       images_ref.erase(citty++);
-      destroyImageRef(ref);
+      destroyImageRef(handle);
     }
     else ++citty;
   }
@@ -589,17 +589,17 @@ void OsdVector::cleanupOrphanedRefs()
   }
 }
 
-int OsdVector::getImageRef(ImageIndex index)
+int OsdVector::getImageRef(VectorHandleImage handle)
 {
   surfaces_mutex.lock();
 
-  if (images_ref.find(index) == images_ref.end())
+  if (images_ref.find(handle) == images_ref.end())
   {
     return -1;
   }
   else
   {
-    return images_ref[index];
+    return images_ref[handle];
   }
 
   surfaces_mutex.unlock();
@@ -705,9 +705,9 @@ void OsdVector::dumpStyles()
 }
 #endif
 
-LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
+LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, VectorHandleImage& handle)
 {
-  ImageIndex image_handle = 0;
+  VectorHandleImage localHandle = 0;
   LoadIndex loadindex = 0;
   surfaces_mutex.lock();
 
@@ -715,25 +715,25 @@ LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
   {
     loadindex = loadTVMedia(tvmedia);
   }
-  else   // if found, return a real imageIndex. incImageRef(image_handle). EXCEPT: If it's not found in images_ref (???) in which case do same as above.
+  else   // if found, return a real imageIndex. incImageRef(localHandle). EXCEPT: If it's not found in images_ref (???) in which case do same as above.
   {
-    image_handle = tvmedias[tvmedia];
+    localHandle = tvmedias[tvmedia];
 
-    if (images_ref.find(image_handle) == images_ref.end())
+    if (images_ref.find(localHandle) == images_ref.end())
     {
       //invalid handle recreate
       loadindex = loadTVMedia(tvmedia);
-      image_handle = 0;
+      localHandle = 0;
     }
     else
     {
-      incImageRef(image_handle);
+      incImageRef(localHandle);
     }
   }
 
   /*tvmedias[tvmedia]=createTVMedia(tvmedia,width,height);
-  incImageRef(image_handle);*/
-  image = image_handle;
+  incImageRef(localHandle);*/
+  handle = localHandle;
   surfaces_mutex.unlock();
   return loadindex;
 }
@@ -787,33 +787,33 @@ LoadIndex OsdVector::loadTVMedia(TVMediaInfo& tvmedia)          // insert a tvme
   return index;
 }
 
-void OsdVector::informPicture(LoadIndex index, ImageIndex imageIndex)
+void OsdVector::informPicture(LoadIndex index, VectorHandleImage handle)
 {
   //Beware for thread safety
-  ImageIndex image_index = 0;
+  VectorHandleImage localHandle = 0;
 
-  logger->debug(TAG, "TVMedia Picture for load-id {:#x} arrived index {:#x}", index, imageIndex);
+  logger->debug(TAG, "TVMedia Picture for load-id {:#x} arrived index {:#x}", index, handle);
   surfaces_mutex.lock();
   TVMediaInfo tvmedia = tvmedias_load_inv[index];
 
-  if (imageIndex)
+  if (handle)
   {
     std::map<LoadIndex, int>::iterator itty = loadindex_ref.find(index);
-    image_index = tvmedias[tvmedia] = imageIndex;
-    tvmedias_loaded[index] = image_index;
+    localHandle = tvmedias[tvmedia] = handle;
+    tvmedias_loaded[index] = localHandle;
 
     if (itty == loadindex_ref.end() || (*itty).second == 0)
     {
       // we do not want the picture anymore . Really...
       // fill images_ref in to not irritate the garbage collector
-      if (images_ref.find(image_index) == images_ref.end())
+      if (images_ref.find(localHandle) == images_ref.end())
       {
-        images_ref[image_index] = 0;
+        images_ref[localHandle] = 0;
       }
     }
     else
     {
-      incImageRef(image_index); // hold one index until all loadings refs are gone;
+      incImageRef(localHandle); // hold one index until all loadings refs are gone;
     }
   }
 
@@ -827,22 +827,22 @@ void OsdVector::processMessage(Message* m)
     case Message::NEW_PICTURE:
     {
       //logger->debug(TAG, "TVMedia NEW_PICTURE");
-      informPicture(m->tag, reinterpret_cast<ImageIndex>(m->data));
+      informPicture(m->tag, reinterpret_cast<VectorHandleImage>(m->data));
       break;
     }
     case Message::NEW_PICTURE_STATIC:
     {
       //logger->debug(TAG, "TVMedia NEW_PICTURE {:#x} {:#x}", m->tag, m->parameter);
-      informPicture(static_cast<unsigned long long>(m->tag) << 32LL, reinterpret_cast<ImageIndex>(m->data));
+      informPicture(static_cast<unsigned long long>(m->tag) << 32LL, reinterpret_cast<VectorHandleImage>(m->data));
       break;
     }
   }
 }
 
 /*
-ImageIndex OsdVector::getJpegRef(const char* fileName, int *width,int *height)
+VectorHandleImage OsdVector::getJpegRef(const char* fileName, int *width,int *height)
 {
-       ImageIndex image_handle=0;
+       VectorHandleImage image_handle=0;
        if (jpegs.find(fileName)==jpegs.end())
        {
                image_handle=jpegs[fileName]=createJpeg(fileName,width,height);
@@ -860,9 +860,9 @@ ImageIndex OsdVector::getJpegRef(const char* fileName, int *width,int *height)
 }
 */
 
-ImageIndex OsdVector::getMonoBitmapRef(void* base, int width, int height)
+VectorHandleImage OsdVector::getMonoBitmapRef(void* base, int width, int height)
 {
-  ImageIndex image_handle;
+  VectorHandleImage image_handle;
   surfaces_mutex.lock();
 
   if (monobitmaps.find(base) == monobitmaps.end())
@@ -891,9 +891,9 @@ ImageIndex OsdVector::getMonoBitmapRef(void* base, int width, int height)
   return image_handle;
 }
 
-ImageIndex OsdVector::getImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data)
+VectorHandleImage OsdVector::getImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data)
 {
-  ImageIndex image_handle;
+  VectorHandleImage image_handle;
   image_handle = createImagePalette(width, height, image_data, palette_data);
   surfaces_mutex.lock();
   palettepics.push_back(image_handle);
index d93cac94d23ccbc231428a927b15af7456498977..f712ed452bf071e7e222c4e4fa3abd222814e5bd 100644 (file)
@@ -70,7 +70,7 @@ enum Corner
   TopLeftLimited
 };
 
-typedef VectorHandle ImageIndex;
+typedef VectorHandle VectorHandleImage;
 typedef unsigned long long LoadIndex;
 
 class SVGCommand
@@ -103,7 +103,7 @@ class SVGCommand
       return nc;
     };
 
-    inline static SVGCommand PaintImage(float ix, float iy, float iw, float ih, ImageIndex image_in, VectorHandle ref, Corner corner = TopLeft)
+    inline static SVGCommand PaintImage(float ix, float iy, float iw, float ih, VectorHandleImage handle, VectorHandle ref, Corner corner = TopLeft)
     {
       SVGCommand nc;
       nc.instr = DrawImage;
@@ -111,7 +111,7 @@ class SVGCommand
       nc.y = iy;
       nc.w = iw;
       nc.h = ih;
-      nc.target.image = image_in;
+      nc.target.image = handle;
       nc.handle = ref; // can be 0 (no handle) or can be an Drawstyle nandle
       nc.corner = corner;
       return nc;
@@ -175,7 +175,7 @@ class SVGCommand
       return handle;
     };
 
-    ImageIndex getImageIndex()
+    VectorHandleImage getImageHandle()
     {
       if (instr != DrawImage) return 0;
       else return target.image;
@@ -195,7 +195,7 @@ class SVGCommand
     {
       PathIndex path_index;
       wchar_t textchar;
-      ImageIndex image;
+      VectorHandleImage image;
       unsigned int ttchar;
       LoadIndex loadindex;
     } target;
@@ -235,15 +235,15 @@ class OsdVector : public Osd, public MessageReceiver
     virtual float getCharWidth(wchar_t c) = 0;
     float* getCharWidthArray() {return byte_char_width;};
 
-    //virtual ImageIndex getJpegRef(const char* fileName, int *width,int *height);
-    virtual LoadIndex getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image);
-    virtual ImageIndex getMonoBitmapRef(void* base, int width, int height);
-    virtual ImageIndex getImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data);
+    //virtual VectorHandleImage getJpegRef(const char* fileName, int *width,int *height);
+    virtual LoadIndex getTVMediaRef(TVMediaInfo& tvmedia, VectorHandleImage& handle);
+    virtual VectorHandleImage getMonoBitmapRef(void* base, int width, int height);
+    virtual VectorHandleImage getImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data);
 
 
     virtual bool getStaticImageData(unsigned int static_id, UCHAR** userdata, ULONG* length) = 0;
 
-    void removeImageRef(const ImageIndex ref);
+    void removeImageRef(const VectorHandleImage ref);
     void removeLoadIndexRef(const LoadIndex ref);
     VectorHandle getDrawStyleHandle(const DrawStyle& c);
     virtual void decrementDrawStyleHandleRefCount(VectorHandle ref);
@@ -251,7 +251,7 @@ class OsdVector : public Osd, public MessageReceiver
     virtual void getRealScreenSize(int& width, int& height) = 0;
 
     // should be only called from control thread
-    void informPicture(LoadIndex index, ImageIndex i_index);
+    void informPicture(LoadIndex index, VectorHandleImage handle);
     void processMessage(Message* m);
 
 
@@ -346,15 +346,15 @@ class OsdVector : public Osd, public MessageReceiver
 
     PictureReader reader;
 
-    std::map<ImageIndex, int> images_ref;
-    std::map<void*, ImageIndex> monobitmaps;
-    //map<string,ImageIndex> jpegs;
-    std::map<TVMediaInfo, ImageIndex> tvmedias;
-    std::list<ImageIndex> palettepics;
+    std::map<VectorHandleImage, int> images_ref;
+    std::map<void*, VectorHandleImage> monobitmaps;
+    //map<string,VectorHandleImage> jpegs;
+    std::map<TVMediaInfo, VectorHandleImage> tvmedias;
+    std::list<VectorHandleImage> palettepics;
     std::map<LoadIndex, int> loadindex_ref;
     std::map<TVMediaInfo, LoadIndex> tvmedias_load;
     std::map<LoadIndex, TVMediaInfo> tvmedias_load_inv;
-    std::map<LoadIndex, ImageIndex> tvmedias_loaded;
+    std::map<LoadIndex, VectorHandleImage> tvmedias_loaded;
 
     std::map<DrawStyle, VectorHandle> drawstyleHandles;
     std::map<DrawStyle, VectorHandle>::iterator drawstyleHandles_lastit;
@@ -371,15 +371,15 @@ class OsdVector : public Osd, public MessageReceiver
 
     float byte_char_width[256]{};
 
-    void incImageRef(ImageIndex index);
-    int getImageRef(ImageIndex index);
-    virtual void destroyImageRef(ImageIndex index) = 0;
+    void incImageRef(VectorHandleImage handle);
+    int getImageRef(VectorHandleImage handle);
+    virtual void destroyImageRef(VectorHandleImage handle) = 0;
     void incLoadIndexRef(LoadIndex index);
     int getLoadIndexRef(LoadIndex index);
 
-    //virtual ImageIndex createJpeg(const char* fileName, int *width,int *height)=0;
-    virtual ImageIndex createMonoBitmap(void* base, int width, int height) = 0;
-    virtual ImageIndex createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data) = 0;
+    //virtual VectorHandleImage createJpeg(const char* fileName, int *width,int *height)=0;
+    virtual VectorHandleImage createMonoBitmap(void* base, int width, int height) = 0;
+    virtual VectorHandleImage createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data) = 0;
     virtual void createPicture(struct PictureInfo& pict_inf) = 0;
 
     virtual LoadIndex loadTVMedia(TVMediaInfo& tvmedia);
index 46b166b05be3db0e7ccb11a1ad03e27f8ef61b2d..51504eb9e6076d8f2dc0a62b7d806ff1bdeb23d3 100644 (file)
@@ -1206,9 +1206,9 @@ void OsdWinVector::getTextureCoordinates(FLOAT* x, FLOAT* y)
 
 
 
-void OsdWinVector::destroyImageRef(ImageIndex index)
+void OsdWinVector::destroyImageRef(VectorHandleImage handle)
 {
-       ID2D1Bitmap* bitmap = (ID2D1Bitmap*)index;
+       ID2D1Bitmap* bitmap = (ID2D1Bitmap*)handle;
        if (bitmap) bitmap->Release();
 }
 
@@ -1259,7 +1259,7 @@ void  OsdWinVector::createPicture(struct PictureInfo& pict_inf)
 }
 
 
-ImageIndex OsdWinVector::createMonoBitmap(void *base, int width, int height)
+VectorHandleImage OsdWinVector::createMonoBitmap(void *base, int width, int height)
 {
        // First we have  to convert it to 8 bit alpha, we could use WIC but actually writing this code is not hard to port from base class
 
@@ -1307,7 +1307,7 @@ ImageIndex OsdWinVector::createMonoBitmap(void *base, int width, int height)
 
 }
 
-ImageIndex OsdWinVector::createImagePalette(int width, int height, const unsigned char *image_data, const unsigned int*palette_data)
+VectorHandleImage OsdWinVector::createImagePalette(int width, int height, const unsigned char *image_data, const unsigned int*palette_data)
 {
        // First we have  to convert it to 32 bit RGBA, we could use WIC but actually writing this code is not hard to port from base class
 
index b75e387e3742ec046d30f20f03f3d961292e8ac0..4c17c1eff513dff73fd86e6be0af61bd902d605b 100644 (file)
@@ -69,9 +69,9 @@ protected:
        void getTextureCoordinates(FLOAT*, FLOAT*);
 
        /*osd vector implementation*/
-       void destroyImageRef(ImageIndex index);
-       ImageIndex createMonoBitmap(void *base, int width, int height);
-       ImageIndex createImagePalette(int width, int height, const unsigned char *image_data, const unsigned int*palette_data);
+       void destroyImageRef(VectorHandleImage index);
+       VectorHandleImage createMonoBitmap(void *base, int width, int height);
+       VectorHandleImage createImagePalette(int width, int height, const unsigned char *image_data, const unsigned int*palette_data);
        void createPicture(struct PictureInfo& pict_inf);
        void destroyDrawStyleHandle(VectorHandle index);
        VectorHandle createDrawStyleHandle(const DrawStyle &c);
index 2b0e133131341980b90160f88d5f158502de094b..1da632b46ca62b560f15a16a39ac0a602dde0309 100644 (file)
@@ -42,8 +42,8 @@ SurfaceVector::~SurfaceVector()
   {
     osd->decrementDrawStyleHandleRefCount(command.getHandle()); // We remove the Style reference, so that osd can free stuff // FIXME BUG BUG BUG
 
-    ImageIndex ii = command.getImageIndex();
-    if (ii) osd->removeImageRef(ii);
+    VectorHandleImage handle = command.getImageHandle();
+    if (handle) osd->removeImageRef(handle);
 
     LoadIndex li = command.getLoadIndex();
     if (li) osd->removeLoadIndexRef(li);
@@ -252,8 +252,8 @@ void SurfaceVector::drawJpeg(const char* fileName, int x, int y, int* width, int
 void SurfaceVector::drawJpeg(const char *fileName,int x, int y,int *width, int *height)
 {
        command_mutex.lock();
-       ImageIndex image=osd->getJpegRef(fileName,width,height);
-       commands.push_back(SVGCommand::PaintImage(x,y,*width,*height,image,0));
+       VectorHandleImage handle=osd->getJpegRef(fileName,width,height);
+       commands.push_back(SVGCommand::PaintImage(x,y,*width,*height,handle,0));
        command_mutex.unlock();
 }
 */
@@ -261,22 +261,22 @@ void SurfaceVector::drawJpeg(const char *fileName,int x, int y,int *width, int *
 void SurfaceVector::drawTVMedia(TVMediaInfo& tvmedia, float x, float y, float  width, float height, Corner corner)
 {
   command_mutex.lock();
-  ImageIndex image = 0;
-  LoadIndex load_index = osd->getTVMediaRef(tvmedia, image);
+  VectorHandleImage handle = 0;
+  LoadIndex load_index = osd->getTVMediaRef(tvmedia, handle);
 
   if (width != 0 && height != 0)
   {
     removeCommands(x, y, width, height);
   }
 
-  if (image)
+  if (handle)
   {
-    logger->trace(TAG, "drawTVMedia: i=true, Add instr PaintImage load_index={} image={}", load_index, image);
-    commands.push_back(SVGCommand::PaintImage(x, y, width, height, image, 0, corner));
+    logger->trace(TAG, "drawTVMedia: i=true, Add instr PaintImage load_index={} handle={}", load_index, handle);
+    commands.push_back(SVGCommand::PaintImage(x, y, width, height, handle, 0, corner));
   }
   else
   {
-    logger->trace(TAG, "drawTVMedia: i=false, Add instr PaintImageLoading {} {}", load_index, image);
+    logger->trace(TAG, "drawTVMedia: i=false, Add instr PaintImageLoading {} {}", load_index, handle);
     commands.push_back(SVGCommand::PaintImageLoading(load_index, x, y, width, height, corner));
   }
 
@@ -339,7 +339,7 @@ void SurfaceVector::drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegi
                   data[i+j*bm.getHeight()]=bm.getColour(i,j);
           }
       }*/
-  ImageIndex image = osd->getImagePalette(bm.getWidth(), bm.getHeight(), &(bm.rawData()[0]),
+  VectorHandleImage handle = osd->getImagePalette(bm.getWidth(), bm.getHeight(), &(bm.rawData()[0]),
                                           (const unsigned int*)&bm.palette.getColourVector()[0]); // data is freed by the OSD
   //free(data);
   float tx = x + region.windowx;
@@ -353,7 +353,7 @@ void SurfaceVector::drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegi
   ty *= scaley;
   tw *= scalex;
   th *= scaley;
-  SVGCommand temp = SVGCommand::PaintImage(tx, ty, tw, th, image, 0);
+  SVGCommand temp = SVGCommand::PaintImage(tx, ty, tw, th, handle, 0);
   removeCommands(tx, ty, tw, th);
   commands.push_back(temp);
   command_mutex.unlock();
@@ -372,10 +372,10 @@ void SurfaceVector::drawPoint(int x, int y, const DrawStyle& c, bool fastdraw)
 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);
+  VectorHandleImage handle = osd->getMonoBitmapRef(base, width, height);
   VectorHandle ref = osd->getDrawStyleHandle(nextColour);
   removeCommands(dx, dy, width, height);
-  commands.push_back(SVGCommand::PaintImage(dx, dy, height, width, image, ref)); // FIXME BUG height and width wrong way around?
+  commands.push_back(SVGCommand::PaintImage(dx, dy, height, width, handle, ref)); // FIXME BUG height and width wrong way around?
   command_mutex.unlock();
 }
 
@@ -400,9 +400,9 @@ int SurfaceVector::removeCommands(float x, float y, float width, float height)
       //Log::getInstance()->log("OSD", Log::DEBUG, "Remove command %d %g %g %g %g %d %d",(*itty).instr,
       //(*itty).x,(*itty).y,(*itty).w,(*itty).h,(*itty).handle,(*itty).target.image);
       osd->decrementDrawStyleHandleRefCount((*itty).getHandle()); // We remove the Style reference, so that osd can free stuff // FIXME BUG BUG BUG
-      ImageIndex ii = (*itty).getImageIndex();
+      VectorHandleImage handle = (*itty).getImageHandle();
 
-      if (ii) osd->removeImageRef(ii);
+      if (handle) osd->removeImageRef(handle);
 
       LoadIndex li = (*itty).getLoadIndex();