frame

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 8 Imported by: 0

README

Special thanks to https://github.com/dialup-inc/ascii for I420 and NV21 decoder implementations.

Documentation

Index

Constants

View Source
const (
	// FormatI420 https://wiki.videolan.org/YUV#I420
	FormatI420 Format = "I420"
	// FormatI444 is a YUV format without sub-sampling
	FormatI444 Format = "I444"
	// FormatNV21 https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-nv12.html
	FormatNV21 = "NV21"
	// FormatNV12 https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-nv12.html
	FormatNV12 = "NV12"
	// FormatYUY2 https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-yuyv.html
	// YUY2 is what Windows calls YUYV
	FormatYUY2 = "YUY2"
	// FormatYUYV https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-yuyv.html
	FormatYUYV = "YUYV"
	// FormatUYVY https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-uyvy.html
	FormatUYVY = "UYVY"

	// FormatRGBA https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-rgb.html
	FormatRGBA  Format = "RGBA"
	FormatRGB24 Format = "RGB24"

	// FormatMJPEG https://wiki.videolan.org/MJPEG
	FormatMJPEG = "MJPEG"

	// FormatZ16 https://www.kernel.org/doc/html/v5.9/userspace-api/media/v4l/pixfmt-z16.html
	FormatZ16 = "Z16"
)

Variables

View Source
var UninitializedHuffmanTable = []byte{} /* 31516 elements not displayed */

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode(frame []byte, width, height int) (image.Image, func(), error)
}

func NewDecoder

func NewDecoder(f Format) (Decoder, error)

type Format

type Format string

type RGB24Img

type RGB24Img struct {
	// Pix holds the image's pixels, in R, G, B order. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y) + (x-Rect.Min.X)*3].
	Pix    []uint8
	Rect   image.Rectangle
	Stride int
}

func (*RGB24Img) At

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

func (*RGB24Img) Bounds

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

func (*RGB24Img) ColorModel

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

func (*RGB24Img) PixOffset

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

Jump to

Keyboard shortcuts

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