type Point … // String returns a string representation of p like "(3,4)". func (p Point) String() string { … } // Add returns the vector p+q. func (p Point) Add(q Point) Point { … } // Sub returns the vector p-q. func (p Point) Sub(q Point) Point { … } // Mul returns the vector p*k. func (p Point) Mul(k int) Point { … } // Div returns the vector p/k. func (p Point) Div(k int) Point { … } // In reports whether p is in r. func (p Point) In(r Rectangle) bool { … } // Mod returns the point q in r such that p.X-q.X is a multiple of r's width // and p.Y-q.Y is a multiple of r's height. func (p Point) Mod(r Rectangle) Point { … } // Eq reports whether p and q are equal. func (p Point) Eq(q Point) bool { … } var ZP … // Pt is shorthand for [Point]{X, Y}. func Pt(X, Y int) Point { … } type Rectangle … // String returns a string representation of r like "(3,4)-(6,5)". func (r Rectangle) String() string { … } // Dx returns r's width. func (r Rectangle) Dx() int { … } // Dy returns r's height. func (r Rectangle) Dy() int { … } // Size returns r's width and height. func (r Rectangle) Size() Point { … } // Add returns the rectangle r translated by p. func (r Rectangle) Add(p Point) Rectangle { … } // Sub returns the rectangle r translated by -p. func (r Rectangle) Sub(p Point) Rectangle { … } // Inset returns the rectangle r inset by n, which may be negative. If either // of r's dimensions is less than 2*n then an empty rectangle near the center // of r will be returned. func (r Rectangle) Inset(n int) Rectangle { … } // Intersect returns the largest rectangle contained by both r and s. If the // two rectangles do not overlap then the zero rectangle will be returned. func (r Rectangle) Intersect(s Rectangle) Rectangle { … } // Union returns the smallest rectangle that contains both r and s. func (r Rectangle) Union(s Rectangle) Rectangle { … } // Empty reports whether the rectangle contains no points. func (r Rectangle) Empty() bool { … } // Eq reports whether r and s contain the same set of points. All empty // rectangles are considered equal. func (r Rectangle) Eq(s Rectangle) bool { … } // Overlaps reports whether r and s have a non-empty intersection. func (r Rectangle) Overlaps(s Rectangle) bool { … } // In reports whether every point in r is in s. func (r Rectangle) In(s Rectangle) bool { … } // Canon returns the canonical version of r. The returned rectangle has minimum // and maximum coordinates swapped if necessary so that it is well-formed. func (r Rectangle) Canon() Rectangle { … } // At implements the [Image] interface. func (r Rectangle) At(x, y int) color.Color { … } // RGBA64At implements the [RGBA64Image] interface. func (r Rectangle) RGBA64At(x, y int) color.RGBA64 { … } // Bounds implements the [Image] interface. func (r Rectangle) Bounds() Rectangle { … } // ColorModel implements the [Image] interface. func (r Rectangle) ColorModel() color.Model { … } var ZR … // Rect is shorthand for [Rectangle]{Pt(x0, y0), [Pt](x1, y1)}. The returned // rectangle has minimum and maximum coordinates swapped if necessary so that // it is well-formed. func Rect(x0, y0, x1, y1 int) Rectangle { … } // mul3NonNeg returns (x * y * z), unless at least one argument is negative or // if the computation overflows the int type, in which case it returns -1. func mul3NonNeg(x int, y int, z int) int { … } // add2NonNeg returns (x + y), unless at least one argument is negative or if // the computation overflows the int type, in which case it returns -1. func add2NonNeg(x int, y int) int { … }