Documentation
¶
Index ¶
- Constants
- Variables
- func BufferToImage(buf *ShmBuffer) *image.RGBA
- func BufferToImageWithFormat(buf *ShmBuffer, format uint32) *image.RGBA
- func EncodeJPEG(w io.Writer, img image.Image, quality int) error
- func EncodePNG(w io.Writer, img image.Image) error
- func EncodePPM(w io.Writer, img *image.RGBA) error
- func GenerateFilename(format Format) string
- func GetFocusedMonitor() string
- func GetHyprlandMonitorGeometry(name string) (x, y, w, h int32, ok bool)
- func GetHyprlandMonitorScale(name string) float64
- func GetOutputDir() string
- func InverseTransform(transform int32) int32
- func RunNotifyActionListener(args []string)
- func SaveLastRegion(r Region) error
- func SaveState(state *PersistentState) error
- func SendNotification(result NotifyResult)
- func SetCompositorDWL()
- func SetDWLActiveOutput(name string)
- func WriteToFile(buf *ShmBuffer, path string, format Format, quality int) error
- func WriteToFileWithFormat(buf *ShmBuffer, path string, format Format, quality int, pixelFormat uint32) error
- type CaptureResult
- type ColorScheme
- type ColorsFile
- type Compositor
- type Config
- type Format
- type Mode
- type NotifyResult
- type Output
- type OutputSurface
- type OverlayStyle
- type PersistentState
- type PixelFormat
- type PreCapture
- type Region
- type RegionSelector
- type RenderSlot
- type Screenshoter
- type SelectionState
- type ShmBuffer
- type ThemeColors
- type WaylandOutput
- type WindowGeometry
Constants ¶
View Source
const ( FormatARGB8888 = shm.FormatARGB8888 FormatXRGB8888 = shm.FormatXRGB8888 FormatABGR8888 = shm.FormatABGR8888 FormatXBGR8888 = shm.FormatXBGR8888 FormatRGB888 = shm.FormatRGB888 FormatBGR888 = shm.FormatBGR888 )
View Source
const ( TransformNormal = shm.TransformNormal Transform90 = shm.Transform90 Transform180 = shm.Transform180 Transform270 = shm.Transform270 TransformFlipped = shm.TransformFlipped TransformFlipped90 = shm.TransformFlipped90 TransformFlipped180 = shm.TransformFlipped180 TransformFlipped270 = shm.TransformFlipped270 )
Variables ¶
View Source
var DefaultOverlayStyle = OverlayStyle{
BackgroundR: 30, BackgroundG: 30, BackgroundB: 30, BackgroundA: 220,
TextR: 255, TextG: 255, TextB: 255,
AccentR: 100, AccentG: 180, AccentB: 255,
}
Functions ¶
func BufferToImage ¶
func BufferToImageWithFormat ¶
func GenerateFilename ¶
func GetFocusedMonitor ¶
func GetFocusedMonitor() string
func GetHyprlandMonitorScale ¶
func GetOutputDir ¶
func GetOutputDir() string
func InverseTransform ¶
func RunNotifyActionListener ¶
func RunNotifyActionListener(args []string)
func SaveLastRegion ¶
func SaveState ¶
func SaveState(state *PersistentState) error
func SendNotification ¶
func SendNotification(result NotifyResult)
func SetCompositorDWL ¶
func SetCompositorDWL()
func SetDWLActiveOutput ¶
func SetDWLActiveOutput(name string)
Types ¶
type CaptureResult ¶
type ColorScheme ¶
type ColorScheme struct {
Dark ThemeColors `json:"dark"`
Light ThemeColors `json:"light"`
}
type ColorsFile ¶
type ColorsFile struct {
Colors ColorScheme `json:"colors"`
}
type Compositor ¶
type Compositor int
const ( CompositorUnknown Compositor = iota CompositorHyprland CompositorSway CompositorNiri CompositorDWL CompositorScroll CompositorMiracle )
func DetectCompositor ¶
func DetectCompositor() Compositor
type Config ¶
type Config struct {
Mode Mode
OutputName string
IncludeCursor bool
Format Format
Quality int
OutputDir string
Filename string
Clipboard bool
SaveFile bool
Notify bool
Stdout bool
}
func DefaultConfig ¶
func DefaultConfig() Config
type NotifyResult ¶
type Output ¶
type Output struct {
Name string
X, Y int32
Width int32
Height int32
Scale int32
FractionalScale float64
Transform int32
}
func ListOutputs ¶
type OutputSurface ¶
type OutputSurface struct {
// contains filtered or unexported fields
}
type OverlayStyle ¶
type OverlayStyle struct {
BackgroundR, BackgroundG, BackgroundB, BackgroundA uint8
TextR, TextG, TextB uint8
AccentR, AccentG, AccentB uint8
}
func LoadOverlayStyle ¶
func LoadOverlayStyle() OverlayStyle
type PersistentState ¶
type PersistentState struct {
LastRegion Region `json:"last_region"`
}
func LoadState ¶
func LoadState() (*PersistentState, error)
type PixelFormat ¶
type PixelFormat = shm.PixelFormat
type PreCapture ¶
type PreCapture struct {
// contains filtered or unexported fields
}
type Region ¶
type Region struct {
X int32 `json:"x"`
Y int32 `json:"y"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Output string `json:"output,omitempty"`
}
func GetLastRegion ¶
func GetLastRegion() Region
type RegionSelector ¶
type RegionSelector struct {
// contains filtered or unexported fields
}
func NewRegionSelector ¶
func NewRegionSelector(s *Screenshoter) *RegionSelector
func (*RegionSelector) Run ¶
func (r *RegionSelector) Run() (*CaptureResult, bool, error)
type RenderSlot ¶
type RenderSlot struct {
// contains filtered or unexported fields
}
type Screenshoter ¶
type Screenshoter struct {
// contains filtered or unexported fields
}
func New ¶
func New(config Config) *Screenshoter
func (*Screenshoter) GetOutputs ¶
func (s *Screenshoter) GetOutputs() []*WaylandOutput
func (*Screenshoter) Run ¶
func (s *Screenshoter) Run() (*CaptureResult, error)
type SelectionState ¶
type SelectionState struct {
// contains filtered or unexported fields
}
type ShmBuffer ¶
func CreateShmBuffer ¶
type ThemeColors ¶
type WaylandOutput ¶
type WaylandOutput struct {
// contains filtered or unexported fields
}
type WindowGeometry ¶
type WindowGeometry struct {
X int32
Y int32
Width int32
Height int32
Output string
Scale float64
OutputX int32
OutputY int32
OutputTransform int32
}
func GetActiveWindow ¶
func GetActiveWindow() (*WindowGeometry, error)
Click to show internal directories.
Click to hide internal directories.