stream

package
v0.0.0-...-8b9bf4e Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

type Stream struct {
	io.Reader
	// contains filtered or unexported fields
}

Stream contains information about a loaded image.

func EncodeGif

func EncodeGif(img *gif.GIF) Stream

EncodeGif encodes a gif into a stream.

func EncodeImage

func EncodeImage(img image.Image) Stream

EncodeImage encodes an image into a stream.

func NewStream

func NewStream(stream io.Reader) Stream

NewStream creates a new stream.

func (*Stream) Bytes

func (st *Stream) Bytes() []byte

Bytes returns the stream's bytes.

func (*Stream) DecodeGif

func (st *Stream) DecodeGif() *gif.GIF

DecodeGif decodes the byte stream and returns a gif.

func (*Stream) DecodeImage

func (st *Stream) DecodeImage() image.Image

DecodeImage decodes the byte stream and returns an image.

func (*Stream) FileExt

func (st *Stream) FileExt() string

FileExt returns the file extension of the image.

func (*Stream) IsGif

func (st *Stream) IsGif() bool

IsGif returns true if the loaded image is a gif.

func (*Stream) IsJpg

func (st *Stream) IsJpg() bool

IsJpg returns true if the loaded image is a Jpeg.

func (*Stream) IsPng

func (st *Stream) IsPng() bool

IsPng returns true if the loaded image is a Png.

func (*Stream) Read

func (st *Stream) Read(b []byte) (n int, err error)

Read implements the io.Reader interface for the Stream.

Jump to

Keyboard shortcuts

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