render

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

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

Canvas represents a rendering canvas with all necessary configuration

func NewCanvas

func NewCanvas() *Canvas

NewCanvas creates a new Canvas instance with default options

func (*Canvas) RenderToImage

func (c *Canvas) RenderToImage() (image.Image, error)

RenderToImage renders an image using the given chrome, background, and content; all of which are optional, but at least one is required

func (*Canvas) SaveAsBMP added in v0.7.0

func (c *Canvas) SaveAsBMP(filename string) error

SaveAsBMP saves an image to a file in BMP format

func (*Canvas) SaveAsJPEG added in v0.7.0

func (c *Canvas) SaveAsJPEG(filename string) error

SaveAsJPEG saves an image to a file in JPEG format

func (*Canvas) SaveAsPNG added in v0.7.0

func (c *Canvas) SaveAsPNG(filename string) error

SaveAsPNG saves an image to a file in PNG format

func (*Canvas) SaveAsSVG added in v0.7.0

func (c *Canvas) SaveAsSVG(filename string) error

SaveAsSVG saves an image to a file in SVG format

func (*Canvas) WithBackground added in v0.7.0

func (c *Canvas) WithBackground(bg background.Background) *Canvas

WithBackground sets the background renderer

func (*Canvas) WithChrome added in v0.7.0

func (c *Canvas) WithChrome(chrome chrome.Chrome) *Canvas

WithChrome sets the chrome renderer

func (*Canvas) WithContent added in v0.7.0

func (c *Canvas) WithContent(content content.Content) *Canvas

WithContent sets the content renderer

Jump to

Keyboard shortcuts

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