0031705: Visualization - move out construction of predefined markers from OpenGl_Aspe...
authormkrylova <mkrylova@opencascade.com>
Fri, 20 Nov 2020 12:10:23 +0000 (15:10 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 17 Dec 2020 18:05:04 +0000 (21:05 +0300)
Built-in markers definition has been moved from OpenGl_AspectsSprite to Graphic3d_MarkerImage and generalized.
RGBA8 pixel format is now preferred over BGRA8.
Fallback OpenGL 1.1 rendering code now supports drawing of colored markers using glDrawPixels().

Added function Image_PixMap::FlipY() flipping image rows.

src/Graphic3d/FILES
src/Graphic3d/Graphic3d_MarkerImage.cxx
src/Graphic3d/Graphic3d_MarkerImage.hxx
src/Graphic3d/Graphic3d_MarkerImage.pxx [new file with mode: 0644]
src/Image/Image_PixMap.cxx
src/Image/Image_PixMap.hxx
src/OpenGl/OpenGl_AspectsSprite.cxx
src/OpenGl/OpenGl_PointSprite.hxx
src/OpenGl/OpenGl_PrimitiveArray.cxx
src/OpenGl/OpenGl_Texture.hxx

index 69e0941..ed74f31 100755 (executable)
@@ -96,6 +96,7 @@ Graphic3d_MapOfStructure.hxx
 Graphic3d_MapOfZLayerSettings.hxx
 Graphic3d_MarkerImage.cxx
 Graphic3d_MarkerImage.hxx
+Graphic3d_MarkerImage.pxx
 Graphic3d_Mat4.hxx
 Graphic3d_Mat4d.hxx
 Graphic3d_MaterialAspect.cxx
index a8b51dc..b56ff81 100755 (executable)
 #include <Standard_Atomic.hxx>
 #include <TColStd_HArray1OfByte.hxx>
 
+#include "Graphic3d_MarkerImage.pxx"
+
 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MarkerImage,Standard_Transient)
 
 namespace
 {
   static volatile Standard_Integer THE_MARKER_IMAGE_COUNTER = 0;
-}
 
+  //! Returns a parameters for the marker of the specified type and scale.
+  static void getMarkerBitMapParam (const Aspect_TypeOfMarker theMarkerType,
+                                    const Standard_ShortReal theScale,
+                                    Standard_Integer& theWidth,
+                                    Standard_Integer& theHeight,
+                                    Standard_Integer& theOffset,
+                                    Standard_Integer& theNumOfBytes)
+  {
+    const Standard_Integer aType = Standard_Integer(theMarkerType > Aspect_TOM_O
+                                                  ? Aspect_TOM_O
+                                                  : theMarkerType);
+    const Standard_Real anIndex = (Standard_Real)(TEL_NO_OF_SIZES - 1) * (theScale - (Standard_Real)TEL_PM_START_SIZE)
+                                / (Standard_Real)(TEL_PM_END_SIZE - TEL_PM_START_SIZE);
+    Standard_Integer anId = (Standard_Integer)(anIndex + 0.5);
+    if (anId < 0)
+    {
+      anId = 0;
+    }
+    else if (anId >= TEL_NO_OF_SIZES)
+    {
+      anId = TEL_NO_OF_SIZES - 1;
+    }
+
+    theWidth  = (Standard_Integer)arrPMFontInfo[aType][anId].width;
+    theHeight = (Standard_Integer)arrPMFontInfo[aType][anId].height;
+    theOffset = arrPMFontInfo[aType][anId].offset;
+    const Standard_Integer aNumOfBytesInRow = theWidth / 8 + (theWidth % 8 ? 1 : 0);
+    theNumOfBytes = theHeight * aNumOfBytesInRow;
+  }
+
+  //! Merge two image pixmap into one. Used for creating image for following markers:
+  //! Aspect_TOM_O_POINT, Aspect_TOM_O_PLUS, Aspect_TOM_O_STAR, Aspect_TOM_O_X, Aspect_TOM_RING1, Aspect_TOM_RING2, Aspect_TOM_RING3
+  static Handle(Image_PixMap) mergeImages (const Handle(Image_PixMap)& theImage1,
+                                           const Handle(Image_PixMap)& theImage2)
+  {
+    if (theImage1.IsNull() && theImage2.IsNull())
+    {
+      return Handle(Image_PixMap)();
+    }
+
+    Handle(Image_PixMap) aResultImage = new Image_PixMap();
+
+    Standard_Integer aWidth1 = 0, aHeight1 = 0;
+    if (!theImage1.IsNull())
+    {
+      aWidth1  = (Standard_Integer )theImage1->Width();
+      aHeight1 = (Standard_Integer )theImage1->Height();
+    }
+
+    Standard_Integer aWidth2 = 0, aHeight2 = 0;
+    if (!theImage2.IsNull())
+    {
+      aWidth2  = (Standard_Integer )theImage2->Width();
+      aHeight2 = (Standard_Integer )theImage2->Height();
+    }
+
+    const Standard_Integer aMaxWidth  = Max (aWidth1,  aWidth2);
+    const Standard_Integer aMaxHeight = Max (aHeight1, aHeight2);
+    const Standard_Integer aSize = Max (aMaxWidth, aMaxHeight);
+    aResultImage->InitZero (Image_Format_Alpha, aSize, aSize);
+
+    if (!theImage1.IsNull())
+    {
+      const Standard_Integer aXOffset1  = Abs (aWidth1  - aMaxWidth)  / 2;
+      const Standard_Integer anYOffset1 = Abs (aHeight1 - aMaxHeight) / 2;
+      for (Standard_Integer anY = 0; anY < aHeight1; anY++)
+      {
+        Standard_Byte* anImageLine = theImage1->ChangeRow (anY);
+        Standard_Byte* aResultImageLine = aResultImage->ChangeRow (anYOffset1 + anY);
+        for (Standard_Integer aX = 0; aX < aWidth1; aX++)
+        {
+          aResultImageLine[aXOffset1 + aX] |= anImageLine[aX];
+        }
+      }
+    }
+
+    if (!theImage2.IsNull())
+    {
+      const Standard_Integer aXOffset2  = Abs (aWidth2  - aMaxWidth)  / 2;
+      const Standard_Integer anYOffset2 = Abs (aHeight2 - aMaxHeight) / 2;
+      for (Standard_Integer anY = 0; anY < aHeight2; anY++)
+      {
+        Standard_Byte* anImageLine = theImage2->ChangeRow (anY);
+        Standard_Byte* aResultImageLine = aResultImage->ChangeRow (anYOffset2 + anY);
+        for (Standard_Integer aX = 0; aX < aWidth2; aX++)
+        {
+          aResultImageLine[aXOffset2 + aX] |= anImageLine[aX];
+        }
+      }
+    }
+
+    return aResultImage;
+  }
+
+  //! Draw inner point as filled rectangle
+  static Handle(TColStd_HArray1OfByte) fillPointBitmap (const Standard_Integer theSize)
+  {
+    const Standard_Integer        aNbBytes = (theSize / 8 + (theSize % 8 ? 1 : 0)) * theSize;
+    Handle(TColStd_HArray1OfByte) aBitMap = new TColStd_HArray1OfByte (0, aNbBytes - 1);
+    for (Standard_Integer anIter = 0; anIter < aBitMap->Length(); ++anIter)
+    {
+      aBitMap->SetValue (anIter, 255);
+    }
+    return aBitMap;
+  }
+
+  //! Returns a marker image for the marker of the specified type and scale.
+  static Handle(Graphic3d_MarkerImage) getTextureImage (const Aspect_TypeOfMarker theMarkerType,
+                                                        const Standard_ShortReal  theScale)
+  {
+    Standard_Integer aWidth = 0, aHeight = 0, anOffset = 0, aNbBytes = 0;
+    getMarkerBitMapParam (theMarkerType, theScale, aWidth, aHeight, anOffset, aNbBytes);
+
+    Handle(TColStd_HArray1OfByte) aBitMap = new TColStd_HArray1OfByte (0, aNbBytes - 1);
+    for (Standard_Integer anIter = 0; anIter < aNbBytes; ++anIter)
+    {
+      aBitMap->ChangeValue (anIter) = Graphic3d_MarkerImage_myMarkerRaster[anOffset + anIter];
+    }
+
+    Handle(Graphic3d_MarkerImage) aTexture = new Graphic3d_MarkerImage (aBitMap, aWidth, aHeight);
+    return aTexture;
+  }
+}
 
 // =======================================================================
 // function : Graphic3d_MarkerImage
 // purpose  :
 // =======================================================================
-Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(Image_PixMap)& theImage)
+Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(Image_PixMap)& theImage,
+                                              const Handle(Image_PixMap)& theImageAlpha)
 : myImage  (theImage),
+  myImageAlpha (theImageAlpha),
   myMargin (1),
   myWidth  ((Standard_Integer )theImage->Width()),
   myHeight ((Standard_Integer )theImage->Height())
@@ -42,6 +168,20 @@ Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(Image_PixMap)& theIma
 
   myImageAlphaId = TCollection_AsciiString ("Graphic3d_MarkerImageAlpha_")
                  + TCollection_AsciiString (THE_MARKER_IMAGE_COUNTER);
+
+  if (!theImageAlpha.IsNull())
+  {
+    if (theImageAlpha->Format() != Image_Format_Alpha
+     && theImageAlpha->Format() != Image_Format_Gray)
+    {
+      throw Standard_ProgramError ("Graphic3d_MarkerImage, wrong color format of alpha image");
+    }
+    if (theImageAlpha->SizeX() != theImage->SizeX()
+     || theImageAlpha->SizeY() != theImage->SizeY())
+    {
+      throw Standard_ProgramError ("Graphic3d_MarkerImage, wrong dimensions of alpha image");
+    }
+  }
 }
 
 // =======================================================================
@@ -49,8 +189,8 @@ Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(Image_PixMap)& theIma
 // purpose  :
 // =======================================================================
 Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(TColStd_HArray1OfByte)& theBitMap,
-                                              const Standard_Integer& theWidth,
-                                              const Standard_Integer& theHeight)
+                                              const Standard_Integer theWidth,
+                                              const Standard_Integer theHeight)
 : myBitMap (theBitMap),
   myMargin (1),
   myWidth  (theWidth),
