f32

package
v0.0.0-...-a9b3df6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: MIT, Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Package f32 is an internal version of the public package f32 with extra types for internal use.

Index

Constants

This section is empty.

Variables

View Source
var NewAffine2D = f32.NewAffine2D
View Source
var Pt = f32.Pt

Pt is shorthand for Point{X: x, Y: y}.

Functions

This section is empty.

Types

type Affine2D

type Affine2D = f32.Affine2D

type Point

type Point = f32.Point

func FPt

func FPt(p image.Point) Point

Fpt converts an point to a f32.Point.

type Rectangle

type Rectangle struct {
	Min, Max Point
}

A Rectangle contains the points (X, Y) where Min.X <= X < Max.X, Min.Y <= Y < Max.Y.

func FRect

func FRect(r image.Rectangle) Rectangle

fRect converts a rectangle to a f32internal.Rectangle.

func Rect

func Rect(x0, y0, x1, y1 float32) Rectangle

Rect is a shorthand for Rectangle{Point{x0, y0}, Point{x1, y1}}. The returned Rectangle has x0 and y0 swapped if necessary so that it's correctly formed.

func (Rectangle) Add

func (r Rectangle) Add(p Point) Rectangle

Add offsets r with the vector p.

func (Rectangle) Canon

func (r Rectangle) Canon() Rectangle

Canon returns the canonical version of r, where Min is to the upper left of Max.

func (Rectangle) Dx

func (r Rectangle) Dx() float32

Dx returns r's width.

func (Rectangle) Dy

func (r Rectangle) Dy() float32

Dy returns r's Height.

func (Rectangle) Empty

func (r Rectangle) Empty() bool

Empty reports whether r represents the empty area.

func (Rectangle) Intersect

func (r Rectangle) Intersect(s Rectangle) Rectangle

Intersect returns the intersection of r and s.

func (Rectangle) Round

func (r Rectangle) Round() image.Rectangle

Round returns the smallest integer rectangle that contains r.

func (Rectangle) Size

func (r Rectangle) Size() Point

Size returns r's width and height.

func (Rectangle) String

func (r Rectangle) String() string

String return a string representation of r.

func (Rectangle) Sub

func (r Rectangle) Sub(p Point) Rectangle

Sub offsets r with the vector -p.

func (Rectangle) Union

func (r Rectangle) Union(s Rectangle) Rectangle

Union returns the union of r and s.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL