pdfcpu: github.com/pdfcpu/pdfcpu/pkg/types Index | Files

package types

import "github.com/pdfcpu/pdfcpu/pkg/types"

Package types provides pdfcpu's base types.


Package Files


type Point Uses

type Point struct {
    X, Y float64

Point represents a user space location.

func (Point) String Uses

func (p Point) String() string

func (*Point) Translate Uses

func (p *Point) Translate(dx, dy float64)

Translate modifies p's coordinates.

type Rectangle Uses

type Rectangle struct {
    LL, UR Point

Rectangle represents a rectangular region in userspace.

func NewRectangle Uses

func NewRectangle(llx, lly, urx, ury float64) *Rectangle

NewRectangle returns a new rectangle for given corner coordinates.

func (Rectangle) AspectRatio Uses

func (r Rectangle) AspectRatio() float64

AspectRatio returns the relation between width and height of a rectangle.

func (Rectangle) Center Uses

func (r Rectangle) Center() Point

Center returns the center point of a rectangle.

func (Rectangle) Contains Uses

func (r Rectangle) Contains(p Point) bool

Contains returns true if rectangle r contains point p.

func (Rectangle) Height Uses

func (r Rectangle) Height() float64

Height returns the vertical span of a rectangle in userspace.

func (Rectangle) Landscape Uses

func (r Rectangle) Landscape() bool

Landscape returns true if r is in landscape mode.

func (Rectangle) Portrait Uses

func (r Rectangle) Portrait() bool

Portrait returns true if r is in portrait mode.

func (Rectangle) String Uses

func (r Rectangle) String() string

func (Rectangle) Width Uses

func (r Rectangle) Width() float64

Width returns the horizontal span of a rectangle in userspace.

Package types imports 1 packages (graph) and is imported by 5 packages. Updated 2020-05-29. Refresh now. Tools for package owners.