struct CrImage::Region
- CrImage::Region
- Struct
- Value
- Object
Overview
Represents a rectangular area on an Image from its upper left corner #x and #y coordinates, and a #width and #height.
See Operation::Crop#crop and Operation::Draw#draw_square for examples using it.
Defined in:
cr-image/region.crConstructors
- .center(x : UInt16, y : UInt16, width : UInt16, height : UInt16) : Region
- .new(x : UInt16, y : UInt16, width : UInt16, height : UInt16)
Instance Method Summary
-
#center : Tuple(Int32, Int32)
Return the
{x, y}tuple of the center coordinates of thisRegion - #clone
- #copy_with(x _x = @x, y _y = @y, width _width = @width, height _height = @height)
-
#crop(image : Image) : Image
Crop a provided
Imagewith this region, usingOperation::Crop#crop - #height : UInt16
- #to_tuple : Tuple(Int32, Int32, Int32, Int32)
- #width : UInt16
- #x : UInt16
- #y : UInt16
Constructor Detail
Instance Method Detail
def copy_with(x _x = @x, y _y = @y, width _width = @width, height _height = @height)
#
Crop a provided Image with this region, using Operation::Crop#crop
def to_tuple : Tuple(Int32, Int32, Int32, Int32)
#