@@ -63,31 +203,39 @@ Graphic3d_MarkerImage::Graphic3d_MarkerImage (const Handle(TColStd_HArray1OfByte
                  + TCollection_AsciiString (THE_MARKER_IMAGE_COUNTER);
 }
 
+// =======================================================================
+// function : IsColoredImage
+// purpose  :
+// =======================================================================
+bool Graphic3d_MarkerImage::IsColoredImage() const
+{
+  return !myImage.IsNull()
+       && myImage->Format() != Image_Format_Alpha
+       && myImage->Format() != Image_Format_Gray;
+}
+
 // =======================================================================
 // function : GetBitMapArray
 // purpose  :
 // =======================================================================
-Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray (const Standard_Real& theAlphaValue) const
+Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray (const Standard_Real theAlphaValue,
+                                                                     const Standard_Boolean theIsTopDown) const
 {
-  if (!myBitMap.IsNull())
+  if (!myBitMap.IsNull()
+    || myImage.IsNull())
   {
     return myBitMap;
   }
 
-  Handle(TColStd_HArray1OfByte) aBitMap;
-  if (myImage.IsNull())
-  {
-    return aBitMap;
-  }
-
   const Standard_Integer aNumOfBytesInRow = (Standard_Integer )(myImage->Width() / 8) + (myImage->Width() % 8 ? 1 : 0);
   const Standard_Integer aNumOfBytes      = (Standard_Integer )(aNumOfBytesInRow * myImage->Height());
   const Standard_Integer aHeight = (Standard_Integer )myImage->Height();
   const Standard_Integer aWidth  = (Standard_Integer )myImage->Width();
-  aBitMap = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
+  Handle(TColStd_HArray1OfByte) aBitMap = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
   aBitMap->Init (0);
   for (Standard_Integer aRow = 0; aRow < aHeight; aRow++)
   {
+    const Standard_Integer aResRow = !theIsTopDown ? (aHeight - aRow - 1) : aRow;
     for (Standard_Integer aColumn = 0; aColumn < aWidth; aColumn++)
     {
       const Quantity_ColorRGBA aColor = myImage->PixelColor (aColumn, aRow);
@@ -101,7 +249,7 @@ Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray (const Stand
         aBitOn = aColor.Alpha() > theAlphaValue;
       }
 
-      Standard_Integer anIndex = aNumOfBytesInRow * aRow + aColumn / 8;
+      Standard_Integer anIndex = aNumOfBytesInRow * aResRow + aColumn / 8;
       aBitMap->SetValue (anIndex, (Standard_Byte)(aBitMap->Value (anIndex) + 
                                                   (aBitOn ? (0x80 >> (aColumn % 8)) : 0)));
     }
@@ -116,12 +264,8 @@ Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray (const Stand
 // =======================================================================
 const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
 {
-  if (!myImage.IsNull())
-  {
-    return myImage;
-  }
-
-  if (myBitMap.IsNull())
+  if (!myImage.IsNull()
+    || myBitMap.IsNull())
   {
     return myImage;
   }
@@ -216,3 +360,122 @@ void Graphic3d_MarkerImage::GetTextureSize (Standard_Integer& theWidth,
   theWidth  = myWidth;
   theHeight = myHeight;
 }
+
+// =======================================================================
+// function : GetMarkerImage
+// purpose  :
+// =======================================================================
+Handle(Graphic3d_MarkerImage) Graphic3d_MarkerImage::StandardMarker (const Aspect_TypeOfMarker theMarkerType,
+                                                                     const Standard_ShortReal theScale,
+                                                                     const Graphic3d_Vec4& theColor)
+{
+  switch (theMarkerType)
+  {
+    case Aspect_TOM_O_POINT:
+    case Aspect_TOM_O_PLUS:
+    case Aspect_TOM_O_STAR:
+    case Aspect_TOM_O_X:
+    {
+      // For this type of markers we merge two base bitmaps into one
+      // For example Aspect_TOM_O_PLUS = Aspect_TOM_O + Aspect_TOM_PLUS
+      Handle(Graphic3d_MarkerImage) aMarkerImage1 = getTextureImage (Aspect_TOM_O, theScale);
+      Handle(Graphic3d_MarkerImage) aMarkerImage2;
+      if (theMarkerType == Aspect_TOM_O_POINT)
+      {
+        // draw inner point as filled rectangle
+        const Standard_Integer        aSize = theScale > 7 ? 7 : (Standard_Integer)(theScale + 0.5F);
+        Handle(TColStd_HArray1OfByte) aBitMap = fillPointBitmap (aSize);
+        aMarkerImage2 = new Graphic3d_MarkerImage (aBitMap, aSize, aSize);
+      }
+      else
+      {
+        aMarkerImage2 = getTextureImage (Aspect_TypeOfMarker(theMarkerType - Aspect_TOM_O_POINT), theScale);
+      }
+      Handle(Image_PixMap) anImage = mergeImages (aMarkerImage1->GetImage(), aMarkerImage2->GetImage());
+      Handle(Graphic3d_MarkerImage) aNewMarkerImage = new Graphic3d_MarkerImage (anImage);
+      return aNewMarkerImage;
+    }
+    case Aspect_TOM_RING1:
+    case Aspect_TOM_RING2:
+    case Aspect_TOM_RING3:
+    {
+      const Standard_ShortReal aDelta = 0.1f;
+      Standard_ShortReal aScale = theScale;
+      Standard_ShortReal aLimit = 0.0f;
+      if (theMarkerType == Aspect_TOM_RING1)
+      {
+        aLimit = aScale * 0.2f;
+      }
+      else if (theMarkerType == Aspect_TOM_RING2)
+      {
+        aLimit = aScale * 0.5f;
+      }
+      else if (theMarkerType == Aspect_TOM_RING3)
+      {
+        aLimit = aScale * 0.8f;
+      }
+
+      Handle(Image_PixMap) anImage;
+      for (; aScale > aLimit && aScale >= 1.0f; aScale -= aDelta)
+      {
+        anImage = mergeImages (anImage, getTextureImage (Aspect_TOM_O, aScale)->GetImage());
+      }
+      Handle(Graphic3d_MarkerImage) aNewMarkerImage = new Graphic3d_MarkerImage (anImage);
+      return aNewMarkerImage;
+    }
+    case Aspect_TOM_BALL:
+    {
+      Standard_Integer aWidth = 0, aHeight = 0, anOffset = 0, aNbBytes = 0;
+      Standard_ShortReal aScale = theScale;
+      getMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNbBytes);
+
+      NCollection_Vec4<Standard_Real> aColor (theColor);
+
+      const Standard_Integer aSize = Max (aWidth + 2, aHeight + 2); // includes extra margin
+      Handle(Image_PixMap) anImage  = new Image_PixMap();
+      Handle(Image_PixMap) anImageA = new Image_PixMap();
+      anImage ->InitZero (Image_Format_RGBA,  aSize, aSize);
+      anImageA->InitZero (Image_Format_Alpha, aSize, aSize);
+
+      // we draw a set of circles
+      Image_ColorRGBA aColor32;
+      aColor32.a() = 255;
+      Standard_Real aHLS[3];
+      const Standard_ShortReal aDelta = 0.1f;
+      while (aScale >= 1.0f)
+      {
+        Quantity_Color::RgbHls (aColor.r(), aColor.g(), aColor.b(), aHLS[0], aHLS[1], aHLS[2]);
+        aHLS[2] *= 0.95; // 5% saturation change
+        Quantity_Color::HlsRgb (aHLS[0], aHLS[1], aHLS[2], aColor.r(), aColor.g(), aColor.b());
+        aColor32.r() = Standard_Byte (255.0 * aColor.r());
+        aColor32.g() = Standard_Byte (255.0 * aColor.g());
+        aColor32.b() = Standard_Byte (255.0 * aColor.b());
+
+        const Handle(Graphic3d_MarkerImage) aMarker = getTextureImage (Aspect_TOM_O, aScale);
+        const Handle(Image_PixMap)& aCircle = aMarker->GetImage();
+
+        const Standard_Size aDiffX = (anImage->SizeX() - aCircle->SizeX()) / 2;
+        const Standard_Size aDiffY = (anImage->SizeY() - aCircle->SizeY()) / 2;
+        for (Standard_Size aRow = 0; aRow < aCircle->SizeY(); ++aRow)
+        {
+          const Standard_Byte* aRowData = aCircle->Row(aRow);
+          for (Standard_Size aCol = 0; aCol < aCircle->SizeX(); ++aCol)
+          {
+            if (aRowData[aCol] != 0)
+            {
+              anImage->ChangeValue<Image_ColorRGBA>(aDiffX + aRow, aDiffY + aCol) = aColor32;
+              anImageA->ChangeValue<Standard_Byte> (aDiffX + aRow, aDiffY + aCol) = 255;
+            }
+          }
+        }
+        aScale -= aDelta;
+      }
+      Handle(Graphic3d_MarkerImage) aNewMarkerImage = new Graphic3d_MarkerImage (anImage, anImageA);
+      return aNewMarkerImage;
+    }
+    default:
+    {
+      return getTextureImage (theMarkerType, theScale);
+    }
+  }
+}
index e73e0dd..c492ecd 100755 (executable)
@@ -16,6 +16,8 @@
 #ifndef _Graphic3d_MarkerImage_H__
 #define _Graphic3d_MarkerImage_H__
 
+#include <Aspect_TypeOfMarker.hxx>
+#include <Graphic3d_Vec4.hxx>
 #include <TColStd_HArray1OfByte.hxx>
 #include <TCollection_AsciiString.hxx>
 
@@ -25,45 +27,64 @@ class Image_PixMap;
 //! It can convert bitmap texture stored in TColStd_HArray1OfByte to Image_PixMap and vice versa.
 class Graphic3d_MarkerImage : public Standard_Transient
 {
+  DEFINE_STANDARD_RTTIEXT(Graphic3d_MarkerImage, Standard_Transient)
 public:
 
-  //! @param theImage - source image
-  Standard_EXPORT Graphic3d_MarkerImage (const Handle(Image_PixMap)& theImage);
+  //! Returns a marker image for the marker of the specified type, scale and color.
+  Standard_EXPORT static Handle(Graphic3d_MarkerImage) StandardMarker (const Aspect_TypeOfMarker theMarkerType,
+                                                                       const Standard_ShortReal  theScale,
+                                                                       const Graphic3d_Vec4& theColor);
+
+public:
+
+  //! Constructor from existing pixmap.
+  //! @param theImage [in] source image
+  //! @param theImageAlpha [in] colorless image
+  Standard_EXPORT Graphic3d_MarkerImage (const Handle(Image_PixMap)& theImage,
+                                         const Handle(Image_PixMap)& theImageAlpha = Handle(Image_PixMap)());
 
   //! Creates marker image from array of bytes
   //! (method for compatibility with old markers definition).
-  //! @param theBitMap - source bitmap stored as array of bytes
-  //! @param theWidth  - number of bits in a row
-  //! @param theHeight - number of bits in a column
+  //! @param theBitMap [in] source bitmap stored as array of bytes
+  //! @param theWidth  [in] number of bits in a row
+  //! @param theHeight [in] number of bits in a column
   Standard_EXPORT Graphic3d_MarkerImage (const Handle(TColStd_HArray1OfByte)& theBitMap,
-                                         const Standard_Integer& theWidth,
-                                         const Standard_Integer& theHeight);
-
-  //! @param theAlphaValue pixels in the image that have alpha value greater than
-  //!                      or equal to this parameter will be stored in bitmap as "1",
-  //!                      others will be stored as "0"
-  //! @return marker image as array of bytes. If an instance of the class has been
-  //! initialized with image, it will be converted to bitmap based on the parameter theAlphaValue.
-  Standard_EXPORT Handle(TColStd_HArray1OfByte) GetBitMapArray (const Standard_Real& theAlphaValue = 0.5) const;
+                                         const Standard_Integer theWidth,
+                                         const Standard_Integer theHeight);
 
-  //! @return marker image. If an instance of the class has been initialized with a bitmap, it will be
-  //! converted to image.
+  //! Return marker image.
+  //! If an instance of the class has been initialized with a bitmap, it will be converted to image.
   Standard_EXPORT const Handle(Image_PixMap)& GetImage();
 
-  //! @return image alpha as grayscale image. Note that if an instance of the class has been initialized
-  //! with a bitmap or with grayscale image this method will return exactly the same image as GetImage()
+  //! Return image alpha as grayscale image.
+  //! Note that if an instance of the class has been initialized with a bitmap
+  //! or with grayscale image this method will return exactly the same image as GetImage()
   Standard_EXPORT const Handle(Image_PixMap)& GetImageAlpha();
 
-  //! @return an unique ID. This ID will be used to manage resource in graphic driver.
+  //! Return an unique ID.
+  //! This ID will be used to manage resource in graphic driver.
   Standard_EXPORT const TCollection_AsciiString& GetImageId() const;
 
-  //! @return an unique ID. This ID will be used to manage resource in graphic driver.
+  //! Return an unique ID.
+  //! This ID will be used to manage resource in graphic driver.
   Standard_EXPORT const TCollection_AsciiString& GetImageAlphaId() const;
 
-  //! @return texture size
+  //! Return texture size
   Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth,
                                        Standard_Integer& theHeight) const;
 
+  //! Return TRUE if marker image has colors (e.g. RGBA and not grayscale).
+  Standard_EXPORT bool IsColoredImage() const;
+
+  //! Return marker image as array of bytes.
+  //! If an instance of the class has been initialized with image, it will be converted to bitmap based on the parameter theAlphaValue.
+  //! @param theAlphaValue pixels in the image that have alpha value greater than
+  //!                      or equal to this parameter will be stored in bitmap as "1",
+  //!                      others will be stored as "0"
+  //! @param theIsTopDown [in] flag indicating expected rows order in returned bitmap, which is bottom-up by default
+  Standard_EXPORT Handle(TColStd_HArray1OfByte) GetBitMapArray (const Standard_Real theAlphaValue = 0.5,
+                                                                const Standard_Boolean theIsTopDown = false) const;
+
 private:
 
   TCollection_AsciiString       myImageId;      //!< resource identifier
@@ -75,10 +96,6 @@ private:
   Standard_Integer              myWidth;        //!< marker width
   Standard_Integer              myHeight;       //!< marker height
 
-public:
-
-  DEFINE_STANDARD_RTTIEXT(Graphic3d_MarkerImage,Standard_Transient) // Type definition
-
 };
 
 DEFINE_STANDARD_HANDLE (Graphic3d_MarkerImage, Standard_Transient)
diff --git a/src/Graphic3d/Graphic3d_MarkerImage.pxx b/src/Graphic3d/Graphic3d_MarkerImage.pxx
new file mode 100644 (file)
index 0000000..8cfd105
--- /dev/null
@@ -0,0 +1,1300 @@
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#define TEL_NO_OF_SIZES   13
+#define TEL_PM_START_SIZE 1.0
+#define TEL_PM_END_SIZE   7.0
+
+namespace
+{
+struct PM_FONT_INFO
+{
+  float width, height;
+  int   offset;
+};
+
+typedef PM_FONT_INFO* pm_font_info;
+
+#define PM_PLUS_10_NUM  9*2
+#define PM_PLUS_15_NUM  11*2
+#define PM_PLUS_20_NUM  13*2
+#define PM_PLUS_25_NUM  15*2
+#define PM_PLUS_30_NUM  17*3
+#define PM_PLUS_35_NUM  19*3
+#define PM_PLUS_40_NUM  21*3
+#define PM_PLUS_45_NUM  23*3
+#define PM_PLUS_50_NUM  25*4
+#define PM_PLUS_55_NUM  27*4
+#define PM_PLUS_60_NUM  29*4
+#define PM_PLUS_65_NUM  31*4
+#define PM_PLUS_70_NUM  32*4
+
+#define PM_STAR_10_NUM  9
+#define PM_STAR_15_NUM  11*2
+#define PM_STAR_20_NUM  13*2
+#define PM_STAR_25_NUM  15*2
+#define PM_STAR_30_NUM  17*2
+#define PM_STAR_35_NUM  19*2
+#define PM_STAR_40_NUM  21*3
+#define PM_STAR_45_NUM  23*3
+#define PM_STAR_50_NUM  25*3
+#define PM_STAR_55_NUM  27*3
+#define PM_STAR_60_NUM  29*4
+#define PM_STAR_65_NUM  32*4
+#define PM_STAR_70_NUM  32*4
+
+#define PM_CIRC_10_NUM  7
+#define PM_CIRC_15_NUM  9*2
+#define PM_CIRC_20_NUM  9*2
+#define PM_CIRC_25_NUM  11*2
+#define PM_CIRC_30_NUM  13*2
+#define PM_CIRC_35_NUM  15*2
+#define PM_CIRC_40_NUM  17*3
+#define PM_CIRC_45_NUM  19*3
+#define PM_CIRC_50_NUM  21*3
+#define PM_CIRC_55_NUM  23*3
+#define PM_CIRC_60_NUM  25*4
+#define PM_CIRC_65_NUM  27*4
+#define PM_CIRC_70_NUM  29*4
+
+#define PM_CROSS_10_NUM 7
+#define PM_CROSS_15_NUM 9*2
+#define PM_CROSS_20_NUM 11*2
+#define PM_CROSS_25_NUM 13*2
+#define PM_CROSS_30_NUM 15*2
+#define PM_CROSS_35_NUM 17*3
+#define PM_CROSS_40_NUM 19*3
+#define PM_CROSS_45_NUM 21*3
+#define PM_CROSS_50_NUM 23*3
+#define PM_CROSS_55_NUM 25*4
+#define PM_CROSS_60_NUM 27*4
+#define PM_CROSS_65_NUM 32*4
+#define PM_CROSS_70_NUM 32*4
+
+#define PM_PLUS_10_OFT  0
+#define PM_PLUS_15_OFT  PM_PLUS_10_OFT + PM_PLUS_10_NUM
+#define PM_PLUS_20_OFT  PM_PLUS_15_OFT + PM_PLUS_15_NUM
+#define PM_PLUS_25_OFT  PM_PLUS_20_OFT + PM_PLUS_20_NUM
+#define PM_PLUS_30_OFT  PM_PLUS_25_OFT + PM_PLUS_25_NUM
+#define PM_PLUS_35_OFT  PM_PLUS_30_OFT + PM_PLUS_30_NUM
+#define PM_PLUS_40_OFT  PM_PLUS_35_OFT + PM_PLUS_35_NUM
+#define PM_PLUS_45_OFT  PM_PLUS_40_OFT + PM_PLUS_40_NUM
+#define PM_PLUS_50_OFT  PM_PLUS_45_OFT + PM_PLUS_45_NUM
+#define PM_PLUS_55_OFT  PM_PLUS_50_OFT + PM_PLUS_50_NUM
+#define PM_PLUS_60_OFT  PM_PLUS_55_OFT + PM_PLUS_55_NUM
+#define PM_PLUS_65_OFT  PM_PLUS_60_OFT + PM_PLUS_60_NUM
+#define PM_PLUS_70_OFT  PM_PLUS_65_OFT + PM_PLUS_65_NUM
+
+#define PM_STAR_10_OFT  PM_PLUS_70_OFT + PM_PLUS_70_NUM
+#define PM_STAR_15_OFT  PM_STAR_10_OFT + PM_STAR_10_NUM
+#define PM_STAR_20_OFT  PM_STAR_15_OFT + PM_STAR_15_NUM
+#define PM_STAR_25_OFT  PM_STAR_20_OFT + PM_STAR_20_NUM
+#define PM_STAR_30_OFT  PM_STAR_25_OFT + PM_STAR_25_NUM
+#define PM_STAR_35_OFT  PM_STAR_30_OFT + PM_STAR_30_NUM
+#define PM_STAR_40_OFT  PM_STAR_35_OFT + PM_STAR_35_NUM
+#define PM_STAR_45_OFT  PM_STAR_40_OFT + PM_STAR_40_NUM
+#define PM_STAR_50_OFT  PM_STAR_45_OFT + PM_STAR_45_NUM
+#define PM_STAR_55_OFT  PM_STAR_50_OFT + PM_STAR_50_NUM
+#define PM_STAR_60_OFT  PM_STAR_55_OFT + PM_STAR_55_NUM
+#define PM_STAR_65_OFT  PM_STAR_60_OFT + PM_STAR_60_NUM
+#define PM_STAR_70_OFT  PM_STAR_65_OFT + PM_STAR_65_NUM
+
+#define PM_CIRC_10_OFT  PM_STAR_70_OFT + PM_STAR_70_NUM
+#define PM_CIRC_15_OFT  PM_CIRC_10_OFT + PM_CIRC_10_NUM
+#define PM_CIRC_20_OFT  PM_CIRC_15_OFT + PM_CIRC_15_NUM
+#define PM_CIRC_25_OFT  PM_CIRC_20_OFT + PM_CIRC_20_NUM
+#define PM_CIRC_30_OFT  PM_CIRC_25_OFT + PM_CIRC_25_NUM
+#define PM_CIRC_35_OFT  PM_CIRC_30_OFT + PM_CIRC_30_NUM
+#define PM_CIRC_40_OFT  PM_CIRC_35_OFT + PM_CIRC_35_NUM
+#define PM_CIRC_45_OFT  PM_CIRC_40_OFT + PM_CIRC_40_NUM
+#define PM_CIRC_50_OFT  PM_CIRC_45_OFT + PM_CIRC_45_NUM
+#define PM_CIRC_55_OFT  PM_CIRC_50_OFT + PM_CIRC_50_NUM
+#define PM_CIRC_60_OFT  PM_CIRC_55_OFT + PM_CIRC_55_NUM
+#define PM_CIRC_65_OFT  PM_CIRC_60_OFT + PM_CIRC_60_NUM
+#define PM_CIRC_70_OFT  PM_CIRC_65_OFT + PM_CIRC_65_NUM
+
+#define PM_CROSS_10_OFT  PM_CIRC_70_OFT + PM_CIRC_70_NUM
+#define PM_CROSS_15_OFT  PM_CROSS_10_OFT + PM_CROSS_10_NUM
+#define PM_CROSS_20_OFT  PM_CROSS_15_OFT + PM_CROSS_15_NUM
+#define PM_CROSS_25_OFT  PM_CROSS_20_OFT + PM_CROSS_20_NUM
+#define PM_CROSS_30_OFT  PM_CROSS_25_OFT + PM_CROSS_25_NUM
+#define PM_CROSS_35_OFT  PM_CROSS_30_OFT + PM_CROSS_30_NUM
+#define PM_CROSS_40_OFT  PM_CROSS_35_OFT + PM_CROSS_35_NUM
+#define PM_CROSS_45_OFT  PM_CROSS_40_OFT + PM_CROSS_40_NUM
+#define PM_CROSS_50_OFT  PM_CROSS_45_OFT + PM_CROSS_45_NUM
+#define PM_CROSS_55_OFT  PM_CROSS_50_OFT + PM_CROSS_50_NUM
+#define PM_CROSS_60_OFT  PM_CROSS_55_OFT + PM_CROSS_55_NUM
+#define PM_CROSS_65_OFT  PM_CROSS_60_OFT + PM_CROSS_60_NUM
+#define PM_CROSS_70_OFT  PM_CROSS_65_OFT + PM_CROSS_65_NUM
+
+static const PM_FONT_INFO arrPMFontInfo[][TEL_NO_OF_SIZES] =
+{
+  // TOM_POINT - not used
+  { { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 },
+  { 0, 0, 0 } },
+
+  // TOM_PLUS
+  { { 9.f,  9.f, PM_PLUS_10_OFT },
+  { 11.f, 11.f, PM_PLUS_15_OFT },
+  { 13.f, 13.f, PM_PLUS_20_OFT },
+  { 15.f, 15.f, PM_PLUS_25_OFT },
+  { 17.f, 17.f, PM_PLUS_30_OFT },
+  { 19.f, 19.f, PM_PLUS_35_OFT },
+  { 21.f, 21.f, PM_PLUS_40_OFT },
+  { 23.f, 23.f, PM_PLUS_45_OFT },
+  { 25.f, 25.f, PM_PLUS_50_OFT },
+  { 27.f, 27.f, PM_PLUS_55_OFT },
+  { 29.f, 29.f, PM_PLUS_60_OFT },
+  { 31.f, 31.f, PM_PLUS_65_OFT },
+  { 32.f, 32.f, PM_PLUS_70_OFT } },
+
+  // TOM_STAR
+  { { 7.f,  9.f, PM_STAR_10_OFT },
+  { 9.f,  11.f, PM_STAR_15_OFT },
+  { 11.f, 13.f, PM_STAR_20_OFT },
+  { 13.f, 15.f, PM_STAR_25_OFT },
+  { 13.f, 17.f, PM_STAR_30_OFT },
+  { 15.f, 19.f, PM_STAR_35_OFT },
+  { 17.f, 21.f, PM_STAR_40_OFT },
+  { 19.f, 23.f, PM_STAR_45_OFT },
+  { 21.f, 25.f, PM_STAR_50_OFT },
+  { 23.f, 27.f, PM_STAR_55_OFT },
+  { 25.f, 29.f, PM_STAR_60_OFT },
+  { 32.f, 32.f, PM_STAR_65_OFT },
+  { 32.f, 32.f, PM_STAR_70_OFT } },
+
+  // TOM_X
+  { { 7.f,  7.f, PM_CROSS_10_OFT },
+  { 9.f,  9.f, PM_CROSS_15_OFT },
+  { 11.f, 11.f, PM_CROSS_20_OFT },
+  { 13.f, 13.f, PM_CROSS_25_OFT },
+  { 15.f, 15.f, PM_CROSS_30_OFT },
+  { 17.f, 17.f, PM_CROSS_35_OFT },
+  { 19.f, 19.f, PM_CROSS_40_OFT },
+  { 21.f, 21.f, PM_CROSS_45_OFT },
+  { 23.f, 23.f, PM_CROSS_50_OFT },
+  { 25.f, 25.f, PM_CROSS_55_OFT },
+  { 27.f, 27.f, PM_CROSS_60_OFT },
+  { 32.f, 32.f, PM_CROSS_65_OFT },
+  { 32.f, 32.f, PM_CROSS_70_OFT } },
+
+  // TOM_O
+  { { 7.f,  7.f, PM_CIRC_10_OFT },
+  { 9.f,  9.f, PM_CIRC_15_OFT },
+  { 9.f,  9.f, PM_CIRC_20_OFT },
+  { 11.f, 11.f, PM_CIRC_25_OFT },
+  { 13.f, 13.f, PM_CIRC_30_OFT },
+  { 15.f, 15.f, PM_CIRC_35_OFT },
+  { 17.f, 17.f, PM_CIRC_40_OFT },
+  { 19.f, 19.f, PM_CIRC_45_OFT },
+  { 21.f, 21.f, PM_CIRC_50_OFT },
+  { 23.f, 23.f, PM_CIRC_55_OFT },
+  { 25.f, 25.f, PM_CIRC_60_OFT },
+  { 27.f, 27.f, PM_CIRC_65_OFT },
+  { 29.f, 29.f, PM_CIRC_70_OFT } }
+};
+static const Standard_Byte Graphic3d_MarkerImage_myMarkerRaster[] =
+{
+// TYPE = PLUS
+
+0x08,0x00,
+0x08,0x00,
+0x08,0x00,
+0x08,0x00,
+0xff,0x80,
+0x08,0x00,
+0x08,0x00,
+0x08,0x00,
+0x08,0x00, // PLUS 9x9 = 1.0
+
+0x04,0x00,
+0x04,0x00,
+0x04,0x00,
+0x04,0x00,
+0x04,0x00,
+0xff,0xe0,
+0x04,0x00,
+0x04,0x00,
+0x04,0x00,
+0x04,0x00,
+0x04,0x00, // PLUS 11x11 = 1.5
+
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0xff,0xf8,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00, // PLUS 13x13 = 2.0
+
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0xff,0xfe,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00, // PLUS 15x15 = 2.5
+
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0xff,0xff, 0x80,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00, // PLUS 17x17 = 3.0
+
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0xff,0xff, 0xe0,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00, // PLUS 19x19 = 3.5
+
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0xff,0xff, 0xf8,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00, // PLUS 21x21 = 4.0
+
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0xff,0xff, 0xfe,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00, // PLUS 23x23 = 4.5
+
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0xff,0xff, 0xff,0x80,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00, // PLUS 25x25 = 5.0
+
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0xff,0xff, 0xff,0xe0,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x04, 0x00,0x00, // PLUS 27x27 = 5.5
+
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0xff,0xff, 0xff,0xf8,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00,
+0x00,0x02, 0x00,0x00, // PLUS 29x29 = 6.0
+
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0xff,0xff, 0xff,0xfd,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00,
+0x00,0x01, 0x00,0x00, // PLUS 31x31 = 6.5
+
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0xff,0xff, 0xff,0xff,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00, // PLUS 32x32 = 7.0
+
+// TYPE = STAR
+
+0x10,
+0x10,
+0xd6,
+0x38,
+0x10,
+0x38,
+0xd6,
+0x10,
+0x10, // STAR 7x9 = 1.0
+
+0x08,0x00,
+0x08,0x00,
+0x08,0x00,
+0xc9,0x80,
+0x3e,0x00,
+0x08,0x00,
+0x3e,0x00,
+0xc9,0x80,
+0x08,0x00,
+0x08,0x00,
+0x08,0x00, // STAR 9x11 = 1.5
+
+0x04,0x00,
+0x04,0x00,
+0x04,0x00,
+0x84,0x20,
+0x64,0xc0,
+0x1f,0x00,
+0x04,0x00,
+0x1f,0x00,
+0x64,0xc0,
+0x84,0x20,
+0x04,0x00,
+0x04,0x00,
+0x04,0x00, // STAR 11x13 = 2.0
+
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x82,0x18,
+0x62,0x60,
+0x1b,0x80,
+0x06,0x00,
+0x1b,0x80,
+0x62,0x60,
+0x82,0x18,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00, // STAR 13x15 = 2.5
+
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x82,0x08,
+0x62,0x30,
+0x12,0x40,
+0x0f,0x80,
+0x02,0x00,
+0x0f,0x80,
+0x12,0x40,
+0x62,0x30,
+0x82,0x08,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00,
+0x02,0x00, // STAR 13x17 = 3.0
+
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0xc1,0x06,
+0x21,0x18,
+0x19,0x20,
+0x07,0xc0,
+0x01,0x00,
+0x07,0xc0,
+0x19,0x20,
+0x21,0x18,
+0xc1,0x06,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00,
+0x01,0x00, // STAR 15x19 = 3.5
+
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x80,0x80, 0x80,
+0x60,0x83, 0x00,
+0x10,0x8c, 0x00,
+0x0c,0x90, 0x00,
+0x03,0xe0, 0x00,
+0x00,0x80, 0x00,
+0x03,0xe0, 0x00,
+0x0c,0x90, 0x00,
+0x10,0x8c, 0x00,
+0x60,0x83, 0x00,
+0x80,0x80, 0x80,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00,
+0x00,0x80, 0x00, // STAR 17x21 = 4.0
+
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0xc0,0x40, 0x60,
+0x30,0x41, 0x80,
+0x08,0x42, 0x00,
+0x06,0x4c, 0x00,
+0x01,0xf0, 0x00,
+0x00,0x40, 0x00,
+0x01,0xf0, 0x00,
+0x06,0x4c, 0x00,
+0x08,0x42, 0x00,
+0x30,0x41, 0x80,
+0xc0,0x40, 0x60,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00,
+0x00,0x40, 0x00, // STAR 19x23 = 4.5
+
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x80,0x20, 0x08,
+0x60,0x20, 0x30,
+0x18,0x20, 0xc0,
+0x04,0x21, 0x00,
+0x03,0x26, 0x00,
+0x00,0xf8, 0x00,
+0x00,0x20, 0x00,
+0x00,0xf8, 0x00,
+0x03,0x26, 0x00,
+0x04,0x21, 0x00,
+0x18,0x20, 0xc0,
+0x60,0x20, 0x30,
+0x80,0x20, 0x08,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00,
+0x00,0x20, 0x00, // STAR 21x25 = 5.0
+
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0xc0,0x10, 0x06,
+0x30,0x10, 0x18,
+0x08,0x10, 0x60,
+0x06,0x10, 0x80,
+0x01,0x93, 0x00,
+0x00,0x7c, 0x00,
+0x00,0x10, 0x00,
+0x00,0x7c, 0x00,
+0x01,0x93, 0x00,
+0x06,0x10, 0x80,
+0x08,0x10, 0x60,
+0x30,0x10, 0x18,
+0xc0,0x10, 0x06,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00,
+0x00,0x10, 0x00, // STAR 23x27 = 5.5
+
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x80,0x08, 0x00,0x80,
+0x60,0x08, 0x03,0x00,
+0x18,0x08, 0x0c,0x00,
+0x04,0x08, 0x30,0x00,
+0x03,0x08, 0x40,0x00,
+0x00,0xc9, 0x80,0x00,
+0x00,0x3e, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x3e, 0x00,0x00,
+0x00,0xc9, 0x80,0x00,
+0x03,0x08, 0x40,0x00,
+0x04,0x08, 0x30,0x00,
+0x18,0x08, 0x0c,0x00,
+0x60,0x08, 0x03,0x00,
+0x80,0x08, 0x00,0x80,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x08, 0x00,0x00, // STAR 25x29 = 6.0
+
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x30,0x00, 0x80,0x06,
+0x0c,0x00, 0x80,0x18,
+0x03,0x00, 0x80,0x60,
+0x00,0xc0, 0x81,0x80,
+0x00,0x30, 0x86,0x00,
+0x00,0x0c, 0x98,0x00,
+0x00,0x03, 0xe0,0x00,
+0x00,0x03, 0xe0,0x00,
+0x00,0x0c, 0x98,0x00,
+0x00,0x30, 0x86,0x00,
+0x00,0xc0, 0x81,0x80,
+0x03,0x00, 0x80,0x60,
+0x0c,0x00, 0x80,0x18,
+0x30,0x00, 0x80,0x06,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x80,0x00,
+0x00,0x00, 0x00,0x00,
+0x00,0x00, 0x00,0x00, // STAR 32x32 = 6.5
+
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x10, 0x00, 0x80, 0x04,
+0x0c, 0x00, 0x80, 0x18,
+0x02, 0x00, 0x80, 0x20,
+0x01, 0x80, 0x80, 0xc0,
+0x00, 0x40, 0x81, 0x00,
+0x00, 0x30, 0x86, 0x00,
+0x00, 0x08, 0x88, 0x00,
+0x00, 0x06, 0xb0, 0x00,
+0x00, 0x01, 0xc0, 0x00,
+0x00, 0x06, 0xb0, 0x00,
+0x00, 0x08, 0x88, 0x00,
+0x00, 0x30, 0x86, 0x00,
+0x00, 0x40, 0x81, 0x00,
+0x01, 0x80, 0x80, 0xc0,
+0x02, 0x00, 0x80, 0x20,
+0x0c, 0x00, 0x80, 0x18,
+0x10, 0x00, 0x80, 0x04,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00,
+0x00, 0x00, 0x80, 0x00, // STAR 32x32 = 7.0
+
+// TYPE = CIRC
+
+0x38,
+0x44,
+0x82,
+0x82,
+0x82,
+0x44,
+0x38, // CIRC 7x7 = 1.0
+
+0x3c,0x00,
+0x42,0x00,
+0x81,0x00,
+0x81,0x00,
+0x81,0x00,
+0x81,0x00,
+0x42,0x00,
+0x3c,0x00,
+0x00,0x00, //CIRC 9x9 = 1.5
+
+0x3e,0x00,
+0x41,0x00,
+0x81,0x80,
+0x80,0x80,
+0x80,0x80,
+0x80,0x80,
+0x81,0x80,
+0x41,0x00,
+0x3e,0x00, // CIRC 9x9 = 2.0
+
+0x1f,0x00,
+0x20,0x80,
+0x40,0x40,
+0x80,0x20,
+0x80,0x20,
+0x80,0x20,
+0x80,0x20,
+0x80,0x20,
+0x40,0x40,
+0x20,0x80,
+0x1f,0x00, // CIRC 11x11 = 2.5
+
+0x0f,0x80,
+0x10,0x40,
+0x20,0x20,
+0x40,0x10,
+0x80,0x08,
+0x80,0x08,
+0x80,0x08,
+0x80,0x08,
+0x80,0x08,
+0x40,0x10,
+0x20,0x20,
+0x10,0x40,
+0x0f,0x80, // CIRC 13x13 = 3.0
+
+0x07,0xc0,
+0x18,0x30,
+0x20,0x08,
+0x40,0x04,
+0x40,0x04,
+0x80,0x02,
+0x80,0x02,
+0x80,0x02,
+0x80,0x02,
+0x80,0x02,
+0x40,0x04,
+0x40,0x04,
+0x20,0x08,
+0x18,0x30,
+0x07,0xc0, // CIRC 15x15 = 3.5
+
+0x03,0xe0, 0x00,
+0x0c,0x18, 0x00,
+0x10,0x04, 0x00,
+0x20,0x02, 0x00,
+0x40,0x01, 0x00,
+0x40,0x01, 0x00,
+0x80,0x00, 0x80,
+0x80,0x00, 0x80,
+0x80,0x00, 0x80,
+0x80,0x00, 0x80,
+0x80,0x00, 0x80,
+0x40,0x01, 0x00,
+0x40,0x01, 0x00,
+0x20,0x02, 0x00,
+0x10,0x04, 0x00,
+0x0c,0x18, 0x00,
+0x03,0xe0, 0x00, // CIRC 17x17 = 4.0
+
+0x03,0xf8, 0x00,
+0x0e,0x0e, 0x00,
+0x18,0x03, 0x00,
+0x20,0x00, 0x80,
+0x60,0x00, 0xc0,
+0x40,0x00, 0x40,
+0xc0,0x00, 0x60,
+0x80,0x00, 0x20,
+0x80,0x00, 0x20,
+0x80,0x00, 0x20,
+0x80,0x00, 0x20,
+0x80,0x00, 0x20,
+0xc0,0x00, 0x60,
+0x40,0x00, 0x40,
+0x60,0x00, 0xc0,
+0x20,0x00, 0x80,
+0x18,0x03, 0x00,
+0x0e,0x0e, 0x00,
+0x03,0xf8, 0x00, // CIRC 19x19 = 4.5
+
+0x01,0xfc, 0x00,
+0x06,0x03, 0x00,
+0x08,0x00, 0x80,
+0x10,0x00, 0x40,
+0x20,0x00, 0x20,
+0x40,0x00, 0x10,
+0x40,0x00, 0x10,
+0x80,0x00, 0x08,
+0x80,0x00, 0x08,
+0x80,0x00, 0x08,
+0x80,0x00, 0x08,
+0x80,0x00, 0x08,
+0x80,0x00, 0x08,
+0x80,0x00, 0x08,
+0x40,0x00, 0x10,
+0x40,0x00, 0x10,
+0x20,0x00, 0x20,
+0x10,0x00, 0x40,
+0x08,0x00, 0x80,
+0x06,0x03, 0x00,
+0x01,0xfc, 0x00, // CIRC 21x21 = 5.0
+
+0x00,0xfe, 0x00,
+0x03,0x01, 0x80,
+0x0c,0x00, 0x60,
+0x18,0x00, 0x30,
+0x30,0x00, 0x18,
+0x20,0x00, 0x08,
+0x40,0x00, 0x04,
+0x40,0x00, 0x04,
+0x80,0x00, 0x02,
+0x80,0x00, 0x02,
+0x80,0x00, 0x02,
+0x80,0x00, 0x02,
+0x80,0x00, 0x02,
+0x80,0x00, 0x02,
+0x80,0x00, 0x02,
+0x40,0x00, 0x04,
+0x40,0x00, 0x04,
+0x20,0x00, 0x08,
+0x30,0x00, 0x18,
+0x18,0x00, 0x30,
+0x0c,0x00, 0x60,
+0x03,0x01, 0x80,
+0x00,0xfe, 0x00, // CIRC 23x23 = 5.5
+
+0x00,0x7f, 0x00,0x00,
+0x01,0x80, 0xc0,0x00,
+0x06,0x00, 0x30,0x00,
+0x08,0x00, 0x08,0x00,
+0x10,0x00, 0x04,0x00,
+0x20,0x00, 0x02,0x00,
+0x20,0x00, 0x02,0x00,
+0x40,0x00, 0x01,0x00,
+0x40,0x00, 0x01,0x00,
+0x80,0x00, 0x00,0x80,
+0x80,0x00, 0x00,0x80,
+0x80,0x00, 0x00,0x80,
+0x80,0x00, 0x00,0x80,
+0x80,0x00, 0x00,0x80,
+0x80,0x00, 0x00,0x80,
+0x80,0x00, 0x00,0x80,
+0x40,0x00, 0x01,0x00,
+0x40,0x00, 0x01,0x00,
+0x20,0x00, 0x02,0x00,
+0x20,0x00, 0x02,0x00,
+0x10,0x00, 0x04,0x00,
+0x08,0x00, 0x08,0x00,
+0x06,0x00, 0x30,0x00,
+0x01,0x80, 0xc0,0x00,
+0x00,0x7f, 0x00,0x00, // CIRC 25x25 = 6.0
+
+0x00,0x3f, 0x80,0x00,
+0x01,0xc0, 0x70,0x00,
+0x03,0x00, 0x18,0x00,
+0x0c,0x00, 0x06,0x00,
+0x18,0x00, 0x03,0x00,
+0x10,0x00, 0x01,0x00,
+0x20,0x00, 0x00,0x80,
+0x60,0x00, 0x00,0xc0,
+0x40,0x00, 0x00,0x40,
+0x40,0x00, 0x00,0x40,
+0x80,0x00, 0x00,0x20,
+0x80,0x00, 0x00,0x20,
+0x80,0x00, 0x00,0x20,
+0x80,0x00, 0x00,0x20,
+0x80,0x00, 0x00,0x20,
+0x80,0x00, 0x00,0x20,
+0x80,0x00, 0x00,0x20,
+0x40,0x00, 0x00,0x40,
+0x40,0x00, 0x00,0x40,
+0x60,0x00, 0x00,0xc0,
+0x20,0x00, 0x00,0x80,
+0x10,0x00, 0x01,0x00,
+0x18,0x00, 0x03,0x00,
+0x0c,0x00, 0x06,0x00,
+0x03,0x00, 0x18,0x00,
+0x01,0xc0, 0x70,0x00,
+0x00,0x3f, 0x80,0x00, // CIRC 27x27 = 6.5
+
+0x00,0x1f, 0xc0,0x00,
+0x00,0xe0, 0x38,0x00,
+0x01,0x00, 0x04,0x00,
+0x06,0x00, 0x03,0x00,
+0x08,0x00, 0x00,0x80,
+0x10,0x00, 0x00,0x40,
+0x10,0x00, 0x00,0x40,
+0x20,0x00, 0x00,0x20,
+0x40,0x00, 0x00,0x10,
+0x40,0x00, 0x00,0x10,
+0x40,0x00, 0x00,0x10,
+0x80,0x00, 0x00,0x08,
+0x80,0x00, 0x00,0x08,
+0x80,0x00, 0x00,0x08,
+0x80,0x00, 0x00,0x08,
+0x80,0x00, 0x00,0x08,
+0x80,0x00, 0x00,0x08,
+0x80,0x00, 0x00,0x08,
+0x40,0x00, 0x00,0x10,
+0x40,0x00, 0x00,0x10,
+0x40,0x00, 0x00,0x10,
+0x20,0x00, 0x00,0x20,
+0x10,0x00, 0x00,0x40,
+0x10,0x00, 0x00,0x40,
+0x08,0x00, 0x00,0x80,
+0x06,0x00, 0x03,0x00,
+0x01,0x00, 0x04,0x00,
+0x00,0xe0, 0x38,0x00,
+0x00,0x1f, 0xc0,0x00, // CIRC 29x29 = 7.0
+
+// TYPE = CROSS
+
+0x82,
+0x44,
+0x28,
+0x10,
+0x28,
+0x44,
+0x82, // CROSS 7x7 = 1.0
+
+0x80,0x80,
+0x41,0x00,
+0x22,0x00,
+0x14,0x00,
+0x08,0x00,
+0x14,0x00,
+0x22,0x00,
+0x41,0x00,
+0x80,0x80, // CROSS 9x9 = 1.5
+
+0x80,0x20,
+0x40,0x40,
+0x20,0x80,
+0x11,0x00,
+0x0a,0x00,
+0x04,0x00,
+0x0a,0x00,
+0x11,0x00,
+0x20,0x80,
+0x40,0x40,
+0x80,0x20, // CROSS 11x11 = 2.0
+
+0x80,0x08,
+0x40,0x10,
+0x20,0x20,
+0x10,0x40,
+0x08,0x80,
+0x05,0x00,
+0x02,0x00,
+0x05,0x00,
+0x08,0x80,
+0x10,0x40,
+0x20,0x20,
+0x40,0x10,
+0x80,0x08, // CROSS 13x13 = 2.5
+
+0x80,0x02,
+0x40,0x04,
+0x20,0x08,
+0x10,0x10,
+0x08,0x20,
+0x04,0x40,
+0x02,0x80,
+0x01,0x00,
+0x02,0x80,
+0x04,0x40,
+0x08,0x20,
+0x10,0x10,
+0x20,0x08,
+0x40,0x04,
+0x80,0x02, // CROSS 15x15 = 3.0
+
+0x80,0x00, 0x80,
+0x40,0x01, 0x00,
+0x20,0x02, 0x00,
+0x10,0x04, 0x00,
+0x08,0x08, 0x00,
+0x04,0x10, 0x00,
+0x02,0x20, 0x00,
+0x01,0x40, 0x00,
+0x00,0x80, 0x00,
+0x01,0x40, 0x00,
+0x02,0x20, 0x00,
+0x04,0x10, 0x00,
+0x08,0x08, 0x00,
+0x10,0x04, 0x00,
+0x20,0x02, 0x00,
+0x40,0x01, 0x00,
+0x80,0x00, 0x80, // CROSS 17x17 = 3.5
+
+0x80,0x00, 0x20,
+0x40,0x00, 0x40,
+0x20,0x00, 0x80,
+0x10,0x01, 0x00,
+0x08,0x02, 0x00,
+0x04,0x04, 0x00,
+0x02,0x08, 0x00,
+0x01,0x10, 0x00,
+0x00,0xa0, 0x00,
+0x00,0x40, 0x00,
+0x00,0xa0, 0x00,
+0x01,0x10, 0x00,
+0x02,0x08, 0x00,
+0x04,0x04, 0x00,
+0x08,0x02, 0x00,
+0x10,0x01, 0x00,
+0x20,0x00, 0x80,
+0x40,0x00, 0x40,
+0x80,0x00, 0x20, // CROSS 19x19 = 4.0
+
+0x80,0x00, 0x08,
+0x40,0x00, 0x10,
+0x20,0x00, 0x20,
+0x10,0x00, 0x40,
+0x08,0x00, 0x80,
+0x04,0x01, 0x00,
+0x02,0x02, 0x00,
+0x01,0x04, 0x00,
+0x00,0x88, 0x00,
+0x00,0x50, 0x00,
+0x00,0x20, 0x00,
+0x00,0x50, 0x00,
+0x00,0x88, 0x00,
+0x01,0x04, 0x00,
+0x02,0x02, 0x00,
+0x04,0x01, 0x00,
+0x08,0x00, 0x80,
+0x10,0x00, 0x40,
+0x20,0x00, 0x20,
+0x40,0x00, 0x10,
+0x80,0x00, 0x08, // CROSS 21x21 = 4.5
+
+0x80,0x00, 0x02,
+0x40,0x00, 0x04,
+0x20,0x00, 0x08,
+0x10,0x00, 0x10,
+0x08,0x00, 0x20,
+0x04,0x00, 0x40,
+0x02,0x00, 0x80,
+0x01,0x01, 0x00,
+0x00,0x82, 0x00,
+0x00,0x44, 0x00,
+0x00,0x28, 0x00,
+0x00,0x10, 0x00,
+0x00,0x28, 0x00,
+0x00,0x44, 0x00,
+0x00,0x82, 0x00,
+0x01,0x01, 0x00,
+0x02,0x00, 0x80,
+0x04,0x00, 0x40,
+0x08,0x00, 0x20,
+0x10,0x00, 0x10,
+0x20,0x00, 0x08,
+0x40,0x00, 0x04,
+0x80,0x00, 0x02, // CROSS 23x23 = 5.0
+
+0x80,0x00, 0x00,0x80,
+0x40,0x00, 0x01,0x00,
+0x20,0x00, 0x02,0x00,
+0x10,0x00, 0x04,0x00,
+0x08,0x00, 0x08,0x00,
+0x04,0x00, 0x10,0x00,
+0x02,0x00, 0x20,0x00,
+0x01,0x00, 0x40,0x00,
+0x00,0x80, 0x80,0x00,
+0x00,0x41, 0x00,0x00,
+0x00,0x22, 0x00,0x00,
+0x00,0x14, 0x00,0x00,
+0x00,0x08, 0x00,0x00,
+0x00,0x14, 0x00,0x00,
+0x00,0x22, 0x00,0x00,
+0x00,0x41, 0x00,0x00,
+0x00,0x80, 0x80,0x00,
+0x01,0x00, 0x40,0x00,
+0x02,0x00, 0x20,0x00,
+0x04,0x00, 0x10,0x00,
+0x08,0x00, 0x08,0x00,
+0x10,0x00, 0x04,0x00,
+0x20,0x00, 0x02,0x00,
+0x40,0x00, 0x01,0x00,
+0x80,0x00, 0x00,0x80, // CROSS 25x25 = 5.5
+
+0x80,0x00, 0x00,0x20,
+0x40,0x00, 0x00,0x40,
+0x20,0x00, 0x00,0x80,
+0x10,0x00, 0x01,0x00,
+0x08,0x00, 0x02,0x00,
+0x04,0x00, 0x04,0x00,
+0x02,0x00, 0x08,0x00,
+0x01,0x00, 0x10,0x00,
+0x00,0x80, 0x20,0x00,
+0x00,0x40, 0x40,0x00,
+0x00,0x20, 0x80,0x00,
+0x00,0x11, 0x00,0x00,
+0x00,0x0a, 0x00,0x00,
+0x00,0x04, 0x00,0x00,
+0x00,0x0a, 0x00,0x00,
+0x00,0x11, 0x00,0x00,
+0x00,0x20, 0x80,0x00,
+0x00,0x40, 0x40,0x00,
+0x00,0x80, 0x20,0x00,
+0x01,0x00, 0x10,0x00,
+0x02,0x00, 0x08,0x00,
+0x04,0x00, 0x04,0x00,
+0x08,0x00, 0x02,0x00,
+0x10,0x00, 0x01,0x00,
+0x20,0x00, 0x00,0x80,
+0x40,0x00, 0x00,0x40,
+0x80,0x00, 0x00,0x20, // CROSS 27x27 = 6.0
+
+0x00,0x00, 0x00,0x00,
+0x00,0x00, 0x00,0x00,
+0x20,0x00, 0x00,0x04,
+0x10,0x00, 0x00,0x08,
+0x08,0x00, 0x00,0x10,
+0x04,0x00, 0x00,0x20,
+0x02,0x00, 0x00,0x40,
+0x01,0x00, 0x00,0x80,
+0x00,0x80, 0x01,0x00,
+0x00,0x40, 0x02,0x00,
+0x00,0x20, 0x04,0x00,
+0x00,0x10, 0x08,0x00,
+0x00,0x08, 0x10,0x00,
+0x00,0x04, 0x20,0x00,
+0x00,0x02, 0x40,0x00,
+0x00,0x01, 0x80,0x00,
+0x00,0x01, 0x80,0x00,
+0x00,0x02, 0x40,0x00,
+0x00,0x04, 0x20,0x00,
+0x00,0x08, 0x10,0x00,
+0x00,0x10, 0x08,0x00,
+0x00,0x20, 0x04,0x00,
+0x00,0x40, 0x02,0x00,
+0x00,0x80, 0x01,0x00,
+0x01,0x00, 0x00,0x80,
+0x02,0x00, 0x00,0x40,
+0x04,0x00, 0x00,0x20,
+0x08,0x00, 0x00,0x10,
+0x10,0x00, 0x00,0x08,
+0x20,0x00, 0x00,0x04,
+0x00,0x00, 0x00,0x00,
+0x00,0x00, 0x00,0x00, // CROSS 32x32 = 6.5
+
+0x00,0x00, 0x00,0x00,
+0x40,0x00, 0x00,0x02,
+0x20,0x00, 0x00,0x04,
+0x10,0x00, 0x00,0x08,
+0x08,0x00, 0x00,0x10,
+0x04,0x00, 0x00,0x20,
+0x02,0x00, 0x00,0x40,
+0x01,0x00, 0x00,0x80,
+0x00,0x80, 0x01,0x00,
+0x00,0x40, 0x02,0x00,
+0x00,0x20, 0x04,0x00,
+0x00,0x10, 0x08,0x00,
+0x00,0x08, 0x10,0x00,
+0x00,0x04, 0x20,0x00,
+0x00,0x02, 0x40,0x00,
+0x00,0x01, 0x80,0x00,
+0x00,0x01, 0x80,0x00,
+0x00,0x02, 0x40,0x00,
+0x00,0x04, 0x20,0x00,
+0x00,0x08, 0x10,0x00,
+0x00,0x10, 0x08,0x00,
+0x00,0x20, 0x04,0x00,
+0x00,0x40, 0x02,0x00,
+0x00,0x80, 0x01,0x00,
+0x01,0x00, 0x00,0x80,
+0x02,0x00, 0x00,0x40,
+0x04,0x00, 0x00,0x20,
+0x08,0x00, 0x00,0x10,
+0x10,0x00, 0x00,0x08,
+0x20,0x00, 0x00,0x04,
+0x40,0x00, 0x00,0x02,
+0x00,0x00, 0x00,0x00  // CROSS 32x32 = 7.0
+};
+}
index 6d9f002..8358edf 100644 (file)
@@ -662,3 +662,36 @@ void Image_PixMap::ToBlackWhite (Image_PixMap& theImage)
     }
   }
 }
