capture

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package capture provides image conversion and processing utilities for VM screenshot workflows.

It converts CGImage data (BGRA pixel format) to Go image.Image values, generates visual diffs between successive frames, and encodes images to JPEG or PNG.

Basic usage:

img, err := capture.GoImageFromCGImage(cgImage, 0)
data, err := capture.EncodeJPEG(img, 80)

Index

Constants

This section is empty.

Variables

View Source
var EncodeJPEG = base.EncodeJPEG

EncodeJPEG encodes img as JPEG with quality.

View Source
var EncodePNG = base.EncodePNG

EncodePNG encodes img as PNG.

View Source
var GoImageFromCGImage = base.GoImageFromCGImage

GoImageFromCGImage converts a CGImageRef to a Go image.Image.

Functions

func GenerateDiff

func GenerateDiff(old, new image.Image) image.Image

GenerateDiff creates a diff image highlighting changes between two images.

func ScaleImage

func ScaleImage(img image.Image, scale float64) image.Image

ScaleImage resizes an image by scale using bilinear interpolation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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