|
@@ -20,31 +20,39 @@ namespace bbiwarg.Graphics
|
|
|
Image = new Image<Rgb, byte>(width, height);
|
|
|
}
|
|
|
|
|
|
- public void drawLineSegment(bbiwarg.Utility.LineSegment2D lineSegment, byte r, byte g, byte b, int thickness = 1)
|
|
|
+ public Color getColotAt(int x, int y) {
|
|
|
+
|
|
|
+ byte red = Image.Data[y, x, 0];
|
|
|
+ byte green = Image.Data[y, x, 1];
|
|
|
+ byte blue = Image.Data[y, x, 2];
|
|
|
+ return Color.FromArgb(red,green,blue);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void drawLineSegment(bbiwarg.Utility.LineSegment2D lineSegment, Color color, int thickness = 1)
|
|
|
{
|
|
|
- Image.Draw(new LineSegment2D(lineSegment.P1, lineSegment.P2), new Rgb(r, g, b), thickness);
|
|
|
+ Image.Draw(new LineSegment2D(lineSegment.P1, lineSegment.P2), new Rgb(color), thickness);
|
|
|
}
|
|
|
|
|
|
- public void drawContour(Contour<Point> contour, byte r, byte g, byte b, int thickness = 1)
|
|
|
+ public void drawContour(Contour<Point> contour, Color color, int thickness = 1)
|
|
|
{
|
|
|
- Image.Draw(contour, new Rgb(r, g, b), thickness);
|
|
|
+ Image.Draw(contour, new Rgb(color), thickness);
|
|
|
}
|
|
|
|
|
|
- public void drawPoints(Seq<Point> points, byte r, byte g, byte b, int thickness = 1)
|
|
|
+ public void drawPoints(Seq<Point> points, Color color, int thickness = 1)
|
|
|
{
|
|
|
- Image.Draw(points, new Rgb(r, g, b), thickness);
|
|
|
+ Image.Draw(points, new Rgb(color), thickness);
|
|
|
}
|
|
|
|
|
|
- public void drawPixel(int x, int y, byte r, byte g, byte b)
|
|
|
+ public void drawPixel(int x, int y, Color color)
|
|
|
{
|
|
|
- Image.Data[y, x, 0] = r;
|
|
|
- Image.Data[y, x, 1] = g;
|
|
|
- Image.Data[y, x, 2] = b;
|
|
|
+ Image.Data[y, x, 0] = color.R;
|
|
|
+ Image.Data[y, x, 1] = color.G;
|
|
|
+ Image.Data[y, x, 2] = color.B;
|
|
|
}
|
|
|
|
|
|
- public void fillCircle(int x, int y, float radius, byte r, byte g, byte b)
|
|
|
+ public void fillCircle(int x, int y, float radius, Color color)
|
|
|
{
|
|
|
- Image.Draw(new CircleF(new PointF(x, y), radius), new Rgb(r, g, b), 0);
|
|
|
+ Image.Draw(new CircleF(new PointF(x, y), radius), new Rgb(color), 0);
|
|
|
}
|
|
|
}
|
|
|
}
|