This is the pixel buffer library of the grapho
-set of crates.
There is also:
grapho-color
: describes the color primitives used by thegrapho
crates and does color conversiongrapho-2d
: describes all kinds of 2D vector graphics and math (like polygon clipping)grapho-rasterize-2d
: 2D rasterizer for the vectors described ingrapho-2d
grapho-filters
: pixel based effects and filters for pixel buffersgrapho-cv
: computer vision library for grapho stackgrapho-3d
: 3D vector math
grapho-bitplane
describes the pixel buffer primitives that are used for creating and modifying images.
It will contain color conversion functionality and can work on arbitrary interleaved or non-interleaved
graphics data.
Conversion from all color-plane types into all others will be implemented. Currently the following bitplane types are implemented:
RGB
,BGR
24 bit without alphaRGBA
,ARGB
,BGRA
,ABGR
32 bit with alpha
Y
Simple, single Y plane for monochrome images.Yxx
3 bytes, ignore the last two (interpret a YUV444 image as grayscale)Yx
andxY
, 2 bytes, ignore the x (interpret a YUV422 image as grayscale)
UYVY
YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1u32
.YUY2
/YUV422
YUV 4:2:2 as forUYVY
but with different component ordering within theu32
macropixel.YVYU
YUV 4:2:2 as forUYVY
but with different component ordering within theu32
macropixel.VYUY
YUV 4:2:2 as forUYVY
but with different component ordering within theu32
macropixel.
YUV
/YUV444
YUV 4:4:4, 3 bytes per pixel, full resolution U and V planes.VUY
likeYUV
but with different component orderingUVY
likeYUV
but with different component orderingYVU
likeYUV
but with different component ordering
YV21
/I420
8 bit Y plane followed by 8 bit 2x2 subsampled U and V planes.YV12
8 bit Y plane followed by 8 bit 2x2 subsampled V and U planes.
NV12
8-bit Y plane followed by an interleaved U/V plane with 2x2 subsamplingNV21
As NV12 with U and V reversed in the interleaved plane
YCoCg444i
interleaved with strideYCoCg444p
3 planes no subsamplingYCoCg422p
3 planes, Co and Cg half size subsampledYCoCg422i
interleaved, Co and Cg half size subsampled