eimage

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportOutcome

type ExportOutcome interface {
	eidiom.Outcome

	IsUnsupportedFormat() bool
	IsEncodeFailure() bool
	IsWriteFailure() bool
}

func NewExportOutcomeEncodeFailure

func NewExportOutcomeEncodeFailure(err error) ExportOutcome

func NewExportOutcomeSuccess

func NewExportOutcomeSuccess() ExportOutcome

func NewExportOutcomeUnsupportedFormat

func NewExportOutcomeUnsupportedFormat(given ImageFormat) ExportOutcome

func NewExportOutcomeWriteFailure

func NewExportOutcomeWriteFailure(err error) ExportOutcome

type Image

type Image interface {
	Bounds() egeom.Rectangle

	GetPixel(p egeom.Point) ecolor.Color

	// SetPixel update the pixel. Nothing happens if `p` is out of bounds.
	SetPixel(p egeom.Point, c ecolor.Color)

	// GoImageRGBA returns the image instance of image.RGBA
	GoImageRGBA() *image.RGBA

	// Deprecated: ExportTo exports file to the file. This func will change method signature in the future
	ExportTo(format ImageFormat, path string) ExportOutcome
}

Image is a mutable instance

func NewRgba

func NewRgba(width, height int) Image

type ImageFormat

type ImageFormat int
const (
	FormatPng ImageFormat = iota
	FormatJpeg
)

Jump to

Keyboard shortcuts

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