screenshot

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPicsDir

func DefaultPicsDir() string

Types

type ImageTags added in v0.6.6

type ImageTags struct {
	Time   time.Time `json:",omitempty"`
	CMDR   string    `json:",omitempty"`
	System string    `json:",omitempty"`
	Body   string    `json:",omitempty"`
	Port   string    `json:",omitempty"`
	Coos   []float64 `json:",omitempty"`
}

type JFIFMarkerTag added in v0.6.6

type JFIFMarkerTag byte
const (
	JFIFMarkerSOI   JFIFMarkerTag = 0xD8
	JFIFMarkerAPP0  JFIFMarkerTag = 0xE0 // JFIF Tag
	JFIFMarkerDAC   JFIFMarkerTag = 0xCC
	JFIFMarkerDQT   JFIFMarkerTag = 0xDB
	JFIFMarkerDRI   JFIFMarkerTag = 0xDD
	JFIFMarkerAPP1  JFIFMarkerTag = 0xE1 // EXIF Tag
	JFIFMarkerAPP14 JFIFMarkerTag = 0xEE // Often for copyright
	JFIFMarkerCOM   JFIFMarkerTag = 0xFE
	JFIFMarkerSOS   JFIFMarkerTag = 0xDA
	JFIFMarkerEOI   JFIFMarkerTag = 0xD9
)

func JFIFMarkerAPP added in v0.6.6

func JFIFMarkerAPP(n int) JFIFMarkerTag

func JFIFMarkerSOF added in v0.6.6

func JFIFMarkerSOF(n int) JFIFMarkerTag

JFIFMarkerC does not check the range of n

func (JFIFMarkerTag) Segment added in v0.6.6

func (t JFIFMarkerTag) Segment() bool

func (JFIFMarkerTag) String added in v0.6.6

func (t JFIFMarkerTag) String() string

func (JFIFMarkerTag) WriteMarker added in v0.6.6

func (t JFIFMarkerTag) WriteMarker(w io.Writer, size uint16) error

type JFIFScanner added in v0.6.6

type JFIFScanner struct {
	Err  error
	Tag  JFIFMarkerTag
	Size int
	// contains filtered or unexported fields
}
Example
img := image.NewRGBA(image.Rectangle{
	image.Point{},
	image.Point{16, 16},
})
var buf bytes.Buffer
if err := jpeg.Encode(&buf, img, nil); err != nil {
	fmt.Println(err)
}
scn := NewJFIFScanner(&buf)
for scn.Scan() {
	if scn.Err != nil {
		fmt.Println(scn.Err)
		break
	}
	if scn.Tag.Segment() {
		fmt.Printf("%s %d", scn.Tag, scn.Size)
	} else {
		fmt.Print(scn.Tag.String())
	}
	n, err := scn.Consume(scn.Segment())
	fmt.Printf(" consumed %d bytes\n", n)
	if err != nil {
		fmt.Println(err)
		break
	}
}
Output:

SOI (D8) consumed 0 bytes
DQT (DB) 132 consumed 130 bytes
SOF0 (C0) 17 consumed 15 bytes
SOF4 (C4) 418 consumed 416 bytes
SOS (DA) consumed 18 bytes

func NewJFIFScanner added in v0.6.6

func NewJFIFScanner(r io.Reader) *JFIFScanner

func (*JFIFScanner) Consume added in v0.6.6

func (s *JFIFScanner) Consume(segment io.Reader) (int64, error)

func (*JFIFScanner) Scan added in v0.6.6

func (s *JFIFScanner) Scan() bool

func (*JFIFScanner) Segment added in v0.6.6

func (s *JFIFScanner) Segment() io.Reader

type Screenshot

type Screenshot struct {
	EDPicDir    string
	OutRoot     string
	Aspect      float64
	JpegQuality int
	SubstOrig   bool
	RmOrig      bool
	AddTags     bool
	FID         string
	Cmdr        string
}

func (*Screenshot) Close

func (scrns *Screenshot) Close() error

func (*Screenshot) OnJournalEvent added in v0.6.4

func (scrns *Screenshot) OnJournalEvent(e watched.JounalEvent) (err error)

func (*Screenshot) OnStatusEvent added in v0.6.4

func (scrns *Screenshot) OnStatusEvent(e watched.StatusEvent) error

func (*Screenshot) OutDir

func (scrns *Screenshot) OutDir(t time.Time, sys, body string) string

func (*Screenshot) OutFilePat

func (scrns *Screenshot) OutFilePat(t time.Time, sys, body string) string

func (*Screenshot) ScrShot

func (scrns *Screenshot) ScrShot(name string) (path string)

Jump to

Keyboard shortcuts

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