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