/** * * @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(); }
/** * * @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(); }
/** * * @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()); }
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); }
/** * * @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()); }
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; }