struct Point
pub struct Point {
pub x int
pub y int
}Purpose
2D geometric point (x, y).
Public fields
xint- value
yint- value
#imagePoint / Rectangle / RGBA pixel buffer.
struct Pointpub struct Point {
pub x int
pub y int
}2D geometric point (x, y).
x inty intstruct Rectanglepub struct Rectangle {
pub min Point
pub max Point
}2D axis-aligned rectangle bounded by min and max.
min Pointmax Pointstruct RGBApub struct RGBA {
pub pix []int
pub stride int
pub rect Rectangle
}32-bit RGBA pixel image buffer in contiguous memory.
pix []intstride intrect Rectanglestruct RGBA8pub struct RGBA8 {
pub pix []u8
pub stride int
pub rect Rectangle
}Structure encapsulating pix, stride, rect.
pix []u8stride intrect Rectanglestruct RGB24pub struct RGB24 {
pub pix []u8
pub stride int
pub rect Rectangle
}Structure encapsulating pix, stride, rect.
pix []u8stride intrect Rectanglestruct Gray8pub struct Gray8 {
pub pix []u8
pub stride int
pub rect Rectangle
}Structure encapsulating pix, stride, rect.
pix []u8stride intrect Rectangleptpub fn pt(x int, y int) PointConstruct a 2D Point{x, y} from coordinates.
x inty intPoint struct instance
rectpub fn rect(x0 int, y0 int, x1 int, y1 int) RectangleConstruct a Rectangle from coordinates (x0, y0) to (x1, y1).
x0 inty0 intx1 inty1 intRectangle struct instance
(Point) addpub fn (p Point) add(q Point) PointOperation on Point: add.
p PointPoint instance used by this call (value receiver).q PointPoint — a value of this type
(Point) subpub fn (p Point) sub(q Point) PointOperation on Point: subtract.
p PointPoint instance used by this call (value receiver).q PointPoint — a value of this type
(Point) eqpub fn (p Point) eq(q Point) boolReport whether this object equals the other.
p PointPoint instance used by this call (value receiver).q Pointbool — true or false
(Point) in_rectpub fn (p Point) in_rect(r Rectangle) boolReport whether the point lies inside the given rectangle.
p PointPoint instance used by this call (value receiver).r Rectanglebool — true or false
(Rectangle) dxpub fn (r Rectangle) dx() intCompute horizontal span (max.x - min.x).
r RectangleRectangle instance used by this call (value receiver).int — a value of this type
(Rectangle) dypub fn (r Rectangle) dy() intCompute vertical span (max.y - min.y).
r RectangleRectangle instance used by this call (value receiver).int — a value of this type
(Rectangle) emptypub fn (r Rectangle) empty() boolReport whether the geometry rectangle is empty (dx <= 0 or dy <= 0).
r RectangleRectangle instance used by this call (value receiver).bool — true or false
(Rectangle) eqpub fn (r Rectangle) eq(s Rectangle) boolReport whether this object equals the other.
r RectangleRectangle instance used by this call (value receiver).s Rectanglebool — true or false
(Rectangle) overlapspub fn (r Rectangle) overlaps(s Rectangle) boolReport whether this rectangle overlaps with the other.
r RectangleRectangle instance used by this call (value receiver).s Rectanglebool — true or false
(Rectangle) addpub fn (r Rectangle) add(p Point) RectangleOperation on Rectangle: add.
r RectangleRectangle instance used by this call (value receiver).p PointRectangle — a value of this type
(Rectangle) intersectpub fn (r Rectangle) intersect(s Rectangle) RectangleCompute the intersection rectangle of the two.
r RectangleRectangle instance used by this call (value receiver).s RectangleRectangle — a value of this type
(Rectangle) unionpub fn (r Rectangle) union(s Rectangle) RectangleCompute the minimal bounding union rectangle containing both.
r RectangleRectangle instance used by this call (value receiver).s RectangleRectangle — a value of this type
(Rectangle) canonpub fn (r Rectangle) canon() RectangleReturn canonical rectangle ensuring min <= max.
r RectangleRectangle instance used by this call (value receiver).Rectangle — a value of this type
new_rgbapub fn new_rgba(r Rectangle) RGBAConstruct rgba.
r RectangleRGBA — a value of this type
(RGBA) pix_offsetpub fn (p RGBA) pix_offset(x int, y int) intOperation on RGBA: pix offset.
p RGBARGBA instance used by this call (value receiver).x inty intint — a value of this type
($&RGBA) set_rgbapub fn (p $&RGBA) set_rgba(x int, y int, c color.RGBA)Operation on $&RGBA: set rgba.
p $&RGBARGBA instance used by this call (exclusive borrow).x inty intc color.RGBAThis call does not return a value.
(RGBA) at_rgbapub fn (p RGBA) at_rgba(x int, y int) color.RGBAOperation on RGBA: at rgba.
p RGBARGBA instance used by this call (value receiver).x inty intcolor.RGBA — a value of this type
new_rgba8pub fn new_rgba8(r Rectangle) RGBA8Construct rgba8.
r RectangleRGBA8 — a value of this type
new_rgb24pub fn new_rgb24(r Rectangle) RGB24Construct rgb24.
r RectangleRGB24 — a value of this type
new_gray8pub fn new_gray8(r Rectangle) Gray8Construct gray8.
r RectangleGray8 — a value of this type
(&RGBA8) pix_offsetpub fn (p &RGBA8) pix_offset(x int, y int) intOperation on &RGBA8: pix offset.
p &RGBA8RGBA8 instance used by this call (borrow).x inty intint — a value of this type
($&RGBA8) set_rgbapub fn (p $&RGBA8) set_rgba(x int, y int, c color.RGBA)Operation on $&RGBA8: set rgba.
p $&RGBA8RGBA8 instance used by this call (exclusive borrow).x inty intc color.RGBAThis call does not return a value.
($&RGBA8) set_rgba_u8pub fn (p $&RGBA8) set_rgba_u8(x int, y int, r u8, g u8, b u8, a u8)Operation on $&RGBA8: set rgba u8.
p $&RGBA8RGBA8 instance used by this call (exclusive borrow).x inty intr u8g u8b u8a u8This call does not return a value.
(&RGBA8) at_rgbapub fn (p &RGBA8) at_rgba(x int, y int) color.RGBAOperation on &RGBA8: at rgba.
p &RGBA8RGBA8 instance used by this call (borrow).x inty intcolor.RGBA — a value of this type
($&RGBA8) fill_rgbapub fn (p $&RGBA8) fill_rgba(r u8, g u8, b u8, a u8)Operation on $&RGBA8: fill rgba.
p $&RGBA8RGBA8 instance used by this call (exclusive borrow).r u8g u8b u8a u8This call does not return a value.
(&RGBA8) to_rgbapub fn (p &RGBA8) to_rgba() RGBAOperation on &RGBA8: convert to rgba.
p &RGBA8RGBA8 instance used by this call (borrow).RGBA — a value of this type
rgba8_from_rgbapub fn rgba8_from_rgba(src &RGBA) RGBA8Rgba8 from rgba.
src &RGBARGBA8 — a value of this type
(&RGB24) pix_offsetpub fn (p &RGB24) pix_offset(x int, y int) intOperation on &RGB24: pix offset.
p &RGB24RGB24 instance used by this call (borrow).x inty intint — a value of this type
($&RGB24) set_rgbpub fn (p $&RGB24) set_rgb(x int, y int, r u8, g u8, b u8)Operation on $&RGB24: set rgb.
p $&RGB24RGB24 instance used by this call (exclusive borrow).x inty intr u8g u8b u8This call does not return a value.
(&RGB24) at_rgbapub fn (p &RGB24) at_rgba(x int, y int) color.RGBAOperation on &RGB24: at rgba.
p &RGB24RGB24 instance used by this call (borrow).x inty intcolor.RGBA — a value of this type
(&Gray8) pix_offsetpub fn (p &Gray8) pix_offset(x int, y int) intOperation on &Gray8: pix offset.
p &Gray8Gray8 instance used by this call (borrow).x inty intint — a value of this type
($&Gray8) set_ypub fn (p $&Gray8) set_y(x int, y int, v u8)Operation on $&Gray8: set y.
p $&Gray8Gray8 instance used by this call (exclusive borrow).x inty intv u8This call does not return a value.
(&Gray8) at_ypub fn (p &Gray8) at_y(x int, y int) u8Operation on &Gray8: at y.
p &Gray8Gray8 instance used by this call (borrow).x inty intu8 — a value of this type