image

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package image implements creation of images from file and bytes.

Package image implements creation of images from file and bytes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAutoFromBytesRow

func NewAutoFromBytesRow(bytes []byte, extension extension.Type, ps ...props.Rect) core.Row

NewAutoFromBytesRow is responsible to create an instance of an Image wrapped in a automatic row.

func NewAutoFromFileRow

func NewAutoFromFileRow(path string, ps ...props.Rect) core.Row

NewAutoFromFileRow creates an Image wrapped in a Row whose height follows the image.

func NewFromBytes

func NewFromBytes(bytes []byte, extension extension.Type, ps ...props.Rect) core.Component

NewFromBytes is responsible to create an instance of an Image.

func NewFromBytesCol

func NewFromBytesCol(size int, bytes []byte, extension extension.Type, ps ...props.Rect) core.Col

NewFromBytesCol is responsible to create an instance of an Image wrapped in a Col.

func NewFromBytesRow

func NewFromBytesRow(height float64, bytes []byte, extension extension.Type, ps ...props.Rect) core.Row

NewFromBytesRow is responsible to create an instance of an Image wrapped in a Row.

func NewFromFile

func NewFromFile(path string, ps ...props.Rect) core.Component

NewFromFile is responsible to create an instance of an Image.

func NewFromFileCol

func NewFromFileCol(size int, path string, ps ...props.Rect) core.Col

NewFromFileCol is responsible to create an instance of an Image wrapped in a Col.

func NewFromFileRow

func NewFromFileRow(height float64, path string, ps ...props.Rect) core.Row

NewFromFileRow is responsible to create an instance of an Image wrapped in a Row.

Types

type BytesImage

type BytesImage struct {
	// contains filtered or unexported fields
}

BytesImage is a component that draws an image held in memory.

func (*BytesImage) GetHeight

func (b *BytesImage) GetHeight(provider core.Provider, cell *entity.Cell) float64

GetHeight returns the height that the image will have in the PDF

func (*BytesImage) GetStructure

func (b *BytesImage) GetStructure() *node.Node[core.Structure]

GetStructure returns the Structure of an Image.

func (*BytesImage) Render

func (b *BytesImage) Render(provider core.Provider, cell *entity.Cell)

Render renders an Image into a PDF context.

func (*BytesImage) SetConfig

func (b *BytesImage) SetConfig(config *entity.Config)

SetConfig sets the pdf config.

type FileImage

type FileImage struct {
	// contains filtered or unexported fields
}

FileImage is a component that draws an image read from a file path.

func (*FileImage) GetHeight

func (f *FileImage) GetHeight(provider core.Provider, cell *entity.Cell) float64

GetHeight returns the height that the image will have in the PDF

func (*FileImage) GetStructure

func (f *FileImage) GetStructure() *node.Node[core.Structure]

GetStructure returns the Structure of an Image.

func (*FileImage) Render

func (f *FileImage) Render(provider core.Provider, cell *entity.Cell)

Render renders an Image into a PDF context.

func (*FileImage) SetConfig

func (f *FileImage) SetConfig(config *entity.Config)

SetConfig sets the pdf config.

Jump to

Keyboard shortcuts

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