+
+// =======================================================================
+// function : InitCopy
+// purpose  :
+// =======================================================================
+bool Image_PixMap::FlipY (Image_PixMap& theImage)
+{
+  if (theImage.IsEmpty()
+   || theImage.SizeX() == 0
+   || theImage.SizeY() == 0)
+  {
+    return false;
+  }
+
+  NCollection_Buffer aTmp (NCollection_BaseAllocator::CommonBaseAllocator());
+  const size_t aRowSize = theImage.SizeRowBytes();
+  if (!aTmp.Allocate (aRowSize))
+  {
+    return false;
+  }
+
+  // for odd height middle row should be left as is
+  Standard_Size aNbRowsHalf = theImage.SizeY() / 2;
+  for (Standard_Size aRowT = 0, aRowB = theImage.SizeY() - 1; aRowT < aNbRowsHalf; ++aRowT, --aRowB)
+  {
+    Standard_Byte* aTop = theImage.ChangeRow (aRowT);
+    Standard_Byte* aBot = theImage.ChangeRow (aRowB);
+    memcpy (aTmp.ChangeData(), aTop, aRowSize);
+    memcpy (aTop, aBot, aRowSize);
+    memcpy (aBot, aTmp.Data(), aRowSize);
+  }
+  return true;
+}
index c7775e5..1543a45 100644 (file)
@@ -48,6 +48,9 @@ public:
   //! Convert image to Black/White.
   Standard_EXPORT static void ToBlackWhite (Image_PixMap& theImage);
 
