capture

package
v0.7.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 2 Imported by: 1 module, 1 package

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 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