media

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 15 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageDiffResult

type ImageDiffResult struct {
	Width         int     `json:"width"`
	Height        int     `json:"height"`
	PixelsTotal   int     `json:"pixels_total"`
	PixelsChanged int     `json:"pixels_changed"`
	DiffRatio     float64 `json:"diff_ratio"`
	DiffPath      string  `json:"diff_path,omitempty"`
	Skipped       bool    `json:"skipped,omitempty"`
	SkipReason    string  `json:"skip_reason,omitempty"`
}

ImageDiffResult summarises a pixel-by-pixel comparison.

func DiffImages

func DiffImages(baselinePNG, currentPNG []byte, tolerance int, diffPath string) (*ImageDiffResult, error)

DiffImages compares two images pixel by pixel. When dimensions differ, the result is flagged Skipped so the caller can decide (usually: fail or use the new image as the new baseline).

If diffPath is non-empty, a PNG is written there highlighting every pixel where delta >= tolerance in red (original otherwise).

type ScreenRecorder

type ScreenRecorder struct {
	// contains filtered or unexported fields
}

func NewScreenRecorder

func NewScreenRecorder(page *rod.Page, opts ScreenRecorderOpts) *ScreenRecorder

func (*ScreenRecorder) FrameCount

func (r *ScreenRecorder) FrameCount() int64

func (*ScreenRecorder) OutputDir

func (r *ScreenRecorder) OutputDir() string

func (*ScreenRecorder) Start

func (r *ScreenRecorder) Start() error

func (*ScreenRecorder) Stop

func (r *ScreenRecorder) Stop() int64

type ScreenRecorderOpts

type ScreenRecorderOpts struct {
	OutputDir string
	Quality   int
	MaxWidth  int
	MaxHeight int
	NthFrame  int
}

Jump to

Keyboard shortcuts

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