Debian Codegraph @

api/requests/sources/xx_generated.takesourcescreenshot.go

raw symbols SCIP
1 // This file has been automatically generated. Don't edit it.
2
3 package sourcesscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/
4
5 import requestsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests`/ "github.com/andreykaipov/goobs/api/requestsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests`/"
6
7 /*
8 TakeSourceScreenshotParams represents the params body for the "TakeSourceScreenshot" request.
9 Takes a picture snapshot of a source and then can either or both: - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) - Save it to disk (by specifying `saveToFilePath` in the request)
10
11 At least `embedPictureFormat` or `saveToFilePath` must be specified.
12
13 Clients can specify `width` and `height` parameters to receive scaled pictures. Aspect ratio is
14 preserved if only one of these two parameters is specified.
15 Since 4.6.0.
16 */
17 type TakeSourceScreenshotParamsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams# struct {
18 requestsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests`/.ParamsBasicscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#ParamsBasic.
19
20 // Compression ratio between -1 and 100 to write the image with. -1 is automatic, 1 is smallest file/most
21 // compression, 100 is largest file/least compression. Varies with image type.
22 CompressionQualityscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#CompressionQuality. int `json:"compressionQuality,omitempty"`
23
24 // Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by
25 // Qt's Image module)
26 EmbedPictureFormatscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#EmbedPictureFormat. string `json:"embedPictureFormat,omitempty"`
27
28 // Format to save the image file as (one of the values provided in the `supported-image-export-formats` response
29 // field of `GetVersion`). If not specified, tries to guess based on file extension.
30 FileFormatscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#FileFormat. string `json:"fileFormat,omitempty"`
31
32 // Screenshot height. Defaults to the source's base height.
33 Heightscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#Height. int `json:"height,omitempty"`
34
35 // Full file path (file extension included) where the captured image is to be saved. Can be in a format different
36 // from `pictureFormat`. Can be a relative path.
37 SaveToFilePathscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#SaveToFilePath. string `json:"saveToFilePath,omitempty"`
38
39 // Source name. Note: Since scenes are also sources, you can also provide a scene name. If not provided, the
40 // currently active scene is used.
41 SourceNamescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#SourceName. string `json:"sourceName,omitempty"`
42
43 // Screenshot width. Defaults to the source's base width.
44 Widthscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#Width. int `json:"width,omitempty"`
45 }
46
47 // GetSelfName just returns "TakeSourceScreenshot".
48 func (o *TakeSourceScreenshotParamsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#) GetSelfNamescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#GetSelfName().() string {
49 return "TakeSourceScreenshot"
50 }
51
52 /*
53 TakeSourceScreenshotResponse represents the response body for the "TakeSourceScreenshot" request.
54 Takes a picture snapshot of a source and then can either or both: - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) - Save it to disk (by specifying `saveToFilePath` in the request)
55
56 At least `embedPictureFormat` or `saveToFilePath` must be specified.
57
58 Clients can specify `width` and `height` parameters to receive scaled pictures. Aspect ratio is
59 preserved if only one of these two parameters is specified.
60 Since v4.6.0.
61 */
62 type TakeSourceScreenshotResponsescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse# struct {
63 requestsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests`/.ResponseBasicscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse#ResponseBasic.
64
65 // Absolute path to the saved image file (if `saveToFilePath` was specified in the request)
66 ImageFilescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse#ImageFile. string `json:"imageFile,omitempty"`
67
68 // Image Data URI (if `embedPictureFormat` was specified in the request)
69 Imgscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse#Img. string `json:"img,omitempty"`
70
71 // Source name
72 SourceNamescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse#SourceName. string `json:"sourceName,omitempty"`
73 }
74
75 // TakeSourceScreenshot sends the corresponding request to the connected OBS WebSockets server.
76 func (c *Clientscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/Client#) TakeSourceScreenshotscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/Client#TakeSourceScreenshot().(params *TakeSourceScreenshotParamsscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotParams#) (*TakeSourceScreenshotResponsescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse#, error) {
77 data := &TakeSourceScreenshotResponsescip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests/sources`/TakeSourceScreenshotResponse#{}
78 if err := c.SendRequestscip-go gomod github.com/andreykaipov/goobs . `github.com/andreykaipov/goobs/api/requests`/Client#SendRequest().(params, data); err != nil {
79 return nil, err
80 }
81 return data, nil
82 }