+  //! Reverse line order as it draws it from bottom to top.
+  Standard_EXPORT static bool FlipY (Image_PixMap& theImage);
+
   //! Return default image data allocator.
   Standard_EXPORT static const Handle(NCollection_BaseAllocator)& DefaultAllocator();
 
index abaa6db..b239917 100644 (file)
 namespace
 {
   static const TCollection_AsciiString THE_EMPTY_KEY;
-
-  //! Draw inner point as filled rectangle
-  static Handle(TColStd_HArray1OfByte) fillPointBitmap (const Standard_Integer theSize)
-  {
-    // draw inner point as filled rectangle
-    const Standard_Integer        aNumOfBytes = (theSize / 8 + (theSize % 8 ? 1 : 0)) * theSize;
-    Handle(TColStd_HArray1OfByte) aBitMap     = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
-    for (Standard_Integer anIter = 0; anIter < aBitMap->Length(); ++anIter)
-    {
-      aBitMap->SetValue (anIter, 255);
-    }
-    return aBitMap;
-  }
-}
-
-// Following Section relates to default markers
-
-#define TEL_NO_OF_SIZES 13
-#define TEL_PM_START_SIZE 1.0
-#define TEL_PM_END_SIZE   7.0
-
-struct PM_FONT_INFO
-{
-  float width, height;
-  int   offset;
-};
-typedef PM_FONT_INFO* pm_font_info;
-
-#define PM_PLUS_10_NUM  9*2
-#define PM_PLUS_15_NUM  11*2
-#define PM_PLUS_20_NUM  13*2
-#define PM_PLUS_25_NUM  15*2
-#define PM_PLUS_30_NUM  17*3
-#define PM_PLUS_35_NUM  19*3
-#define PM_PLUS_40_NUM  21*3
-#define PM_PLUS_45_NUM  23*3
-#define PM_PLUS_50_NUM  25*4
-#define PM_PLUS_55_NUM  27*4
-#define PM_PLUS_60_NUM  29*4
-#define PM_PLUS_65_NUM  31*4
-#define PM_PLUS_70_NUM  32*4
-
-#define PM_STAR_10_NUM  9
-#define PM_STAR_15_NUM  11*2
-#define PM_STAR_20_NUM  13*2
-#define PM_STAR_25_NUM  15*2
-#define PM_STAR_30_NUM  17*2
-#define PM_STAR_35_NUM  19*2
-#define PM_STAR_40_NUM  21*3
-#define PM_STAR_45_NUM  23*3
-#define PM_STAR_50_NUM  25*3
-#define PM_STAR_55_NUM  27*3
-#define PM_STAR_60_NUM  29*4
-#define PM_STAR_65_NUM  32*4
-#define PM_STAR_70_NUM  32*4
-
-#define PM_CIRC_10_NUM  7
-#define PM_CIRC_15_NUM  9*2
-#define PM_CIRC_20_NUM  9*2
-#define PM_CIRC_25_NUM  11*2
-#define PM_CIRC_30_NUM  13*2
-#define PM_CIRC_35_NUM  15*2
-#define PM_CIRC_40_NUM  17*3
-#define PM_CIRC_45_NUM  19*3
-#define PM_CIRC_50_NUM  21*3
-#define PM_CIRC_55_NUM  23*3
-#define PM_CIRC_60_NUM  25*4
-#define PM_CIRC_65_NUM  27*4
-#define PM_CIRC_70_NUM  29*4
-
-#define PM_CROSS_10_NUM 7
-#define PM_CROSS_15_NUM 9*2
-#define PM_CROSS_20_NUM 11*2
-#define PM_CROSS_25_NUM 13*2
-#define PM_CROSS_30_NUM 15*2
-#define PM_CROSS_35_NUM 17*3
-#define PM_CROSS_40_NUM 19*3
-#define PM_CROSS_45_NUM 21*3
-#define PM_CROSS_50_NUM 23*3
-#define PM_CROSS_55_NUM 25*4
-#define PM_CROSS_60_NUM 27*4
-#define PM_CROSS_65_NUM 32*4
-#define PM_CROSS_70_NUM 32*4
-
-#define PM_PLUS_10_OFT  0
-#define PM_PLUS_15_OFT  PM_PLUS_10_OFT + PM_PLUS_10_NUM
-#define PM_PLUS_20_OFT  PM_PLUS_15_OFT + PM_PLUS_15_NUM
-#define PM_PLUS_25_OFT  PM_PLUS_20_OFT + PM_PLUS_20_NUM
-#define PM_PLUS_30_OFT  PM_PLUS_25_OFT + PM_PLUS_25_NUM
-#define PM_PLUS_35_OFT  PM_PLUS_30_OFT + PM_PLUS_30_NUM
-#define PM_PLUS_40_OFT  PM_PLUS_35_OFT + PM_PLUS_35_NUM
-#define PM_PLUS_45_OFT  PM_PLUS_40_OFT + PM_PLUS_40_NUM
-#define PM_PLUS_50_OFT  PM_PLUS_45_OFT + PM_PLUS_45_NUM
-#define PM_PLUS_55_OFT  PM_PLUS_50_OFT + PM_PLUS_50_NUM
-#define PM_PLUS_60_OFT  PM_PLUS_55_OFT + PM_PLUS_55_NUM
-#define PM_PLUS_65_OFT  PM_PLUS_60_OFT + PM_PLUS_60_NUM
-#define PM_PLUS_70_OFT  PM_PLUS_65_OFT + PM_PLUS_65_NUM
-
-#define PM_STAR_10_OFT  PM_PLUS_70_OFT + PM_PLUS_70_NUM
-#define PM_STAR_15_OFT  PM_STAR_10_OFT + PM_STAR_10_NUM
-#define PM_STAR_20_OFT  PM_STAR_15_OFT + PM_STAR_15_NUM
-#define PM_STAR_25_OFT  PM_STAR_20_OFT + PM_STAR_20_NUM
-#define PM_STAR_30_OFT  PM_STAR_25_OFT + PM_STAR_25_NUM
-#define PM_STAR_35_OFT  PM_STAR_30_OFT + PM_STAR_30_NUM
-#define PM_STAR_40_OFT  PM_STAR_35_OFT + PM_STAR_35_NUM
-#define PM_STAR_45_OFT  PM_STAR_40_OFT + PM_STAR_40_NUM
-#define PM_STAR_50_OFT  PM_STAR_45_OFT + PM_STAR_45_NUM
-#define PM_STAR_55_OFT  PM_STAR_50_OFT + PM_STAR_50_NUM
-#define PM_STAR_60_OFT  PM_STAR_55_OFT + PM_STAR_55_NUM
-#define PM_STAR_65_OFT  PM_STAR_60_OFT + PM_STAR_60_NUM
-#define PM_STAR_70_OFT  PM_STAR_65_OFT + PM_STAR_65_NUM
-
-#define PM_CIRC_10_OFT  PM_STAR_70_OFT + PM_STAR_70_NUM
-#define PM_CIRC_15_OFT  PM_CIRC_10_OFT + PM_CIRC_10_NUM
-#define PM_CIRC_20_OFT  PM_CIRC_15_OFT + PM_CIRC_15_NUM
-#define PM_CIRC_25_OFT  PM_CIRC_20_OFT + PM_CIRC_20_NUM
-#define PM_CIRC_30_OFT  PM_CIRC_25_OFT + PM_CIRC_25_NUM
-#define PM_CIRC_35_OFT  PM_CIRC_30_OFT + PM_CIRC_30_NUM
-#define PM_CIRC_40_OFT  PM_CIRC_35_OFT + PM_CIRC_35_NUM
-#define PM_CIRC_45_OFT  PM_CIRC_40_OFT + PM_CIRC_40_NUM
-#define PM_CIRC_50_OFT  PM_CIRC_45_OFT + PM_CIRC_45_NUM
-#define PM_CIRC_55_OFT  PM_CIRC_50_OFT + PM_CIRC_50_NUM
-#define PM_CIRC_60_OFT  PM_CIRC_55_OFT + PM_CIRC_55_NUM
-#define PM_CIRC_65_OFT  PM_CIRC_60_OFT + PM_CIRC_60_NUM
-#define PM_CIRC_70_OFT  PM_CIRC_65_OFT + PM_CIRC_65_NUM
-
-#define PM_CROSS_10_OFT  PM_CIRC_70_OFT + PM_CIRC_70_NUM
-#define PM_CROSS_15_OFT  PM_CROSS_10_OFT + PM_CROSS_10_NUM
-#define PM_CROSS_20_OFT  PM_CROSS_15_OFT + PM_CROSS_15_NUM
-#define PM_CROSS_25_OFT  PM_CROSS_20_OFT + PM_CROSS_20_NUM
-#define PM_CROSS_30_OFT  PM_CROSS_25_OFT + PM_CROSS_25_NUM
-#define PM_CROSS_35_OFT  PM_CROSS_30_OFT + PM_CROSS_30_NUM
-#define PM_CROSS_40_OFT  PM_CROSS_35_OFT + PM_CROSS_35_NUM
-#define PM_CROSS_45_OFT  PM_CROSS_40_OFT + PM_CROSS_40_NUM
-#define PM_CROSS_50_OFT  PM_CROSS_45_OFT + PM_CROSS_45_NUM
-#define PM_CROSS_55_OFT  PM_CROSS_50_OFT + PM_CROSS_50_NUM
-#define PM_CROSS_60_OFT  PM_CROSS_55_OFT + PM_CROSS_55_NUM
-#define PM_CROSS_65_OFT  PM_CROSS_60_OFT + PM_CROSS_60_NUM
-#define PM_CROSS_70_OFT  PM_CROSS_65_OFT + PM_CROSS_65_NUM
-
-static const PM_FONT_INFO arrPMFontInfo[][TEL_NO_OF_SIZES] =
-{
- // TOM_POINT - not used
- {{0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0},
-  {0, 0, 0}},
-
- // TOM_PLUS
- {{ 9.f,  9.f, PM_PLUS_10_OFT},
-  {11.f, 11.f, PM_PLUS_15_OFT},
-  {13.f, 13.f, PM_PLUS_20_OFT},
-  {15.f, 15.f, PM_PLUS_25_OFT},
-  {17.f, 17.f, PM_PLUS_30_OFT},
-  {19.f, 19.f, PM_PLUS_35_OFT},
-  {21.f, 21.f, PM_PLUS_40_OFT},
-  {23.f, 23.f, PM_PLUS_45_OFT},
-  {25.f, 25.f, PM_PLUS_50_OFT},
-  {27.f, 27.f, PM_PLUS_55_OFT},
-  {29.f, 29.f, PM_PLUS_60_OFT},
-  {31.f, 31.f, PM_PLUS_65_OFT},
-  {32.f, 32.f, PM_PLUS_70_OFT}},
-
- // TOM_STAR
- {{ 7.f,  9.f, PM_STAR_10_OFT},
-  {9.f,  11.f, PM_STAR_15_OFT},
-  {11.f, 13.f, PM_STAR_20_OFT},
-  {13.f, 15.f, PM_STAR_25_OFT},
-  {13.f, 17.f, PM_STAR_30_OFT},
-  {15.f, 19.f, PM_STAR_35_OFT},
-  {17.f, 21.f, PM_STAR_40_OFT},
-  {19.f, 23.f, PM_STAR_45_OFT},
-  {21.f, 25.f, PM_STAR_50_OFT},
-  {23.f, 27.f, PM_STAR_55_OFT},
-  {25.f, 29.f, PM_STAR_60_OFT},
-  {32.f, 32.f, PM_STAR_65_OFT},
-  {32.f, 32.f, PM_STAR_70_OFT}},
-
- // TOM_X
- {{ 7.f,  7.f, PM_CROSS_10_OFT},
-  { 9.f,  9.f, PM_CROSS_15_OFT},
-  {11.f, 11.f, PM_CROSS_20_OFT},
-  {13.f, 13.f, PM_CROSS_25_OFT},
-  {15.f, 15.f, PM_CROSS_30_OFT},
-  {17.f, 17.f, PM_CROSS_35_OFT},
-  {19.f, 19.f, PM_CROSS_40_OFT},
-  {21.f, 21.f, PM_CROSS_45_OFT},
-  {23.f, 23.f, PM_CROSS_50_OFT},
-  {25.f, 25.f, PM_CROSS_55_OFT},
-  {27.f, 27.f, PM_CROSS_60_OFT},
-  {32.f, 32.f, PM_CROSS_65_OFT},
-  {32.f, 32.f, PM_CROSS_70_OFT}},
-
- // TOM_O
- {{ 7.f,  7.f, PM_CIRC_10_OFT},
-  { 9.f,  9.f, PM_CIRC_15_OFT},
-  { 9.f,  9.f, PM_CIRC_20_OFT},
-  {11.f, 11.f, PM_CIRC_25_OFT},
-  {13.f, 13.f, PM_CIRC_30_OFT},
-  {15.f, 15.f, PM_CIRC_35_OFT},
-  {17.f, 17.f, PM_CIRC_40_OFT},
-  {19.f, 19.f, PM_CIRC_45_OFT},
-  {21.f, 21.f, PM_CIRC_50_OFT},
-  {23.f, 23.f, PM_CIRC_55_OFT},
-  {25.f, 25.f, PM_CIRC_60_OFT},
-  {27.f, 27.f, PM_CIRC_65_OFT},
-  {29.f, 29.f, PM_CIRC_70_OFT}}
-};
-
-static const Standard_Byte OpenGl_AspectMarker_myMarkerRaster[] =
-{
-    // TYPE = PLUS
-
-    0x08,0x00,
-    0x08,0x00,
-    0x08,0x00,
-    0x08,0x00,
-    0xff,0x80,
-    0x08,0x00,
-    0x08,0x00,
-    0x08,0x00,
-    0x08,0x00, // PLUS 9x9 = 1.0
-
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00,
-    0xff,0xe0,
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00, // PLUS 11x11 = 1.5
-
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0xff,0xf8,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00, // PLUS 13x13 = 2.0
-
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0xff,0xfe,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00, // PLUS 15x15 = 2.5
-
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0xff,0xff, 0x80,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00, // PLUS 17x17 = 3.0
-
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0xff,0xff, 0xe0,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00, // PLUS 19x19 = 3.5
-
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0xff,0xff, 0xf8,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00, // PLUS 21x21 = 4.0
-
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0xff,0xff, 0xfe,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00, // PLUS 23x23 = 4.5
-
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0xff,0xff, 0xff,0x80,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00, // PLUS 25x25 = 5.0
-
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0xff,0xff, 0xff,0xe0,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x04, 0x00,0x00, // PLUS 27x27 = 5.5
-
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0xff,0xff, 0xff,0xf8,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00,
-    0x00,0x02, 0x00,0x00, // PLUS 29x29 = 6.0
-
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0xff,0xff, 0xff,0xfd,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00,
-    0x00,0x01, 0x00,0x00, // PLUS 31x31 = 6.5
-
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0xff,0xff, 0xff,0xff,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00, // PLUS 32x32 = 7.0
-
-    // TYPE = STAR
-
-    0x10,
-    0x10,
-    0xd6,
-    0x38,
-    0x10,
-    0x38,
-    0xd6,
-    0x10,
-    0x10, // STAR 7x9 = 1.0
-
-    0x08,0x00,
-    0x08,0x00,
-    0x08,0x00,
-    0xc9,0x80,
-    0x3e,0x00,
-    0x08,0x00,
-    0x3e,0x00,
-    0xc9,0x80,
-    0x08,0x00,
-    0x08,0x00,
-    0x08,0x00, // STAR 9x11 = 1.5
-
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00,
-    0x84,0x20,
-    0x64,0xc0,
-    0x1f,0x00,
-    0x04,0x00,
-    0x1f,0x00,
-    0x64,0xc0,
-    0x84,0x20,
-    0x04,0x00,
-    0x04,0x00,
-    0x04,0x00, // STAR 11x13 = 2.0
-
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x82,0x18,
-    0x62,0x60,
-    0x1b,0x80,
-    0x06,0x00,
-    0x1b,0x80,
-    0x62,0x60,
-    0x82,0x18,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00, // STAR 13x15 = 2.5
-
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x82,0x08,
-    0x62,0x30,
-    0x12,0x40,
-    0x0f,0x80,
-    0x02,0x00,
-    0x0f,0x80,
-    0x12,0x40,
-    0x62,0x30,
-    0x82,0x08,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00,
-    0x02,0x00, // STAR 13x17 = 3.0
-
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0xc1,0x06,
-    0x21,0x18,
-    0x19,0x20,
-    0x07,0xc0,
-    0x01,0x00,
-    0x07,0xc0,
-    0x19,0x20,
-    0x21,0x18,
-    0xc1,0x06,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00,
-    0x01,0x00, // STAR 15x19 = 3.5
-
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x80,0x80, 0x80,
-    0x60,0x83, 0x00,
-    0x10,0x8c, 0x00,
-    0x0c,0x90, 0x00,
-    0x03,0xe0, 0x00,
-    0x00,0x80, 0x00,
-    0x03,0xe0, 0x00,
-    0x0c,0x90, 0x00,
-    0x10,0x8c, 0x00,
-    0x60,0x83, 0x00,
-    0x80,0x80, 0x80,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00,
-    0x00,0x80, 0x00, // STAR 17x21 = 4.0
-
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0xc0,0x40, 0x60,
-    0x30,0x41, 0x80,
-    0x08,0x42, 0x00,
-    0x06,0x4c, 0x00,
-    0x01,0xf0, 0x00,
-    0x00,0x40, 0x00,
-    0x01,0xf0, 0x00,
-    0x06,0x4c, 0x00,
-    0x08,0x42, 0x00,
-    0x30,0x41, 0x80,
-    0xc0,0x40, 0x60,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0x40, 0x00, // STAR 19x23 = 4.5
-
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x80,0x20, 0x08,
-    0x60,0x20, 0x30,
-    0x18,0x20, 0xc0,
-    0x04,0x21, 0x00,
-    0x03,0x26, 0x00,
-    0x00,0xf8, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0xf8, 0x00,
-    0x03,0x26, 0x00,
-    0x04,0x21, 0x00,
-    0x18,0x20, 0xc0,
-    0x60,0x20, 0x30,
-    0x80,0x20, 0x08,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x20, 0x00, // STAR 21x25 = 5.0
-
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0xc0,0x10, 0x06,
-    0x30,0x10, 0x18,
-    0x08,0x10, 0x60,
-    0x06,0x10, 0x80,
-    0x01,0x93, 0x00,
-    0x00,0x7c, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x7c, 0x00,
-    0x01,0x93, 0x00,
-    0x06,0x10, 0x80,
-    0x08,0x10, 0x60,
-    0x30,0x10, 0x18,
-    0xc0,0x10, 0x06,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x10, 0x00, // STAR 23x27 = 5.5
-
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x80,0x08, 0x00,0x80,
-    0x60,0x08, 0x03,0x00,
-    0x18,0x08, 0x0c,0x00,
-    0x04,0x08, 0x30,0x00,
-    0x03,0x08, 0x40,0x00,
-    0x00,0xc9, 0x80,0x00,
-    0x00,0x3e, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x3e, 0x00,0x00,
-    0x00,0xc9, 0x80,0x00,
-    0x03,0x08, 0x40,0x00,
-    0x04,0x08, 0x30,0x00,
-    0x18,0x08, 0x0c,0x00,
-    0x60,0x08, 0x03,0x00,
-    0x80,0x08, 0x00,0x80,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x08, 0x00,0x00, // STAR 25x29 = 6.0
-
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x30,0x00, 0x80,0x06,
-    0x0c,0x00, 0x80,0x18,
-    0x03,0x00, 0x80,0x60,
-    0x00,0xc0, 0x81,0x80,
-    0x00,0x30, 0x86,0x00,
-    0x00,0x0c, 0x98,0x00,
-    0x00,0x03, 0xe0,0x00,
-    0x00,0x03, 0xe0,0x00,
-    0x00,0x0c, 0x98,0x00,
-    0x00,0x30, 0x86,0x00,
-    0x00,0xc0, 0x81,0x80,
-    0x03,0x00, 0x80,0x60,
-    0x0c,0x00, 0x80,0x18,
-    0x30,0x00, 0x80,0x06,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x80,0x00,
-    0x00,0x00, 0x00,0x00,
-    0x00,0x00, 0x00,0x00, // STAR 32x32 = 6.5
-
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x10, 0x00, 0x80, 0x04,
-    0x0c, 0x00, 0x80, 0x18,
-    0x02, 0x00, 0x80, 0x20,
-    0x01, 0x80, 0x80, 0xc0,
-    0x00, 0x40, 0x81, 0x00,
-    0x00, 0x30, 0x86, 0x00,
-    0x00, 0x08, 0x88, 0x00,
-    0x00, 0x06, 0xb0, 0x00,
-    0x00, 0x01, 0xc0, 0x00,
-    0x00, 0x06, 0xb0, 0x00,
-    0x00, 0x08, 0x88, 0x00,
-    0x00, 0x30, 0x86, 0x00,
-    0x00, 0x40, 0x81, 0x00,
-    0x01, 0x80, 0x80, 0xc0,
-    0x02, 0x00, 0x80, 0x20,
-    0x0c, 0x00, 0x80, 0x18,
-    0x10, 0x00, 0x80, 0x04,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00,
-    0x00, 0x00, 0x80, 0x00, // STAR 32x32 = 7.0
-
-    // TYPE = CIRC
-
-    0x38,
-    0x44,
-    0x82,
-    0x82,
-    0x82,
-    0x44,
-    0x38, // CIRC 7x7 = 1.0
-
-    0x3c,0x00,
-    0x42,0x00,
-    0x81,0x00,
-    0x81,0x00,
-    0x81,0x00,
-    0x81,0x00,
-    0x42,0x00,
-    0x3c,0x00,
-    0x00,0x00, //CIRC 9x9 = 1.5
-
-    0x3e,0x00,
-    0x41,0x00,
-    0x81,0x80,
-    0x80,0x80,
-    0x80,0x80,
-    0x80,0x80,
-    0x81,0x80,
-    0x41,0x00,
-    0x3e,0x00, // CIRC 9x9 = 2.0
-
-    0x1f,0x00,
-    0x20,0x80,
-    0x40,0x40,
-    0x80,0x20,
-    0x80,0x20,
-    0x80,0x20,
-    0x80,0x20,
-    0x80,0x20,
-    0x40,0x40,
-    0x20,0x80,
-    0x1f,0x00, // CIRC 11x11 = 2.5
-
-    0x0f,0x80,
-    0x10,0x40,
-    0x20,0x20,
-    0x40,0x10,
-    0x80,0x08,
-    0x80,0x08,
-    0x80,0x08,
-    0x80,0x08,
-    0x80,0x08,
-    0x40,0x10,
-    0x20,0x20,
-    0x10,0x40,
-    0x0f,0x80, // CIRC 13x13 = 3.0
-
-    0x07,0xc0,
-    0x18,0x30,
-    0x20,0x08,
-    0x40,0x04,
-    0x40,0x04,
-    0x80,0x02,
-    0x80,0x02,
-    0x80,0x02,
-    0x80,0x02,
-    0x80,0x02,
-    0x40,0x04,
-    0x40,0x04,
-    0x20,0x08,
-    0x18,0x30,
-    0x07,0xc0, // CIRC 15x15 = 3.5
-
-    0x03,0xe0, 0x00,
-    0x0c,0x18, 0x00,
-    0x10,0x04, 0x00,
-    0x20,0x02, 0x00,
-    0x40,0x01, 0x00,
-    0x40,0x01, 0x00,
-    0x80,0x00, 0x80,
-    0x80,0x00, 0x80,
-    0x80,0x00, 0x80,
-    0x80,0x00, 0x80,
-    0x80,0x00, 0x80,
-    0x40,0x01, 0x00,
-    0x40,0x01, 0x00,
-    0x20,0x02, 0x00,
-    0x10,0x04, 0x00,
-    0x0c,0x18, 0x00,
-    0x03,0xe0, 0x00, // CIRC 17x17 = 4.0
-
-    0x03,0xf8, 0x00,
-    0x0e,0x0e, 0x00,
-    0x18,0x03, 0x00,
-    0x20,0x00, 0x80,
-    0x60,0x00, 0xc0,
-    0x40,0x00, 0x40,
-    0xc0,0x00, 0x60,
-    0x80,0x00, 0x20,
-    0x80,0x00, 0x20,
-    0x80,0x00, 0x20,
-    0x80,0x00, 0x20,
-    0x80,0x00, 0x20,
-    0xc0,0x00, 0x60,
-    0x40,0x00, 0x40,
-    0x60,0x00, 0xc0,
-    0x20,0x00, 0x80,
-    0x18,0x03, 0x00,
-    0x0e,0x0e, 0x00,
-    0x03,0xf8, 0x00, // CIRC 19x19 = 4.5
-
-    0x01,0xfc, 0x00,
-    0x06,0x03, 0x00,
-    0x08,0x00, 0x80,
-    0x10,0x00, 0x40,
-    0x20,0x00, 0x20,
-    0x40,0x00, 0x10,
-    0x40,0x00, 0x10,
-    0x80,0x00, 0x08,
-    0x80,0x00, 0x08,
-    0x80,0x00, 0x08,
-    0x80,0x00, 0x08,
-    0x80,0x00, 0x08,
-    0x80,0x00, 0x08,
-    0x80,0x00, 0x08,
-    0x40,0x00, 0x10,
-    0x40,0x00, 0x10,
-    0x20,0x00, 0x20,
-    0x10,0x00, 0x40,
-    0x08,0x00, 0x80,
-    0x06,0x03, 0x00,
-    0x01,0xfc, 0x00, // CIRC 21x21 = 5.0
-
-    0x00,0xfe, 0x00,
-    0x03,0x01, 0x80,
-    0x0c,0x00, 0x60,
-    0x18,0x00, 0x30,
-    0x30,0x00, 0x18,
-    0x20,0x00, 0x08,
-    0x40,0x00, 0x04,
-    0x40,0x00, 0x04,
-    0x80,0x00, 0x02,
-    0x80,0x00, 0x02,
-    0x80,0x00, 0x02,
-    0x80,0x00, 0x02,
-    0x80,0x00, 0x02,
-    0x80,0x00, 0x02,
-    0x80,0x00, 0x02,
-    0x40,0x00, 0x04,
-    0x40,0x00, 0x04,
-    0x20,0x00, 0x08,
-    0x30,0x00, 0x18,
-    0x18,0x00, 0x30,
-    0x0c,0x00, 0x60,
-    0x03,0x01, 0x80,
-    0x00,0xfe, 0x00, // CIRC 23x23 = 5.5
-
-    0x00,0x7f, 0x00,0x00,
-    0x01,0x80, 0xc0,0x00,
-    0x06,0x00, 0x30,0x00,
-    0x08,0x00, 0x08,0x00,
-    0x10,0x00, 0x04,0x00,
-    0x20,0x00, 0x02,0x00,
-    0x20,0x00, 0x02,0x00,
-    0x40,0x00, 0x01,0x00,
-    0x40,0x00, 0x01,0x00,
-    0x80,0x00, 0x00,0x80,
-    0x80,0x00, 0x00,0x80,
-    0x80,0x00, 0x00,0x80,
-    0x80,0x00, 0x00,0x80,
-    0x80,0x00, 0x00,0x80,
-    0x80,0x00, 0x00,0x80,
-    0x80,0x00, 0x00,0x80,
-    0x40,0x00, 0x01,0x00,
-    0x40,0x00, 0x01,0x00,
-    0x20,0x00, 0x02,0x00,
-    0x20,0x00, 0x02,0x00,
-    0x10,0x00, 0x04,0x00,
-    0x08,0x00, 0x08,0x00,
-    0x06,0x00, 0x30,0x00,
-    0x01,0x80, 0xc0,0x00,
-    0x00,0x7f, 0x00,0x00, // CIRC 25x25 = 6.0
-
-    0x00,0x3f, 0x80,0x00,
-    0x01,0xc0, 0x70,0x00,
-    0x03,0x00, 0x18,0x00,
-    0x0c,0x00, 0x06,0x00,
-    0x18,0x00, 0x03,0x00,
-    0x10,0x00, 0x01,0x00,
-    0x20,0x00, 0x00,0x80,
-    0x60,0x00, 0x00,0xc0,
-    0x40,0x00, 0x00,0x40,
-    0x40,0x00, 0x00,0x40,
-    0x80,0x00, 0x00,0x20,
-    0x80,0x00, 0x00,0x20,
-    0x80,0x00, 0x00,0x20,
-    0x80,0x00, 0x00,0x20,
-    0x80,0x00, 0x00,0x20,
-    0x80,0x00, 0x00,0x20,
-    0x80,0x00, 0x00,0x20,
-    0x40,0x00, 0x00,0x40,
-    0x40,0x00, 0x00,0x40,
-    0x60,0x00, 0x00,0xc0,
-    0x20,0x00, 0x00,0x80,
-    0x10,0x00, 0x01,0x00,
-    0x18,0x00, 0x03,0x00,
-    0x0c,0x00, 0x06,0x00,
-    0x03,0x00, 0x18,0x00,
-    0x01,0xc0, 0x70,0x00,
-    0x00,0x3f, 0x80,0x00, // CIRC 27x27 = 6.5
-
-    0x00,0x1f, 0xc0,0x00,
-    0x00,0xe0, 0x38,0x00,
-    0x01,0x00, 0x04,0x00,
-    0x06,0x00, 0x03,0x00,
-    0x08,0x00, 0x00,0x80,
-    0x10,0x00, 0x00,0x40,
-    0x10,0x00, 0x00,0x40,
-    0x20,0x00, 0x00,0x20,
-    0x40,0x00, 0x00,0x10,
-    0x40,0x00, 0x00,0x10,
-    0x40,0x00, 0x00,0x10,
-    0x80,0x00, 0x00,0x08,
-    0x80,0x00, 0x00,0x08,
-    0x80,0x00, 0x00,0x08,
-    0x80,0x00, 0x00,0x08,
-    0x80,0x00, 0x00,0x08,
-    0x80,0x00, 0x00,0x08,
-    0x80,0x00, 0x00,0x08,
-    0x40,0x00, 0x00,0x10,
-    0x40,0x00, 0x00,0x10,
-    0x40,0x00, 0x00,0x10,
-    0x20,0x00, 0x00,0x20,
-    0x10,0x00, 0x00,0x40,
-    0x10,0x00, 0x00,0x40,
-    0x08,0x00, 0x00,0x80,
-    0x06,0x00, 0x03,0x00,
-    0x01,0x00, 0x04,0x00,
-    0x00,0xe0, 0x38,0x00,
-    0x00,0x1f, 0xc0,0x00, // CIRC 29x29 = 7.0
-
-    // TYPE = CROSS
-
-    0x82,
-    0x44,
-    0x28,
-    0x10,
-    0x28,
-    0x44,
-    0x82, // CROSS 7x7 = 1.0
-
-    0x80,0x80,
-    0x41,0x00,
-    0x22,0x00,
-    0x14,0x00,
-    0x08,0x00,
-    0x14,0x00,
-    0x22,0x00,
-    0x41,0x00,
-    0x80,0x80, // CROSS 9x9 = 1.5
-
-    0x80,0x20,
-    0x40,0x40,
-    0x20,0x80,
-    0x11,0x00,
-    0x0a,0x00,
-    0x04,0x00,
-    0x0a,0x00,
-    0x11,0x00,
-    0x20,0x80,
-    0x40,0x40,
-    0x80,0x20, // CROSS 11x11 = 2.0
-
-    0x80,0x08,
-    0x40,0x10,
-    0x20,0x20,
-    0x10,0x40,
-    0x08,0x80,
-    0x05,0x00,
-    0x02,0x00,
-    0x05,0x00,
-    0x08,0x80,
-    0x10,0x40,
-    0x20,0x20,
-    0x40,0x10,
-    0x80,0x08, // CROSS 13x13 = 2.5
-
-    0x80,0x02,
-    0x40,0x04,
-    0x20,0x08,
-    0x10,0x10,
-    0x08,0x20,
-    0x04,0x40,
-    0x02,0x80,
-    0x01,0x00,
-    0x02,0x80,
-    0x04,0x40,
-    0x08,0x20,
-    0x10,0x10,
-    0x20,0x08,
-    0x40,0x04,
-    0x80,0x02, // CROSS 15x15 = 3.0
-
-    0x80,0x00, 0x80,
-    0x40,0x01, 0x00,
-    0x20,0x02, 0x00,
-    0x10,0x04, 0x00,
-    0x08,0x08, 0x00,
-    0x04,0x10, 0x00,
-    0x02,0x20, 0x00,
-    0x01,0x40, 0x00,
-    0x00,0x80, 0x00,
-    0x01,0x40, 0x00,
-    0x02,0x20, 0x00,
-    0x04,0x10, 0x00,
-    0x08,0x08, 0x00,
-    0x10,0x04, 0x00,
-    0x20,0x02, 0x00,
-    0x40,0x01, 0x00,
-    0x80,0x00, 0x80, // CROSS 17x17 = 3.5
-
-    0x80,0x00, 0x20,
-    0x40,0x00, 0x40,
-    0x20,0x00, 0x80,
-    0x10,0x01, 0x00,
-    0x08,0x02, 0x00,
-    0x04,0x04, 0x00,
-    0x02,0x08, 0x00,
-    0x01,0x10, 0x00,
-    0x00,0xa0, 0x00,
-    0x00,0x40, 0x00,
-    0x00,0xa0, 0x00,
-    0x01,0x10, 0x00,
-    0x02,0x08, 0x00,
-    0x04,0x04, 0x00,
-    0x08,0x02, 0x00,
-    0x10,0x01, 0x00,
-    0x20,0x00, 0x80,
-    0x40,0x00, 0x40,
-    0x80,0x00, 0x20, // CROSS 19x19 = 4.0
-
-    0x80,0x00, 0x08,
-    0x40,0x00, 0x10,
-    0x20,0x00, 0x20,
-    0x10,0x00, 0x40,
-    0x08,0x00, 0x80,
-    0x04,0x01, 0x00,
-    0x02,0x02, 0x00,
-    0x01,0x04, 0x00,
-    0x00,0x88, 0x00,
-    0x00,0x50, 0x00,
-    0x00,0x20, 0x00,
-    0x00,0x50, 0x00,
-    0x00,0x88, 0x00,
-    0x01,0x04, 0x00,
-    0x02,0x02, 0x00,
-    0x04,0x01, 0x00,
-    0x08,0x00, 0x80,
-    0x10,0x00, 0x40,
-    0x20,0x00, 0x20,
-    0x40,0x00, 0x10,
-    0x80,0x00, 0x08,/* CROSS 21x21 = 4.5 */
-
-    0x80,0x00, 0x02,
-    0x40,0x00, 0x04,
-    0x20,0x00, 0x08,
-    0x10,0x00, 0x10,
-    0x08,0x00, 0x20,
-    0x04,0x00, 0x40,
-    0x02,0x00, 0x80,
-    0x01,0x01, 0x00,
-    0x00,0x82, 0x00,
-    0x00,0x44, 0x00,
-    0x00,0x28, 0x00,
-    0x00,0x10, 0x00,
-    0x00,0x28, 0x00,
-    0x00,0x44, 0x00,
-    0x00,0x82, 0x00,
-    0x01,0x01, 0x00,
-    0x02,0x00, 0x80,
-    0x04,0x00, 0x40,
-    0x08,0x00, 0x20,
-    0x10,0x00, 0x10,
-    0x20,0x00, 0x08,
-    0x40,0x00, 0x04,
-    0x80,0x00, 0x02, // CROSS 23x23 = 5.0
-
-    0x80,0x00, 0x00,0x80,
-    0x40,0x00, 0x01,0x00,
-    0x20,0x00, 0x02,0x00,
-    0x10,0x00, 0x04,0x00,
-    0x08,0x00, 0x08,0x00,
-    0x04,0x00, 0x10,0x00,
-    0x02,0x00, 0x20,0x00,
-    0x01,0x00, 0x40,0x00,
-    0x00,0x80, 0x80,0x00,
-    0x00,0x41, 0x00,0x00,
-    0x00,0x22, 0x00,0x00,
-    0x00,0x14, 0x00,0x00,
-    0x00,0x08, 0x00,0x00,
-    0x00,0x14, 0x00,0x00,
-    0x00,0x22, 0x00,0x00,
-    0x00,0x41, 0x00,0x00,
-    0x00,0x80, 0x80,0x00,
-    0x01,0x00, 0x40,0x00,
-    0x02,0x00, 0x20,0x00,
-    0x04,0x00, 0x10,0x00,
-    0x08,0x00, 0x08,0x00,
-    0x10,0x00, 0x04,0x00,
-    0x20,0x00, 0x02,0x00,
-    0x40,0x00, 0x01,0x00,
-    0x80,0x00, 0x00,0x80, // CROSS 25x25 = 5.5
-
-    0x80,0x00, 0x00,0x20,
-    0x40,0x00, 0x00,0x40,
-    0x20,0x00, 0x00,0x80,
-    0x10,0x00, 0x01,0x00,
-    0x08,0x00, 0x02,0x00,
-    0x04,0x00, 0x04,0x00,
-    0x02,0x00, 0x08,0x00,
-    0x01,0x00, 0x10,0x00,
-    0x00,0x80, 0x20,0x00,
-    0x00,0x40, 0x40,0x00,
-    0x00,0x20, 0x80,0x00,
-    0x00,0x11, 0x00,0x00,
-    0x00,0x0a, 0x00,0x00,
-    0x00,0x04, 0x00,0x00,
-    0x00,0x0a, 0x00,0x00,
-    0x00,0x11, 0x00,0x00,
-    0x00,0x20, 0x80,0x00,
-    0x00,0x40, 0x40,0x00,
-    0x00,0x80, 0x20,0x00,
-    0x01,0x00, 0x10,0x00,
-    0x02,0x00, 0x08,0x00,
-    0x04,0x00, 0x04,0x00,
-    0x08,0x00, 0x02,0x00,
-    0x10,0x00, 0x01,0x00,
-    0x20,0x00, 0x00,0x80,
-    0x40,0x00, 0x00,0x40,
-    0x80,0x00, 0x00,0x20, // CROSS 27x27 = 6.0
-
-    0x00,0x00, 0x00,0x00,
-    0x00,0x00, 0x00,0x00,
-    0x20,0x00, 0x00,0x04,
-    0x10,0x00, 0x00,0x08,
-    0x08,0x00, 0x00,0x10,
-    0x04,0x00, 0x00,0x20,
-    0x02,0x00, 0x00,0x40,
-    0x01,0x00, 0x00,0x80,
-    0x00,0x80, 0x01,0x00,
-    0x00,0x40, 0x02,0x00,
-    0x00,0x20, 0x04,0x00,
-    0x00,0x10, 0x08,0x00,
-    0x00,0x08, 0x10,0x00,
-    0x00,0x04, 0x20,0x00,
-    0x00,0x02, 0x40,0x00,
-    0x00,0x01, 0x80,0x00,
-    0x00,0x01, 0x80,0x00,
-    0x00,0x02, 0x40,0x00,
-    0x00,0x04, 0x20,0x00,
-    0x00,0x08, 0x10,0x00,
-    0x00,0x10, 0x08,0x00,
-    0x00,0x20, 0x04,0x00,
-    0x00,0x40, 0x02,0x00,
-    0x00,0x80, 0x01,0x00,
-    0x01,0x00, 0x00,0x80,
-    0x02,0x00, 0x00,0x40,
-    0x04,0x00, 0x00,0x20,
-    0x08,0x00, 0x00,0x10,
-    0x10,0x00, 0x00,0x08,
-    0x20,0x00, 0x00,0x04,
-    0x00,0x00, 0x00,0x00,
-    0x00,0x00, 0x00,0x00, // CROSS 32x32 = 6.5
-
-    0x00,0x00, 0x00,0x00,
-    0x40,0x00, 0x00,0x02,
-    0x20,0x00, 0x00,0x04,
-    0x10,0x00, 0x00,0x08,
-    0x08,0x00, 0x00,0x10,
-    0x04,0x00, 0x00,0x20,
-    0x02,0x00, 0x00,0x40,
-    0x01,0x00, 0x00,0x80,
-    0x00,0x80, 0x01,0x00,
-    0x00,0x40, 0x02,0x00,
-    0x00,0x20, 0x04,0x00,
-    0x00,0x10, 0x08,0x00,
-    0x00,0x08, 0x10,0x00,
-    0x00,0x04, 0x20,0x00,
-    0x00,0x02, 0x40,0x00,
-    0x00,0x01, 0x80,0x00,
-    0x00,0x01, 0x80,0x00,
-    0x00,0x02, 0x40,0x00,
-    0x00,0x04, 0x20,0x00,
-    0x00,0x08, 0x10,0x00,
-    0x00,0x10, 0x08,0x00,
-    0x00,0x20, 0x04,0x00,
-    0x00,0x40, 0x02,0x00,
-    0x00,0x80, 0x01,0x00,
-    0x01,0x00, 0x00,0x80,
-    0x02,0x00, 0x00,0x40,
-    0x04,0x00, 0x00,0x20,
-    0x08,0x00, 0x00,0x10,
-    0x10,0x00, 0x00,0x08,
-    0x20,0x00, 0x00,0x04,
-    0x40,0x00, 0x00,0x02,
-    0x00,0x00, 0x00,0x00  // CROSS 32x32 = 7.0
-};
-
-//! Returns a parameters for the marker of the specified type and scale.
-static void GetMarkerBitMapParam (const Aspect_TypeOfMarker theMarkerType,
-                                  const Standard_ShortReal& theScale,
-                                  Standard_Integer& theWidth,
-                                  Standard_Integer& theHeight,
-                                  Standard_Integer& theOffset,
-                                  Standard_Integer& theNumOfBytes)
-{
-  const Standard_Integer aType = (Standard_Integer )((theMarkerType > Aspect_TOM_O) ? Aspect_TOM_O : theMarkerType);
-  const Standard_Real anIndex = (Standard_Real )(TEL_NO_OF_SIZES - 1) * (theScale - (Standard_Real )TEL_PM_START_SIZE)
-                              / (Standard_Real )(TEL_PM_END_SIZE - TEL_PM_START_SIZE);
-  Standard_Integer anId = (Standard_Integer )(anIndex + 0.5);
-  if (anId < 0)
-  {
-    anId = 0;
-  }
-  else if (anId >= TEL_NO_OF_SIZES)
-  {
-    anId = TEL_NO_OF_SIZES - 1;
-  }
-
-  theWidth  = (Standard_Integer )arrPMFontInfo[aType][anId].width;
-  theHeight = (Standard_Integer )arrPMFontInfo[aType][anId].height;
-  theOffset = arrPMFontInfo[aType][anId].offset;
-  const Standard_Integer aNumOfBytesInRow = theWidth / 8 + (theWidth % 8 ? 1 : 0);
-  theNumOfBytes = theHeight * aNumOfBytesInRow;
-}
-
-//! Returns a marker image for the marker of the specified type and scale.
-static Handle(Graphic3d_MarkerImage) GetTextureImage (const Aspect_TypeOfMarker theMarkerType,
-                                                      const Standard_ShortReal& theScale)
-{
-  Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
-  GetMarkerBitMapParam (theMarkerType, theScale, aWidth, aHeight, anOffset, aNumOfBytes);
-
-  Handle(TColStd_HArray1OfByte) aBitMap = new TColStd_HArray1OfByte (0, aNumOfBytes - 1);
-  for (Standard_Integer anIter = 0; anIter < aNumOfBytes; anIter++)
-  {
-    aBitMap->ChangeValue (anIter) = OpenGl_AspectMarker_myMarkerRaster[anOffset + anIter];
-  }
-
-  Handle(Graphic3d_MarkerImage) aTexture = new Graphic3d_MarkerImage (aBitMap, aWidth, aHeight);
-  return aTexture;
-}
-
-//! Merge two image pixmap into one. Used for creating image for following markers:
-//! Aspect_TOM_O_POINT, Aspect_TOM_O_PLUS, Aspect_TOM_O_STAR, Aspect_TOM_O_X, Aspect_TOM_RING1, Aspect_TOM_RING2, Aspect_TOM_RING3
-static Handle(Image_PixMap) MergeImages (const Handle(Image_PixMap)& theImage1,
-                                         const Handle(Image_PixMap)& theImage2)
-{
-  if (theImage1.IsNull() && theImage2.IsNull())
-  {
-    return Handle(Image_PixMap)();
-  }
-
-  Handle(Image_PixMap) aResultImage = new Image_PixMap();
-
-  Standard_Integer aWidth1 (0), aHeight1 (0);
-  if (!theImage1.IsNull())
-  {
-    aWidth1  = (Standard_Integer )theImage1->Width();
-    aHeight1 = (Standard_Integer )theImage1->Height();
-  }
-
-  Standard_Integer aWidth2 (0), aHeight2 (0);
-  if (!theImage2.IsNull())
-  {
-    aWidth2  = (Standard_Integer )theImage2->Width();
-    aHeight2 = (Standard_Integer )theImage2->Height();
-  }
-
-  const Standard_Integer aMaxWidth  = Max (aWidth1,   aWidth2);
-  const Standard_Integer aMaxHeight = Max (aHeight1,  aHeight2);
-  const Standard_Integer aSize      = Max (aMaxWidth, aMaxHeight);
-
-  aResultImage->InitZero (Image_Format_Alpha, aSize, aSize);
-
-  if (!theImage1.IsNull())
-  {
-    const Standard_Integer aXOffset1  = Abs (aWidth1  - aMaxWidth)  / 2;
-    const Standard_Integer anYOffset1 = Abs (aHeight1 - aMaxHeight) / 2;
-    for (Standard_Integer anY = 0; anY < aHeight1; anY++)
-    {
-      Standard_Byte* anImageLine = theImage1->ChangeRow (anY);
-      Standard_Byte* aResultImageLine = aResultImage->ChangeRow (anYOffset1 + anY);
-      for (Standard_Integer aX = 0; aX < aWidth1; aX++)
-      {
-        aResultImageLine[aXOffset1 + aX] |= anImageLine[aX];
-      }
-    }
-  }
-
-  if (!theImage2.IsNull())
-  {
-    const Standard_Integer aXOffset2  = Abs (aWidth2  - aMaxWidth)  / 2;
-    const Standard_Integer anYOffset2 = Abs (aHeight2 - aMaxHeight) / 2;
-    for (Standard_Integer anY = 0; anY < aHeight2; anY++)
-    {
-      Standard_Byte* anImageLine = theImage2->ChangeRow (anY);
-      Standard_Byte* aResultImageLine = aResultImage->ChangeRow (anYOffset2 + anY);
-      for (Standard_Integer aX = 0; aX < aWidth2; aX++)
-      {
-        aResultImageLine[aXOffset2 + aX] |= anImageLine[aX];
-      }
-    }
-  }
-
-  return aResultImage;
 }
 
 // =======================================================================
