struct Point
pub struct Point {
pub x int
pub y int
}用途
公开结构体 `Point`。
参数
xint- 值
yint- 值
API
#imagePoint / Rectangle / RGBA 像素缓冲。
struct Pointpub struct Point {
pub x int
pub y int
}公开结构体 `Point`。
x inty intstruct Rectanglepub struct Rectangle {
pub min Point
pub max Point
}公开结构体 `Rectangle`。
min Pointmax Pointstruct RGBApub struct RGBA {
pub pix []int
pub stride int
pub rect Rectangle
}公开结构体 `RGBA`。
pix []intstride intrect Rectangleptpub fn pt(x int, y int) Point构造 Point。
x inty intPoint — 该类型的值
rectpub fn rect(x0 int, y0 int, x1 int, y1 int) Rectangle构造 Rectangle。
x0 inty0 intx1 inty1 intRectangle — 该类型的值
(Point) addpub fn (p Point) add(q Point) Point`Point` 上的方法:相加。
p Pointq PointPoint — 该类型的值
(Point) subpub fn (p Point) sub(q Point) Point`Point` 上的方法:相减。
p Pointq PointPoint — 该类型的值
(Point) eqpub fn (p Point) eq(q Point) bool在 `Point` 上调用 `eq`。
p Pointq Pointbool — 是否成立
(Point) in_rectpub fn (p Point) in_rect(r Rectangle) bool`Point` 上的方法:in矩形。
p Pointr Rectanglebool — 是否成立
(Rectangle) dxpub fn (r Rectangle) dx() int在 `Rectangle` 上调用 `dx`。
r Rectangleint — 该类型的值
(Rectangle) dypub fn (r Rectangle) dy() int在 `Rectangle` 上调用 `dy`。
r Rectangleint — 该类型的值
(Rectangle) emptypub fn (r Rectangle) empty() bool在 `Rectangle` 上调用 `empty`。
r Rectanglebool — 是否成立
(Rectangle) eqpub fn (r Rectangle) eq(s Rectangle) bool在 `Rectangle` 上调用 `eq`。
r Rectangles Rectanglebool — 是否成立
(Rectangle) overlapspub fn (r Rectangle) overlaps(s Rectangle) bool在 `Rectangle` 上调用 `overlaps`。
r Rectangles Rectanglebool — 是否成立
(Rectangle) addpub fn (r Rectangle) add(p Point) Rectangle`Rectangle` 上的方法:相加。
r Rectanglep PointRectangle — 该类型的值
(Rectangle) intersectpub fn (r Rectangle) intersect(s Rectangle) Rectangle在 `Rectangle` 上调用 `intersect`。
r Rectangles RectangleRectangle — 该类型的值
(Rectangle) unionpub fn (r Rectangle) union(s Rectangle) Rectangle在 `Rectangle` 上调用 `union`。
r Rectangles RectangleRectangle — 该类型的值
(Rectangle) canonpub fn (r Rectangle) canon() Rectangle在 `Rectangle` 上调用 `canon`。
r RectangleRectangle — 该类型的值
new_rgbapub fn new_rgba(r Rectangle) RGBA构造 rgba。
r RectangleRGBA — 该类型的值
(RGBA) pix_offsetpub fn (p RGBA) pix_offset(x int, y int) int`RGBA` 上的方法:pixoffset。
p RGBAx inty intint — 该类型的值
(&mut RGBA) set_rgbapub fn (p &mut RGBA) set_rgba(x int, y int, c color.RGBA)`&mut RGBA` 上的方法:设置 rgba。
p &mut RGBAx inty intc color.RGBA(RGBA) at_rgbapub fn (p RGBA) at_rgba(x int, y int) color.RGBA`RGBA` 上的方法:atrgba。
p RGBAx inty intcolor.RGBA — 该类型的值