types

package
v0.0.0-...-674b7f4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package types provides pdfcpu's base types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y float64
}

Point represents a user space location.

func (Point) String

func (p Point) String() string

func (*Point) Translate

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

Translate modifies p's coordinates.

type Rectangle

type Rectangle struct {
	LL, UR Point
}

Rectangle represents a rectangular region in userspace.

func NewRectangle

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

NewRectangle returns a new rectangle for given corner coordinates.

func (Rectangle) AspectRatio

func (r Rectangle) AspectRatio() float64

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

func (Rectangle) Center

func (r Rectangle) Center() Point

Center returns the center point of a rectangle.

func (Rectangle) Contains

func (r Rectangle) Contains(p Point) bool

Contains returns true if rectangle r contains point p.

func (Rectangle) Height

func (r Rectangle) Height() float64

Height returns the vertical span of a rectangle in userspace.

func (Rectangle) Landscape

func (r Rectangle) Landscape() bool

Landscape returns true if r is in landscape mode.

func (Rectangle) Portrait

func (r Rectangle) Portrait() bool

Portrait returns true if r is in portrait mode.

func (Rectangle) ShortString

func (r Rectangle) ShortString() string

ShortString returns a compact string representation for r.

func (Rectangle) String

func (r Rectangle) String() string

func (Rectangle) Width

func (r Rectangle) Width() float64

Width returns the horizontal span of a rectangle in userspace.

Jump to

Keyboard shortcuts

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