@@ -1643,140 +233,26 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx,
     }
   }
 
+  Handle(Graphic3d_MarkerImage) aNewMarkerImage = theType == Aspect_TOM_USERDEFINED && !theMarkerImage.IsNull()
+                                                ? theMarkerImage
+                                                : Graphic3d_MarkerImage::StandardMarker (theType, theScale, theColor);
+  if (aNewMarkerImage.IsNull())
+  {
+    return;
+  }
+
   if (!theCtx.IsNull()
    &&  theCtx->core20fwd != NULL
    && !theCtx->caps->pntSpritesDisable)
   {
     // Creating texture resource for using it with point sprites
-    Handle(Graphic3d_MarkerImage) aNewMarkerImage;
-    Handle(Image_PixMap) anImage, anImageA;
-
-    if (theType == Aspect_TOM_USERDEFINED && !theMarkerImage.IsNull())
-    {
-      aNewMarkerImage = theMarkerImage;
-      anImage = aNewMarkerImage->GetImage();
-    }
-    else
-    {
-      // Creating image from default bitmap
-      Handle(Graphic3d_MarkerImage) aMarkerImage1, aMarkerImage2;
-
-      const Standard_ShortReal aDelta = 0.1F;
-      Standard_ShortReal aScale = theScale;
-      Standard_ShortReal aLimit = 0.0F;
-
-      switch (theType)
-      {
-        case Aspect_TOM_O_POINT:
-        {
-          // draw inner point as filled rectangle
-          const Standard_Integer        aSize   = theScale > 7 ? 7 : (Standard_Integer )(theScale + 0.5F);
-          Handle(TColStd_HArray1OfByte) aBitMap = fillPointBitmap (aSize);
-          aMarkerImage2 = new Graphic3d_MarkerImage (aBitMap, aSize, aSize);
-        }
-        Standard_FALLTHROUGH
-        case Aspect_TOM_O_PLUS:
-        case Aspect_TOM_O_STAR:
-        case Aspect_TOM_O_X:
-        {
-          // For this type of markers we merge two base bitmaps into one
-          // For example Aspect_TOM_O_PLUS = Aspect_TOM_O + Aspect_TOM_PLUS
-          aMarkerImage1 = GetTextureImage (Aspect_TOM_O, theScale);
-          if (theType != Aspect_TOM_O_POINT)
-          {
-            aMarkerImage2 = GetTextureImage (Aspect_TypeOfMarker (theType - Aspect_TOM_O_POINT), theScale);
-          }
-          anImage = MergeImages (aMarkerImage1->GetImage(), aMarkerImage2->GetImage());
-          aNewMarkerImage = new Graphic3d_MarkerImage (anImage);
-          break;
-        }
-        case Aspect_TOM_RING1:
-          if (aLimit == 0.0f) aLimit = aScale * 0.2f;
-          Standard_FALLTHROUGH
-        case Aspect_TOM_RING2:
-          if (aLimit == 0.0f) aLimit = aScale * 0.5f;
-          Standard_FALLTHROUGH
-        case Aspect_TOM_RING3:
-        {
-          if (aLimit == 0.0f) aLimit = aScale * 0.8f;
-          for (; aScale > aLimit && aScale >= 1.0f; aScale -= aDelta)
-          {
-            anImage = MergeImages (anImage, GetTextureImage (Aspect_TOM_O, aScale)->GetImage());
-          }
-          aNewMarkerImage = new Graphic3d_MarkerImage (anImage);
-          break;
-        }
-        case Aspect_TOM_BALL:
-        {
-          Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
-          GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
-
-          NCollection_Vec4<Standard_Real> aColor (Standard_Real (theColor.r()),
-                                                  Standard_Real (theColor.g()),
-                                                  Standard_Real (theColor.b()),
-                                                  Standard_Real (theColor.a()));
-
-          const Standard_Integer aSize = Max (aWidth + 2, aHeight + 2); // includes extra margin
-          anImage  = new Image_PixMap();
-          anImageA = new Image_PixMap();
-          anImage ->InitZero (Image_Format_BGRA,  aSize, aSize);
-          anImageA->InitZero (Image_Format_Alpha, aSize, aSize);
-
-          // we draw a set of circles
-          Image_ColorBGRA aColor32;
-          aColor32.a() = 255;
-          Standard_Real aHLS[3];
-          while (aScale >= 1.0f)
-          {
-            Quantity_Color::RgbHls (aColor.r(), aColor.g(), aColor.b(), aHLS[0], aHLS[1], aHLS[2]);
-            aHLS[2] *= 0.95; // 5% saturation change
-            Quantity_Color::HlsRgb (aHLS[0], aHLS[1], aHLS[2], aColor.r(), aColor.g(), aColor.b());
-            aColor32.r() = Standard_Byte(255.0 * aColor.r());
-            aColor32.g() = Standard_Byte(255.0 * aColor.g());
-            aColor32.b() = Standard_Byte(255.0 * aColor.b());
-
-            const Handle(Graphic3d_MarkerImage) aMarker = GetTextureImage (Aspect_TOM_O, aScale);
-            const Handle(Image_PixMap)& aCircle = aMarker->GetImage();
-
-            const Standard_Size aDiffX = (anImage->SizeX() - aCircle->SizeX()) / 2;
-            const Standard_Size aDiffY = (anImage->SizeY() - aCircle->SizeY()) / 2;
-            for (Standard_Size aRow = 0; aRow < aCircle->SizeY(); ++aRow)
-            {
-              const Standard_Byte* aRowData = aCircle->Row (aRow);
-              for (Standard_Size aCol = 0; aCol < aCircle->SizeX(); ++aCol)
-              {
-                if (aRowData[aCol] != 0)
-                {
-                  anImage ->ChangeValue<Image_ColorBGRA> (aDiffX + aRow, aDiffY + aCol) = aColor32;
-                  anImageA->ChangeValue<Standard_Byte>   (aDiffX + aRow, aDiffY + aCol) = 255;
-                }
-              }
-            }
-            aScale -= aDelta;
-          }
-          break;
-        }
-        default:
-        {
-          aNewMarkerImage = GetTextureImage (theType, theScale);
-          anImage = aNewMarkerImage->GetImage();
-          break;
-        }
-      }
-    }
-
+    Handle(Image_PixMap) anImage = aNewMarkerImage->GetImage();
     theMarkerSize = Max ((Standard_ShortReal )anImage->Width(),(Standard_ShortReal )anImage->Height());
 
     aSprite->Init (theCtx, *anImage, Graphic3d_TOT_2D, true);
     if (!hadAlreadyAlpha)
     {
-      if (anImageA.IsNull()
-       && aSprite->GetFormat() != GL_ALPHA
-       && !aNewMarkerImage.IsNull())
-      {
-        anImageA = aNewMarkerImage->GetImageAlpha();
-      }
-      if (!anImageA.IsNull())
+      if (Handle(Image_PixMap) anImageA = aSprite->GetFormat() != GL_ALPHA ? aNewMarkerImage->GetImageAlpha() : Handle(Image_PixMap)())
       {
         aSpriteA->Init (theCtx, *anImageA, Graphic3d_TOT_2D, true);
       }
@@ -1789,127 +265,59 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx,
     GLuint aBitmapList = glGenLists (1);
     aSprite->SetDisplayList (theCtx, aBitmapList);
 
-    Standard_Integer aWidth, aHeight, anOffset, aNumOfBytes;
-    if (theType == Aspect_TOM_USERDEFINED && !theMarkerImage.IsNull())
+    Handle(Image_PixMap) anImage = aNewMarkerImage->IsColoredImage()
+                                 ? aNewMarkerImage->GetImage()
+                                 : Handle(Image_PixMap)();
+    const OpenGl_TextureFormat aFormat = !anImage.IsNull()
+                                       ? OpenGl_TextureFormat::FindFormat (theCtx, anImage->Format(), true)
+                                       : OpenGl_TextureFormat();
+    if (aFormat.IsValid())
     {
-      // Reading user defined marker
-      Handle(TColStd_HArray1OfByte) aBitMap = theMarkerImage->GetBitMapArray();
-      Standard_Byte* aBitMapArray = new Standard_Byte[aBitMap->Length()];
-      theMarkerImage->GetTextureSize (aWidth, aHeight);
-
-      // We should pass bitmap to glBitmap with reversed line order as it draws it from
-      // bottom to top
-      const Standard_Integer aNumOfBytesInRow = aWidth / 8 + (aWidth % 8 ? 1 : 0);
-      const Standard_Integer anUpperIndex = aBitMap->Upper();
-      for (Standard_Integer aRow = 0; aRow < aHeight; aRow++)
+      if (anImage->IsTopDown())
       {
-        for (Standard_Integer aByteIter = 0; aByteIter < aNumOfBytesInRow; aByteIter++)
-        {
-          aBitMapArray[aRow * aNumOfBytesInRow + aByteIter] =
-            aBitMap->Value (anUpperIndex + 1 - (aRow + 1) * aNumOfBytesInRow + aByteIter);
-        }
+        Handle(Image_PixMap) anImageCopy = new Image_PixMap();
+        anImageCopy->InitCopy (*anImage);
+        Image_PixMap::FlipY (*anImageCopy);
+        anImage = anImageCopy;
       }
+      const GLint anAligment = Min ((GLint)anImage->MaxRowAligmentBytes(), 8);
+      glPixelStorei (GL_UNPACK_ALIGNMENT, anAligment);
 
-      if (aBitMapArray != NULL)
-      {
-        glNewList (aBitmapList, GL_COMPILE);
-        glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, (GLfloat )(0.5f * aWidth), (GLfloat )(0.5f * aHeight),
-                  0.f, 0.f, (const GLubyte* )aBitMapArray);
-        glEndList();
-      }
-    }
-    else
-    {
-      // Creating list for default marker
-      const Standard_ShortReal aDelta = 0.1f;
-      Standard_ShortReal aScale = theScale;
-      Standard_ShortReal aLimit = 0.0f;
+      const GLint anExtraBytes = GLint (anImage->RowExtraBytes());
+      const GLint aPixelsWidth = GLint (anImage->SizeRowBytes() / anImage->SizePixelBytes());
+      const GLint aRowLength = (anExtraBytes >= anAligment) ? aPixelsWidth : 0;
+      glPixelStorei (GL_UNPACK_ROW_LENGTH, aRowLength);
 
       glNewList (aBitmapList, GL_COMPILE);
-      switch (theType)
-      {
-        case Aspect_TOM_O_POINT:
-        {
-          // draw inner point as filled rectangle
-          const Standard_Integer        aSize   = theScale > 7 ? 7 : (Standard_Integer )(theScale + 0.5F);
-          Handle(TColStd_HArray1OfByte) aBitMap = fillPointBitmap (aSize);
-          glBitmap (aSize, aSize, (GLfloat )(0.5f * aSize), (GLfloat )(0.5f * aSize),
-                    0.0f, 0.0f, &aBitMap->Array1().Value (aBitMap->Lower()));
-        }
-        Standard_FALLTHROUGH
-        case Aspect_TOM_O_PLUS:
-        case Aspect_TOM_O_STAR:
-        case Aspect_TOM_O_X:
-        {
-          // For this type of markers we merge two base bitmaps into one
-          // For example Aspect_TOM_O_PLUS = Aspect_TOM_O + Aspect_TOM_PLUS
-          GetMarkerBitMapParam (Aspect_TOM_O, theScale, aWidth, aHeight, anOffset, aNumOfBytes);
-          glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, (GLfloat )(0.5f * aWidth), (GLfloat )(0.5f * aHeight),
-                    0.f, 0.f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
-          if (theType != Aspect_TOM_O_POINT)
-          {
-            GetMarkerBitMapParam (Aspect_TypeOfMarker (theType - Aspect_TOM_O_POINT), theScale, aWidth, aHeight, anOffset, aNumOfBytes);
-            glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, (GLfloat )(0.5f * aWidth), (GLfloat )(0.5f * aHeight),
-                      0.f, 0.f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
-          }
-          break;
-        }
-        case Aspect_TOM_BALL:
-        {
-          NCollection_Vec4<Standard_Real> aColor (Standard_Real (theColor.r()),
-                                                  Standard_Real (theColor.g()),
-                                                  Standard_Real (theColor.b()),
-                                                  Standard_Real (theColor.a()));
-
-          // we draw a set of circles
-          while (aScale >= 1.0f)
-          {
-            Standard_Real aHLS[3];
-            Quantity_Color::RgbHls (aColor.r(), aColor.g(), aColor.b(), aHLS[0], aHLS[1], aHLS[2]);
-            // 5% saturation change
-            aHLS[2] *= 0.95;
-            Quantity_Color::HlsRgb (aHLS[0], aHLS[1], aHLS[2], aColor.r(), aColor.g(), aColor.b());
+      const Standard_Integer aWidth = (Standard_Integer )anImage->Width(), aHeight = (Standard_Integer )anImage->Height();
+      glBitmap (0, 0, 0, 0, GLfloat(-0.5f * aWidth), GLfloat(-0.5f * aHeight), NULL); // make offsets that will be added to the current raster position
+      glDrawPixels (GLsizei(anImage->Width()), GLsizei(anImage->Height()), aFormat.PixelFormat(), aFormat.DataType(), anImage->Data());
+      glEndList();
+      glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
+      glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
+    }
 
-            glColor4dv (aColor);
-            GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
-            glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, 0.5f * GLfloat(aWidth), 0.5f * GLfloat(aHeight),
-                      0.0f, 0.0f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
+    if (!aFormat.IsValid() || !hadAlreadyAlpha)
+    {
+      if (aFormat.IsValid())
+      {
+        aBitmapList = glGenLists (1);
+        aSpriteA->SetDisplayList (theCtx, aBitmapList);
+      }
 
-            aScale -= aDelta;
-          }
-          break;
-        }
-        case Aspect_TOM_RING1:
-          if (aLimit == 0.0f) aLimit = aScale * 0.2f;
-          Standard_FALLTHROUGH
-        case Aspect_TOM_RING2:
-          if (aLimit == 0.0f) aLimit = aScale * 0.5f;
-          Standard_FALLTHROUGH
-        case Aspect_TOM_RING3:
-        {
-          if (aLimit == 0.0f) aLimit = aScale * 0.8f;
-          for (; aScale > aLimit && aScale >= 1.0f; aScale -= aDelta)
-          {
-            GetMarkerBitMapParam (Aspect_TOM_O, aScale, aWidth, aHeight, anOffset, aNumOfBytes);
-            glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, 0.5f * GLfloat(aWidth), 0.5f * GLfloat(aHeight),
-                      0.0f, 0.0f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
-          }
-          break;
-        }
-        default:
-        {
-          GetMarkerBitMapParam (theType, theScale, aWidth, aHeight, anOffset, aNumOfBytes);
-          glBitmap ((GLsizei )aWidth, (GLsizei )aHeight, 0.5f * GLfloat(aWidth), 0.5f * GLfloat(aHeight),
-                    0.0f, 0.0f, (const GLubyte* )&OpenGl_AspectMarker_myMarkerRaster[anOffset]);
-          break;
-        }
+      Standard_Integer aWidth = 0, aHeight = 0;
+      aNewMarkerImage->GetTextureSize (aWidth, aHeight);
+      if (Handle(TColStd_HArray1OfByte) aBitMap = aNewMarkerImage->GetBitMapArray())
+      {
+        glNewList (aBitmapList, GL_COMPILE);
+        glBitmap ((GLsizei)aWidth, (GLsizei)aHeight, (GLfloat)(0.5f * aWidth), (GLfloat)(0.5f * aHeight),
+                   0.f, 0.f, (const GLubyte*)&aBitMap->First());
+        glEndList();
       }
-      glEndList();
     }
   #endif
   }
 }
