internal override void Draw(ContentArea contentArea, ColorVariation colorVariation = ColorVariation.None) { Color color = GetColor <GridTile>(colorVariation); BasicShapes.DrawLine(1, color, contentArea.WorldToScreenCoordinates(lowerLeft), contentArea.WorldToScreenCoordinates(lowerRight), contentArea.SpriteBatch); BasicShapes.DrawLine(1, color, contentArea.WorldToScreenCoordinates(lowerRight), contentArea.WorldToScreenCoordinates(upperRight), contentArea.SpriteBatch); BasicShapes.DrawLine(1, color, contentArea.WorldToScreenCoordinates(lowerLeft), contentArea.WorldToScreenCoordinates(upperLeft), contentArea.SpriteBatch); BasicShapes.DrawLine(1, color, contentArea.WorldToScreenCoordinates(upperLeft), contentArea.WorldToScreenCoordinates(upperRight), contentArea.SpriteBatch); }
public static Mat Extract(Mat srcMat, ColorConversionCodes code, ColorVariation color) { // int a = Enum.GetNames(typeof(ColorConversion)).Length; ColorTable table; if (code == ColorConversionCodes.BGR2HSV) { switch (color) { // case ColorVariation.Black: // table = new ColorTable(0, 0, 0, 0, 0, 0); // break; // case ColorVariation.DarkRed: // table = new ColorTable(0, 0, 0, 0, 0, 0); // break; case ColorVariation.Green: table = new ColorTable(50, 70, 80, 255, 0, 255); break; // case ColorVariation.Orange: // table = new ColorTable(0, 0, 0, 0, 0, 0); // break; case ColorVariation.Red: table = new ColorTable(170, 10, 80, 255, 0, 255); break; case ColorVariation.Skin: table = new ColorTable(0, 10, 80, 255, 0, 255); break; // case ColorVariation.White: // table = new ColorTable(0, 0, 0, 0, 0, 0); // break; default: table = new ColorTable(0, 0, 0, 0, 0, 0); break; } return Extract( srcMat, code, table.ch1Lower, table.ch1Upper, table.ch2Lower, table.ch2Upper, table.ch3Lower, table.ch3Upper ); } else { throw new NotImplementedException("HSV 値以外を用いた抽出は実装されていません"); } }
private protected static Color GetColor <T>(ColorVariation colorVariation) where T : PointWidget { return(WidgetCache <T> .colors[colorVariation]); }
internal abstract void Draw(ContentArea contentArea, ColorVariation colorVariation = ColorVariation.None);