pixconv

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pixconv converts the premultiplied RGBA frames the compositor produces into the pixel layouts native window systems want. It is shared by the X11 and Win32 shells and tested on every platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertRect

func ConvertRect(dst []byte, dstStride int, pix []byte, srcStride, ox, oy, x0, y0, x1, y1 int, rgbx bool)

ConvertRect copies the pixel rectangle [x0,x1)x[y0,y1) from a premultiplied RGBA image (pix, stride, origin ox,oy) into the shadow buffer (same window coordinates, dstStride bytes per row), swapping to BGRX unless rgbx is set.

func SwapRB

func SwapRB(dst, src []byte)

SwapRB converts premultiplied RGBA (bytes R,G,B,A) to the X server's little-endian 32-bpp TrueColor layout (bytes B,G,R,A; A is the ignored pad byte of a depth-24 visual). dst and src must have equal length, a multiple of 4. Two pixels are processed per 64-bit word when both slices are 8-byte aligned (the common case: row starts of Go images and of the page-aligned SHM segment); otherwise 32-bit/byte-wise paths are used.

func Unpremultiply

func Unpremultiply(pix []byte)

Unpremultiply converts premultiplied RGBA to straight (non-premultiplied) RGBA in place, as icon APIs expect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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