package fixed

Import Path
	golang.org/x/image/math/fixed (on go.dev)

Dependency Relation
	imports one package, and imported by 7 packages

Involved Source Files Package fixed implements fixed-point integer types.
Package-Level Type Names (total 6)
/* sort by: | */
Int26_6 is a signed 26.6 fixed-point number. The integer part ranges from -33554432 to 33554431, inclusive. The fractional part has 6 bits of precision. For example, the number one-and-a-quarter is Int26_6(1<<6 + 1<<4). Ceil returns the least integer value greater than or equal to x. Its return type is int, not Int26_6. Floor returns the greatest integer value less than or equal to x. Its return type is int, not Int26_6. Mul returns x*y in 26.6 fixed-point arithmetic. Round returns the nearest integer value to x. Ties are rounded up. Its return type is int, not Int26_6. String returns a human-readable representation of a 26.6 fixed-point number. For example, the number one-and-a-quarter becomes "1:16". Int26_6 : expvar.Var Int26_6 : fmt.Stringer func I(i int) Int26_6 func Int26_6.Mul(y Int26_6) Int26_6 func golang.org/x/image/font.BoundBytes(f font.Face, s []byte) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.BoundString(f font.Face, s string) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.MeasureBytes(f font.Face, s []byte) (advance Int26_6) func golang.org/x/image/font.MeasureString(f font.Face, s string) (advance Int26_6) func golang.org/x/image/font.(*Drawer).BoundBytes(s []byte) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.(*Drawer).BoundString(s string) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.(*Drawer).MeasureBytes(s []byte) (advance Int26_6) func golang.org/x/image/font.(*Drawer).MeasureString(s string) (advance Int26_6) func golang.org/x/image/font.Face.Glyph(dot Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance Int26_6, ok bool) func golang.org/x/image/font.Face.GlyphAdvance(r rune) (advance Int26_6, ok bool) func golang.org/x/image/font.Face.GlyphBounds(r rune) (bounds Rectangle26_6, advance Int26_6, ok bool) func golang.org/x/image/font.Face.Kern(r0, r1 rune) Int26_6 func golang.org/x/image/font/opentype.(*Face).Glyph(dot Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance Int26_6, ok bool) func golang.org/x/image/font/opentype.(*Face).GlyphAdvance(r rune) (advance Int26_6, ok bool) func golang.org/x/image/font/opentype.(*Face).GlyphBounds(r rune) (bounds Rectangle26_6, advance Int26_6, ok bool) func golang.org/x/image/font/opentype.(*Face).Kern(r0, r1 rune) Int26_6 func golang.org/x/image/font/sfnt.(*Font).GlyphAdvance(b *sfnt.Buffer, x sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (Int26_6, error) func golang.org/x/image/font/sfnt.(*Font).GlyphBounds(b *sfnt.Buffer, x sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (bounds Rectangle26_6, advance Int26_6, err error) func golang.org/x/image/font/sfnt.(*Font).Kern(b *sfnt.Buffer, x0, x1 sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (Int26_6, error) func github.com/golang/freetype/truetype.(*Font).Kern(scale Int26_6, i0, i1 truetype.Index) Int26_6 func Int26_6.Mul(y Int26_6) Int26_6 func Point26_6.Div(k Int26_6) Point26_6 func Point26_6.Mul(k Int26_6) Point26_6 func golang.org/x/image/font/sfnt.(*Font).Bounds(b *sfnt.Buffer, ppem Int26_6, h font.Hinting) (Rectangle26_6, error) func golang.org/x/image/font/sfnt.(*Font).GlyphAdvance(b *sfnt.Buffer, x sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (Int26_6, error) func golang.org/x/image/font/sfnt.(*Font).GlyphBounds(b *sfnt.Buffer, x sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (bounds Rectangle26_6, advance Int26_6, err error) func golang.org/x/image/font/sfnt.(*Font).Kern(b *sfnt.Buffer, x0, x1 sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (Int26_6, error) func golang.org/x/image/font/sfnt.(*Font).LoadGlyph(b *sfnt.Buffer, x sfnt.GlyphIndex, ppem Int26_6, opts *sfnt.LoadGlyphOptions) (sfnt.Segments, error) func golang.org/x/image/font/sfnt.(*Font).Metrics(b *sfnt.Buffer, ppem Int26_6, h font.Hinting) (font.Metrics, error) func github.com/golang/freetype/raster.Stroke(p raster.Adder, q raster.Path, width Int26_6, cr raster.Capper, jr raster.Joiner) func github.com/golang/freetype/raster.Capper.Cap(p raster.Adder, halfWidth Int26_6, pivot, n1 Point26_6) func github.com/golang/freetype/raster.CapperFunc.Cap(p raster.Adder, halfWidth Int26_6, pivot, n1 Point26_6) func github.com/golang/freetype/raster.Joiner.Join(lhs, rhs raster.Adder, halfWidth Int26_6, pivot, n0, n1 Point26_6) func github.com/golang/freetype/raster.JoinerFunc.Join(lhs, rhs raster.Adder, halfWidth Int26_6, pivot, n0, n1 Point26_6) func github.com/golang/freetype/raster.(*Path).AddStroke(q raster.Path, width Int26_6, cr raster.Capper, jr raster.Joiner) func github.com/golang/freetype/raster.(*Rasterizer).AddStroke(q raster.Path, width Int26_6, cr raster.Capper, jr raster.Joiner) func github.com/golang/freetype/truetype.(*Font).Bounds(scale Int26_6) Rectangle26_6 func github.com/golang/freetype/truetype.(*Font).HMetric(scale Int26_6, i truetype.Index) truetype.HMetric func github.com/golang/freetype/truetype.(*Font).Kern(scale Int26_6, i0, i1 truetype.Index) Int26_6 func github.com/golang/freetype/truetype.(*Font).VMetric(scale Int26_6, i truetype.Index) truetype.VMetric func github.com/golang/freetype/truetype.(*GlyphBuf).Load(f *truetype.Font, scale Int26_6, i truetype.Index, h font.Hinting) error
Int52_12 is a signed 52.12 fixed-point number. The integer part ranges from -2251799813685248 to 2251799813685247, inclusive. The fractional part has 12 bits of precision. For example, the number one-and-a-quarter is Int52_12(1<<12 + 1<<10). Ceil returns the least integer value greater than or equal to x. Its return type is int, not Int52_12. Floor returns the greatest integer value less than or equal to x. Its return type is int, not Int52_12. Mul returns x*y in 52.12 fixed-point arithmetic. Round returns the nearest integer value to x. Ties are rounded up. Its return type is int, not Int52_12. String returns a human-readable representation of a 52.12 fixed-point number. For example, the number one-and-a-quarter becomes "1:1024". Int52_12 : expvar.Var Int52_12 : fmt.Stringer func Int52_12.Mul(y Int52_12) Int52_12 func Int52_12.Mul(y Int52_12) Int52_12 func Point52_12.Div(k Int52_12) Point52_12 func Point52_12.Mul(k Int52_12) Point52_12
Point26_6 is a 26.6 fixed-point coordinate pair. It is analogous to the image.Point type in the standard library. X Int26_6 Y Int26_6 Add returns the vector p+q. Div returns the vector p/k. In returns whether p is in r. Mul returns the vector p*k. Sub returns the vector p-q. func P(x, y int) Point26_6 func Point26_6.Add(q Point26_6) Point26_6 func Point26_6.Div(k Int26_6) Point26_6 func Point26_6.Mul(k Int26_6) Point26_6 func Point26_6.Sub(q Point26_6) Point26_6 func Point26_6.Add(q Point26_6) Point26_6 func Point26_6.Sub(q Point26_6) Point26_6 func Rectangle26_6.Add(p Point26_6) Rectangle26_6 func Rectangle26_6.Sub(p Point26_6) Rectangle26_6 func golang.org/x/image/font.Face.Glyph(dot Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance Int26_6, ok bool) func golang.org/x/image/font/opentype.(*Face).Glyph(dot Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance Int26_6, ok bool) func github.com/golang/freetype/raster.Adder.Add1(b Point26_6) func github.com/golang/freetype/raster.Adder.Add2(b, c Point26_6) func github.com/golang/freetype/raster.Adder.Add3(b, c, d Point26_6) func github.com/golang/freetype/raster.Adder.Start(a Point26_6) func github.com/golang/freetype/raster.Capper.Cap(p raster.Adder, halfWidth Int26_6, pivot, n1 Point26_6) func github.com/golang/freetype/raster.CapperFunc.Cap(p raster.Adder, halfWidth Int26_6, pivot, n1 Point26_6) func github.com/golang/freetype/raster.Joiner.Join(lhs, rhs raster.Adder, halfWidth Int26_6, pivot, n0, n1 Point26_6) func github.com/golang/freetype/raster.JoinerFunc.Join(lhs, rhs raster.Adder, halfWidth Int26_6, pivot, n0, n1 Point26_6) func github.com/golang/freetype/raster.(*Path).Add1(b Point26_6) func github.com/golang/freetype/raster.(*Path).Add2(b, c Point26_6) func github.com/golang/freetype/raster.(*Path).Add3(b, c, d Point26_6) func github.com/golang/freetype/raster.(*Path).Start(a Point26_6) func github.com/golang/freetype/raster.(*Rasterizer).Add1(b Point26_6) func github.com/golang/freetype/raster.(*Rasterizer).Add2(b, c Point26_6) func github.com/golang/freetype/raster.(*Rasterizer).Add3(b, c, d Point26_6) func github.com/golang/freetype/raster.(*Rasterizer).Start(a Point26_6)
Point52_12 is a 52.12 fixed-point coordinate pair. It is analogous to the image.Point type in the standard library. X Int52_12 Y Int52_12 Add returns the vector p+q. Div returns the vector p/k. In returns whether p is in r. Mul returns the vector p*k. Sub returns the vector p-q. func Point52_12.Add(q Point52_12) Point52_12 func Point52_12.Div(k Int52_12) Point52_12 func Point52_12.Mul(k Int52_12) Point52_12 func Point52_12.Sub(q Point52_12) Point52_12 func Point52_12.Add(q Point52_12) Point52_12 func Point52_12.Sub(q Point52_12) Point52_12 func Rectangle52_12.Add(p Point52_12) Rectangle52_12 func Rectangle52_12.Sub(p Point52_12) Rectangle52_12
Rectangle26_6 is a 26.6 fixed-point coordinate rectangle. The Min bound is inclusive and the Max bound is exclusive. It is well-formed if Min.X <= Max.X and likewise for Y. It is analogous to the image.Rectangle type in the standard library. Max Point26_6 Min Point26_6 Add returns the rectangle r translated by p. Empty returns whether the rectangle contains no points. In returns whether every point in r is in s. 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. Sub returns the rectangle r translated by -p. Union returns the smallest rectangle that contains both r and s. func R(minX, minY, maxX, maxY int) Rectangle26_6 func Rectangle26_6.Add(p Point26_6) Rectangle26_6 func Rectangle26_6.Intersect(s Rectangle26_6) Rectangle26_6 func Rectangle26_6.Sub(p Point26_6) Rectangle26_6 func Rectangle26_6.Union(s Rectangle26_6) Rectangle26_6 func golang.org/x/image/font.BoundBytes(f font.Face, s []byte) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.BoundString(f font.Face, s string) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.(*Drawer).BoundBytes(s []byte) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.(*Drawer).BoundString(s string) (bounds Rectangle26_6, advance Int26_6) func golang.org/x/image/font.Face.GlyphBounds(r rune) (bounds Rectangle26_6, advance Int26_6, ok bool) func golang.org/x/image/font/opentype.(*Face).GlyphBounds(r rune) (bounds Rectangle26_6, advance Int26_6, ok bool) func golang.org/x/image/font/sfnt.(*Font).Bounds(b *sfnt.Buffer, ppem Int26_6, h font.Hinting) (Rectangle26_6, error) func golang.org/x/image/font/sfnt.(*Font).GlyphBounds(b *sfnt.Buffer, x sfnt.GlyphIndex, ppem Int26_6, h font.Hinting) (bounds Rectangle26_6, advance Int26_6, err error) func golang.org/x/image/font/sfnt.Segments.Bounds() (bounds Rectangle26_6) func github.com/golang/freetype/truetype.(*Font).Bounds(scale Int26_6) Rectangle26_6 func Point26_6.In(r Rectangle26_6) bool func Rectangle26_6.In(s Rectangle26_6) bool func Rectangle26_6.Intersect(s Rectangle26_6) Rectangle26_6 func Rectangle26_6.Union(s Rectangle26_6) Rectangle26_6
Rectangle52_12 is a 52.12 fixed-point coordinate rectangle. The Min bound is inclusive and the Max bound is exclusive. It is well-formed if Min.X <= Max.X and likewise for Y. It is analogous to the image.Rectangle type in the standard library. Max Point52_12 Min Point52_12 Add returns the rectangle r translated by p. Empty returns whether the rectangle contains no points. In returns whether every point in r is in s. 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. Sub returns the rectangle r translated by -p. Union returns the smallest rectangle that contains both r and s. func Rectangle52_12.Add(p Point52_12) Rectangle52_12 func Rectangle52_12.Intersect(s Rectangle52_12) Rectangle52_12 func Rectangle52_12.Sub(p Point52_12) Rectangle52_12 func Rectangle52_12.Union(s Rectangle52_12) Rectangle52_12 func Point52_12.In(r Rectangle52_12) bool func Rectangle52_12.In(s Rectangle52_12) bool func Rectangle52_12.Intersect(s Rectangle52_12) Rectangle52_12 func Rectangle52_12.Union(s Rectangle52_12) Rectangle52_12
Package-Level Functions (total 3)
I returns the integer value i as an Int26_6. For example, passing the integer value 2 yields Int26_6(128).
P returns the integer values x and y as a Point26_6. For example, passing the integer values (2, -3) yields Point26_6{128, -192}.
R returns the integer values minX, minY, maxX, maxY as a Rectangle26_6. For example, passing the integer values (0, 1, 2, 3) yields Rectangle26_6{Point26_6{0, 64}, Point26_6{128, 192}}. Like the image.Rect function in the standard library, the returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed.