bmp

package
v0.0.0-...-cd2df2e Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("bmp: unsupported BMP image")

ErrUnsupported means that the input BMP image uses a valid but unsupported feature.

Functions

This section is empty.

Types

type BGRADecoder

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

BGRADecoder is used to decode an BGRA BMP image of the same size as the one used for construction.

func NewBGRADecoder

func NewBGRADecoder() *BGRADecoder

NewBGRADecoder returns a new BGRADecoder.

func (*BGRADecoder) Decode

func (dec *BGRADecoder) Decode(src []byte, dst *NBGRA) (*NBGRA, error)

Decode reads an BGRA BMP image from r and write it to dst (if not nil). If dst is nil, then a new one is allocated. If topDown is false, the image rows will be read bottom-up.

type Config

type Config struct {
	image.Config
	BPP        int
	TopDown    bool
	AllowAlpha bool
}

Config extends image.Config to add BMP image config.

func DecodeConfig

func DecodeConfig(r io.Reader) (Config, error)

DecodeConfig returns the color model and dimensions of a BMP image without decoding the entire image. Limitation: The file must be 8, 24 or 32 bits per pixel.

type NBGRA

type NBGRA struct {
	Pix    []uint8
	Stride int
	Rect   image.Rectangle
}

NBGRA holds an alpha-premultiplied 32-bit BGRA image.

func NewNBGRA

func NewNBGRA(r image.Rectangle) *NBGRA

NewNBGRA returns a new NBGRA image with the given bounds.

Jump to

Keyboard shortcuts

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