pic

package module
v0.0.0-...-1c0aea8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 2 Imported by: 0

README

pic GoDoc

It's a simple and convenient alternative to the *image.RGBA API. See the godoc for the detailed description.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Picture

type Picture struct {
	Orig   *Picture
	Rect   image.Rectangle
	Pix    []byte
	Stride int
	// contains filtered or unexported fields
}

Picture is an alternative to the official *image.RGBA.

func CreatePictureFromRGBA

func CreatePictureFromRGBA(imgRGBA *image.RGBA) *Picture

CreatePictureFromRGBA creates a new picture from the given RGBA image with copying the data.

func NewPictureFromRGBA

func NewPictureFromRGBA(imgRGBA *image.RGBA) *Picture

NewPictureFromRGBA creates a new picture from the given RGBA image without copying the data.

func (*Picture) At

func (pic *Picture) At(x, y int) color.RGBA

At returns the color of the pixel located at the specified position.

func (*Picture) ContainsSubPicture

func (pic *Picture) ContainsSubPicture(other *Picture) (int, int)

ContainsSubPicture returns the coordinates of the upper-left-most entry of the specified subpicture in the given picture, or (-1; -1) if the given picture doesn't contain the subpicture.

func (*Picture) CreateImageRGBAFromPicture

func (pic *Picture) CreateImageRGBAFromPicture() *image.RGBA

CreateImageRGBAFromPicture creates a new instance of *image.RGBA and copies the data of the original picture to the new image.

func (*Picture) Equals

func (pic *Picture) Equals(other *Picture) bool

Equals returns 'true' if the picture equals another one, and 'false' otherwise.

func (*Picture) NewImageRGBAFromPicture

func (pic *Picture) NewImageRGBAFromPicture() *image.RGBA

NewImageRGBAFromPicture creates a new instance of *image.RGBA without copying the data of the original picture.

func (*Picture) SubPicture

func (pic *Picture) SubPicture(rect image.Rectangle) *Picture

SubPicture returns a new picture based on the given picture.

Copies the data of the original picture to the derivative one.

The new picture will not have any connection to the base one.

func (*Picture) SubPictureRelative

func (pic *Picture) SubPictureRelative(rect image.Rectangle) *Picture

SubPictureRelative creates a new picture based on the given one but without copying the data.

Jump to

Keyboard shortcuts

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