Versions in this module Expand all Collapse all v0 v0.1.1 Aug 28, 2026 v0.1.0 Aug 25, 2026 Changes in this version + const DefaultFPS + const DefaultQueueDepth + const MaxDimension + const MinQueueDepth + var ErrClosed = errors.New("screencapture: stream is closed") + var ErrInvalidOption = errors.New("screencapture: invalid option") + var ErrNoDisplay = errors.New("screencapture: no capturable display") + var ErrNoFrame = errors.New("screencapture: no frame available") + var ErrNotFound = errors.New("screencapture: no such display or window") + var ErrPermissionDenied = errors.New(...) + var ErrShortBuffer = errors.New("screencapture: destination buffer too short") + var ErrUnsupported = errors.New("screencapture: unsupported on this platform (macOS 12.3 or later only)") + func Authorized() bool + func Available() bool + func RequestAuthorization() bool + type Application struct + BundleID string + Name string + PID int32 + type Content struct + Applications []Application + Displays []Display + Windows []Window + func CurrentProcessShareable(ctx context.Context) (*Content, error) + func Shareable(ctx context.Context) (*Content, error) + func (c *Content) Display(id uint32) (Display, error) + func (c *Content) MainDisplay() (Display, error) + func (c *Content) Window(id uint32) (Window, error) + func (c *Content) WindowsByTitle(title string) []Window + func (c *Content) WindowsOfPID(pid int32) []Window + type Display struct + Frame Rect + Height int + ID uint32 + Main bool + PixelHeight int + PixelWidth int + Width int + func Displays(ctx context.Context) ([]Display, error) + func (d Display) Scale() float64 + func (d Display) String() string + type Frame struct + At time.Time + Height int + Pix []byte + Seq uint64 + Stride int + Width int + func (f Frame) CopyTight(dst []byte) (int, error) + func (f Frame) NRGBA() (*image.NRGBA, error) + func (f Frame) Row(y int) []byte + func (f Frame) TightLen() int + func (f Frame) Valid() bool + type Options struct + ExcludeWindows []uint32 + FPS float64 + Height int + QueueDepth int + ScalesToFit bool + ShowsCursor bool + Width int + func (o Options) Validate() error + type PixelFormat uint32 + const FormatBGRA + func (f PixelFormat) BytesPerPixel() int + func (f PixelFormat) String() string + type Rect struct + H float64 + W float64 + X float64 + Y float64 + func (r Rect) Empty() bool + func (r Rect) String() string + type Stats struct + Frames uint64 + Idle uint64 + Interval time.Duration + Last time.Time + Superseded uint64 + func (s Stats) FPS() float64 + type Stream struct + func CaptureDisplay(ctx context.Context, d Display, opt Options) (*Stream, error) + func CaptureWindow(ctx context.Context, w Window, opt Options) (*Stream, error) + func (s *Stream) Close() error + func (s *Stream) Err() error + func (s *Stream) Frame() (Frame, bool) + func (s *Stream) Options() Options + func (s *Stream) Source() string + func (s *Stream) Stats() Stats + func (s *Stream) WaitFrame(ctx context.Context) (Frame, error) + type StreamError struct + Code int + Message string + Name string + Op string + func (e *StreamError) Error() string + func (e *StreamError) Unwrap() error + type Window struct + Active bool + AppName string + BundleID string + Frame Rect + ID uint32 + Layer int + OnScreen bool + PID int32 + Title string + func Windows(ctx context.Context) ([]Window, error) + func (w Window) String() string