base

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colour

type Colour color.RGBA

Colour is a colour in the format #RGB, #RGBA, #RRGGBB, or #RRGGBBAA.

func (Colour) MarshalFlag

func (c Colour) MarshalFlag() (string, error)

MarshalFlag returns the string representation of a colour in the format #RRGGBBAA.

func (*Colour) UnmarshalFlag

func (c *Colour) UnmarshalFlag(value string) error

UnmarshalFlag parses a string representation of a colour in the format #RGB, #RGBA, #RRGGBB, or #RRGGBBAA.

type InputCommand

type InputCommand struct {
	// Input is the name of the input file.
	Input flags.Filename `short:"i" long:"input" description:"The name of the input file or - for STDIN" optional:"true" default:"-"`
}

InputCommand is the base command for commands that take an input file.

func (*InputCommand) ReadInput

func (cmd *InputCommand) ReadInput() (image.Image, error)

ReadInput reads the input image from the input stream.

type OutputCommand

type OutputCommand struct {
	// Output is the name of the output file.
	Output flags.Filename `short:"o" long:"output" description:"The name of the output file or - for STDOUT" optional:"true" default:"-"`
	// Format is the output format, if an output filename is not specified; it is used for chaining.
	Format string `` /* 160-byte string literal not displayed */
	// DPI is the image resolution in Dots Per Inch.
	DPI float64 `short:"d" long:"dpi" description:"The image resolution in DPI - Dots Per Inch" optional:"true" default:"72"`
}

OutputCommand is the base command for commands that produce an output file.

func (*OutputCommand) WriteOutput

func (cmd *OutputCommand) WriteOutput(img image.Image) error

OutputStream returns an io.Writer for the output file.

type Point

type Point struct {
	X, Y float64
}

Point is a 2D coordinate as floats.

func (Point) MarshalFlag

func (p Point) MarshalFlag() (string, error)

MarshalFlag returns the string representation of a point in the format "x,y".

func (*Point) UnmarshalFlag

func (p *Point) UnmarshalFlag(value string) error

UnmarshalFlag parses a string representation of a point in the format "x,y".

type Size

type Size struct {
	X, Y int
}

Size is a 2D coordinate.

func (Size) MarshalFlag

func (p Size) MarshalFlag() (string, error)

MarshalFlag returns the string representation of a size in the format "x,y".

func (*Size) UnmarshalFlag

func (p *Size) UnmarshalFlag(value string) error

UnmarshalFlag parses a string representation of a size in the format "x,y".

Jump to

Keyboard shortcuts

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