getPixel() public method

public getPixel ( float x, float y ) : uint
x float
y float
return uint
Ejemplo n.º 1
0
 /**
  *
  * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlanePointFsCanvas::fillRegions()
  * @param x
  * @param y
  * @return coordinates of nearest Site to (x, y)
  *
  */
 public PointF NearestSitePointF(BitmapData proximityMap, float x, float y)
 {
     uint index = proximityMap.getPixel(x, y);
     if (index > _sites.Count - 1)
     {
         return PointF.Empty;
     }
     return _sites[(int)index].Coord();
 }
Ejemplo n.º 2
0
 /**
  *
  * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlaneVector2sCanvas::fillRegions()
  * @param x
  * @param y
  * @return coordinates of nearest Site to (x, y)
  *
  */
 public Vector2 NearestSiteVector2(BitmapData proximityMap, float x, float y)
 {
     uint index = proximityMap.getPixel(x, y);
     if (index > _sites.Count - 1)
     {
         return Vector2.zero;
     }
     return _sites[(int)index].Coord();
 }
Ejemplo n.º 3
0
        /**
         *
         * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlanePointFsCanvas::fillRegions()
         * @param x
         * @param y
         * @return coordinates of nearest Site to (x, y)
         *
         */
        public PointF NearestSitePointF(BitmapData proximityMap, float x, float y)
        {
            uint index = proximityMap.getPixel(x, y);

            if (index > _sites.Count - 1)
            {
                return(PointF.Empty);
            }
            return(_sites[(int)index].Coord());
        }
Ejemplo n.º 4
0
        public List <uint> SiteColors(BitmapData referenceImage)
        {
            List <uint> colors = new List <uint>();

            foreach (Site site in _sites)
            {
                colors.Add(referenceImage != null ? referenceImage.getPixel(site.X, site.Y) : site.color);
            }
            return(colors);
        }
Ejemplo n.º 5
0
        /**
         *
         * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlaneVector2sCanvas::fillRegions()
         * @param x
         * @param y
         * @return coordinates of nearest Site to (x, y)
         *
         */
        public Vector2 NearestSiteVector2(BitmapData proximityMap, float x, float y)
        {
            uint index = proximityMap.getPixel(x, y);

            if (index > _sites.Count - 1)
            {
                return(Vector2.zero);
            }
            return(_sites[(int)index].Coord());
        }
Ejemplo n.º 6
0
 public List<uint> SiteColors(BitmapData referenceImage)
 {
     List<uint> colors = new List<uint>();
     foreach (Site site in _sites)
     {
         colors.Add(referenceImage != null ? referenceImage.getPixel(site.X, site.Y) : site.color);
     }
     return colors;
 }