imgext

package
v0.0.0-...-1bcdf7b Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package imgext is package extension of go proprietary image package thanks to https://github.com/dkolbly/wl/blob/master/ui/bgra.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BGRA

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

BGRA is like RGBA but in wayland's byte order

func ConvertRGBAToBGRA

func ConvertRGBAToBGRA(rgba *image.RGBA) *BGRA

ConvertRGBAToBGRA converts *image.RGBA into *imgext.BGRA

func NewBGRA

func NewBGRA(r image.Rectangle) *BGRA

NewBGRA returns a new BGRA image with the given bounds.

func NewBGRAWithData

func NewBGRAWithData(r image.Rectangle, data []uint8) *BGRA

func (*BGRA) At

func (p *BGRA) At(x, y int) color.Color

func (*BGRA) Bounds

func (p *BGRA) Bounds() image.Rectangle

func (*BGRA) ColorModel

func (p *BGRA) ColorModel() color.Model

func (*BGRA) Opaque

func (p *BGRA) Opaque() bool

Opaque scans the entire image and reports whether it is fully opaque.

func (*BGRA) Painter

func (p *BGRA) Painter() *BGRAPainter

func (*BGRA) PixOffset

func (p *BGRA) PixOffset(x, y int) int

PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).

func (*BGRA) RGBAAt

func (p *BGRA) RGBAAt(x, y int) color.RGBA

func (*BGRA) Set

func (p *BGRA) Set(x, y int, c color.Color)

func (*BGRA) SetRGBA

func (p *BGRA) SetRGBA(x, y int, c color.RGBA)

func (*BGRA) SubImage

func (p *BGRA) SubImage(r image.Rectangle) image.Image

SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.

type BGRAPainter

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

a BGRAPainter is used to interface with the freetype renderer and raster library

func (*BGRAPainter) Paint

func (p *BGRAPainter) Paint(spans []raster.Span, done bool)

func (*BGRAPainter) SetColor

func (p *BGRAPainter) SetColor(c color.Color)

Jump to

Keyboard shortcuts

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