-
 // =======================================================================
 // function : spriteKeys
 // purpose  :
index 8573f76..6cdaa1b 100755 (executable)
@@ -39,6 +39,13 @@ public:
   //! Returns TRUE for point sprite texture.
   virtual bool IsPointSprite() const Standard_OVERRIDE { return true; }
 
+  //! @return true if current object was initialized
+  virtual bool IsValid() const Standard_OVERRIDE
+  {
+    return myBitmapList != 0
+        || myTextureId != NO_TEXTURE;
+  }
+
   //! @return true if this is display list bitmap
   inline Standard_Boolean IsDisplayList() const
   {
index c943f91..e024d39 100644 (file)
@@ -597,73 +597,57 @@ void OpenGl_PrimitiveArray::drawMarkers (const Handle(OpenGl_Workspace)& theWork
                          && aCtx->ActiveProgram()->HasTessellationStage()
                          ? GL_PATCHES
                          : myDrawMode;
-  if (anAspectMarker->HasPointSprite (aCtx))
+  if (anAspectMarker->Aspect()->MarkerType() == Aspect_TOM_POINT)
   {
-    // Textured markers will be drawn with the point sprites
     aCtx->SetPointSize (anAspectMarker->MarkerSize());
-    aCtx->SetPointSpriteOrigin();
-  #if !defined(GL_ES_VERSION_2_0)
-    if (aCtx->core11 != NULL)
-    {
-      aCtx->core11fwd->glEnable (GL_ALPHA_TEST);
-      aCtx->core11fwd->glAlphaFunc (GL_GEQUAL, 0.1f);
-    }
-  #endif
-
-    aCtx->core11fwd->glEnable (GL_BLEND);
-    aCtx->core11fwd->glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
     aCtx->core11fwd->glDrawArrays (aDrawMode, 0, !myVboAttribs.IsNull() ? myVboAttribs->GetElemsNb() : myAttribs->NbElements);
-
-    aCtx->core11fwd->glDisable (GL_BLEND);
-  #if !defined(GL_ES_VERSION_2_0)
-    if (aCtx->core11 != NULL)
-    {
-      if (aCtx->ShaderManager()->MaterialState().AlphaCutoff() >= ShortRealLast())
-      {
-        aCtx->core11fwd->glDisable (GL_ALPHA_TEST);
-      }
-      else
-      {
-        aCtx->core11fwd->glAlphaFunc (GL_GEQUAL, aCtx->ShaderManager()->MaterialState().AlphaCutoff());
-      }
-    }
-  #endif
     aCtx->SetPointSize (1.0f);
     return;
   }
-  else if (anAspectMarker->Aspect()->MarkerType() == Aspect_TOM_POINT)
+
+#if !defined(GL_ES_VERSION_2_0)
+  if (aCtx->core11 != NULL)
   {
+    aCtx->core11fwd->glEnable (GL_ALPHA_TEST);
+    aCtx->core11fwd->glAlphaFunc (GL_GEQUAL, 0.1f);
+  }
+#endif
+  aCtx->core11fwd->glEnable (GL_BLEND);
+  aCtx->core11fwd->glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+  if (anAspectMarker->HasPointSprite (aCtx))
+  {
+    // Textured markers will be drawn with the point sprites
     aCtx->SetPointSize (anAspectMarker->MarkerSize());
+    aCtx->SetPointSpriteOrigin();
+
     aCtx->core11fwd->glDrawArrays (aDrawMode, 0, !myVboAttribs.IsNull() ? myVboAttribs->GetElemsNb() : myAttribs->NbElements);
+
     aCtx->SetPointSize (1.0f);
   }
 #if !defined(GL_ES_VERSION_2_0)
   // Textured markers will be drawn with the glBitmap
-  else if (anAspectMarker->Aspect()->MarkerType() != Aspect_TOM_POINT)
+  else if (const Handle(OpenGl_PointSprite)& aSprite = anAspectMarker->SpriteRes (aCtx, theWorkspace->ToHighlight()))
   {
-    const Handle(OpenGl_PointSprite)& aSpriteNorm = anAspectMarker->SpriteRes (aCtx, false);
-    if (aSpriteNorm.IsNull())
+    for (Standard_Integer anIter = 0; anIter < myAttribs->NbElements; anIter++)
     {
-      return;
+      aCtx->core11->glRasterPos3fv (myAttribs->Value<Graphic3d_Vec3> (anIter).GetData());
+      aSprite->DrawBitmap (theWorkspace->GetGlContext());
     }
+  }
+#endif
 
-    /**if (!isHilight && (myPArray->vcolours != NULL))
+  aCtx->core11fwd->glDisable (GL_BLEND);
+#if !defined(GL_ES_VERSION_2_0)
+  if (aCtx->core11 != NULL)
+  {
+    if (aCtx->ShaderManager()->MaterialState().AlphaCutoff() >= ShortRealLast())
     {
-      for (Standard_Integer anIter = 0; anIter < myAttribs->NbElements; anIter++)
-      {
-        glColor4ubv    (myPArray->vcolours[anIter].GetData());
-        glRasterPos3fv (myAttribs->Value<Graphic3d_Vec3> (anIter).GetData());
-        aSpriteNorm->DrawBitmap (theWorkspace->GetGlContext());
-      }
+      aCtx->core11fwd->glDisable (GL_ALPHA_TEST);
     }
-    else*/
+    else
     {
-      for (Standard_Integer anIter = 0; anIter < myAttribs->NbElements; anIter++)
-      {
-        aCtx->core11->glRasterPos3fv (myAttribs->Value<Graphic3d_Vec3> (anIter).GetData());
-        aSpriteNorm->DrawBitmap (theWorkspace->GetGlContext());
-      }
+      aCtx->core11fwd->glAlphaFunc (GL_GEQUAL, aCtx->ShaderManager()->MaterialState().AlphaCutoff());
     }
   }
 #endif
index 8fe1db9..459c8ab 100644 (file)
@@ -49,7 +49,7 @@ public:
   Standard_EXPORT virtual ~OpenGl_Texture();
 
   //! @return true if current object was initialized
-  bool IsValid() const { return myTextureId != NO_TEXTURE; }
+  virtual bool IsValid() const { return myTextureId != NO_TEXTURE; }
 
   //! @return target to which the texture is bound (GL_TEXTURE_1D, GL_TEXTURE_2D)
   GLenum GetTarget() const { return myTarget; }