Documentation ¶
Overview ¶
Package yuyv provides support for the YUYV format.
Index ¶
- Constants
- func ToGray(dst *image.Gray, r image.Rectangle, src *Image, p image.Point)
- func ToRGBA(dst *image.RGBA, r image.Rectangle, src *Image, p image.Point)
- func ToYCbCr(dst *image.YCbCr, r image.Rectangle, src *Image, p image.Point)
- type Image
- func (img *Image) At(x, y int) color.Color
- func (img *Image) Bounds() image.Rectangle
- func (img *Image) CbOffset(x, y int) int
- func (img *Image) ColorModel() color.Model
- func (img *Image) CrOffset(x, y int) int
- func (img *Image) Opaque() bool
- func (img *Image) PixPairOffset(x, y int) int
- func (img *Image) SubImage(rect image.Rectangle) image.Image
- func (img *Image) YCbCrAt(x, y int) color.YCbCr
- func (img *Image) YOffset(x, y int) int
Constants ¶
const FourCC = 'Y' | 'U'<<8 | 'Y'<<16 | 'V'<<24
FourCC of the YUYV format.
Variables ¶
This section is empty.
Functions ¶
func ToGray ¶
ToGray aligns r.Min in dst with p in src, and draws the part of src visible through r over src.
It's several times faster than the image/draw package.
Types ¶
type Image ¶
type Image struct { // Pix holds the pixel data. Every four bytes corresponds to a pair of // horizontally adjacent pixels. The two pixels have separate luma values // and shared chroma. The sample order is Y0, Cb, Y1, Cr. Pix []uint8 // Stride is the distance in bytes between vertically adjacent pixels. // Line y starts at index (y-Rect.Min.Y)*Stride. Stride int // Rect is the bounds of the image. Rect image.Rectangle }
An Image is an in-memory YUYV image. It implements the image.Image interface.
func (*Image) CbOffset ¶
CbOffset returns the index at which the Cb component of the pixel at (x, y) is located in Pix.
func (*Image) ColorModel ¶
ColorModel returns color.YCbCrModel.
func (*Image) CrOffset ¶
CrOffset returns the index at which the Cr component of the pixel at (x, y) is located in Pix.
func (*Image) PixPairOffset ¶
PixPairOffset returns the index of the first element in Pix that corresponds to the pixel pair to which (x, y) belongs.
func (*Image) SubImage ¶
SubImage returns an image representing the portion of img visible through rect. The returned value shares pixels with the original image.