fatamorgana

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 12 Imported by: 0

README

fatamorgana

Documentation

Index

Constants

View Source
const Version = "v0.5.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type CropRectangle added in v0.4.0

type CropRectangle interface {
	SubImage(image.Rectangle) image.Image
}

type Encode

type Encode func(io.Writer, image.Image) error
var (
	JPEGEncoder Encode = jpegEncoder()
	PNGEncoder  Encode = pngEncoder()
)

type Image

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

Image is a data struct which embeds Go standard image library.

func DecodeBase64

func DecodeBase64(decoded string) (*Image, error)

func NewImage

func NewImage(img image.Image) *Image

NewImage returns a new Image struct.

func NewImageWithExtension added in v0.3.0

func NewImageWithExtension(img image.Image, ext string) *Image

func Open

func Open(path string) (*Image, error)

func (*Image) Base64

func (p *Image) Base64() (string, error)

func (*Image) Bytes

func (p *Image) Bytes() ([]byte, error)

func (*Image) Crop added in v0.4.0

func (p *Image) Crop(minX, minY, maxX, maxY int) image.Image

func (*Image) Data added in v0.2.0

func (p *Image) Data() image.Image

func (*Image) Format

func (p *Image) Format() string

func (*Image) Grayscale

func (p *Image) Grayscale(method grayscale.MethodType) *Image

func (*Image) Inverse

func (p *Image) Inverse() *Image

Monochrome converts given

func (*Image) MimeType

func (p *Image) MimeType() string

func (*Image) Monochrome

func (p *Image) Monochrome(method grayscale.MethodType, threshold uint8) *Image

Monochrome converts given

func (*Image) MonochromeAdaptive

func (p *Image) MonochromeAdaptive(thresholds [][]uint8) *Image

Monochrome converts given

func (*Image) Save

func (p *Image) Save(path, filename string) error

type ImageType

type ImageType int
const (
	UNKOWN ImageType = iota
	JPEG
	PNG
)

func (ImageType) String

func (e ImageType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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