/// <summary> /// Initializes a new instance of the <c>ImageClippingBoundary</c> class as a rectangular clipping boundary. /// </summary> /// <param name="x">Rectangle x-coordinate of the top-left corner in image local coordinates.</param> /// <param name="y">Rectangle y-coordinate of the top-left corner in image local coordinates.</param> /// <param name="width">Rectangle width in image local coordinates.</param> /// <param name="height">Rectangle height in image local coordinates.</param> public ImageClippingBoundary(double x, double y, double width, double height) { this.type = ImageClippingBoundaryType.Rectangular; this.vertexes = new List <Vector2> { new Vector2(x, y), new Vector2(x + width, y + height) }; }
/// <summary> /// Initializes a new instance of the <c>ImageClippingBoundary</c> class as a rectangular clipping boundary. /// </summary> /// <param name="topLeftCorner">Rectangle top-left corner in image local coordinates.</param> /// <param name="bottomRightCorner">Rectangle bottom-right corner in image local coordinates.</param> public ImageClippingBoundary(Vector2 topLeftCorner, Vector2 bottomRightCorner) { this.type = ImageClippingBoundaryType.Rectangular; this.vertexes = new List <Vector2> { topLeftCorner, bottomRightCorner }; }
/// <summary> /// Initializes a new instance of the <c>ImageClippingBoundary</c> class as a polygonal clipping boundary. /// </summary> /// <param name="vertexes">The list of vertexes of the polygonal boundary.</param> public ImageClippingBoundary(List <Vector2> vertexes) { if (vertexes.Count < 3) { throw new ArgumentException("The number of vertexes for the polygonal clipping boundary must be equal or greater than three.", "vertexes"); } this.type = ImageClippingBoundaryType.Polygonal; this.vertexes = vertexes; }
private ImageClippingBoundary(ImageClippingBoundaryType type, List <Vector2> vertexes) { this.type = type; this.vertexes = vertexes; }
/// <summary> /// Initializes a new instance of the <c>ImageClippingBoundary</c> class as a polygonal clipping boundary. /// </summary> /// <param name="vertexes">The list of vertexes of the polygonal boundary.</param> public ImageClippingBoundary(List<Vector2> vertexes) { if (vertexes.Count < 3) throw new ArgumentException("The number of vertexes for the polygonal clipping boundary must be equal or greater than three.", "vertexes"); this.type = ImageClippingBoundaryType.Polygonal; this.vertexes = vertexes; }
/// <summary> /// Initializes a new instance of the <c>ImageClippingBoundary</c> class as a rectangular clipping boundary. /// </summary> /// <param name="topLeftCorner">Rectangle top-left corner in image local coordinates.</param> /// <param name="bottomRightCorner">Rectangle bottom-right corner in image local coordinates.</param> public ImageClippingBoundary(Vector2 topLeftCorner, Vector2 bottomRightCorner) { this.type = ImageClippingBoundaryType.Rectangular; this.vertexes = new List<Vector2> { topLeftCorner, bottomRightCorner }; }
/// <summary> /// Initializes a new instance of the <c>ImageClippingBoundary</c> class as a rectangular clipping boundary. /// </summary> /// <param name="x">Rectangle x-coordinate of the top-left corner in image local coordinates.</param> /// <param name="y">Rectangle y-coordinate of the top-left corner in image local coordinates.</param> /// <param name="width">Rectangle width in image local coordinates.</param> /// <param name="height">Rectangle height in image local coordinates.</param> public ImageClippingBoundary(double x, double y, double width, double height) { this.type = ImageClippingBoundaryType.Rectangular; this.vertexes = new List<Vector2> { new Vector2(x, y), new Vector2(x + width, y + height) }; }
private ImageClippingBoundary(ImageClippingBoundaryType type, List<Vector2> vertexes) { this.type = type; this.vertexes = vertexes; }