image

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbedJPEG

func EmbedJPEG(w pdf.Putter, src image.Image, opts *jpeg.Options, resName pdf.Name) (*graphics.XObject, error)

EmbedJPEG writes the image src to the PDF file w, using lossy compression.

func EmbedPNG

func EmbedPNG(w pdf.Putter, src image.Image, resName pdf.Name) (*graphics.XObject, error)

EmbedPNG writes the image `src` to the PDF file w, using a lossless representation very similar to the PNG format.

Types

type Image

type Image interface {
	Embed(w pdf.Putter, defaultName pdf.Name) (*graphics.XObject, error)
	Bounds() Rectangle
}

Image represents a raster image which can be embedded in a PDF file.

func JPEG

func JPEG(src image.Image, opts *jpeg.Options) (Image, error)

func PNG

func PNG(src image.Image) (Image, error)

type Rectangle

type Rectangle struct {
	XMin, YMin, XMax, YMax int
}

Rectangle gives the dimensions of an image.

func (Rectangle) Dx

func (r Rectangle) Dx() int

Dx returns the width of the rectangle.

func (Rectangle) Dy

func (r Rectangle) Dy() int

Dy returns the height of the rectangle.

Jump to

Keyboard shortcuts

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