libnx  v4.6.0
Macros | Functions
capssc.h File Reference

Screenshot control (caps:sc) service IPC wrapper. More...

#include "../types.h"
#include "../sf/service.h"
#include "vi.h"

Go to the source code of this file.

Macros

#define CAPSSC_JPEG_BUFFER_SIZE   0x80000
 

Functions

Result capsscInitialize (void)
 Initialize caps:sc. Only available on [2.0.0+].
 
void capsscExit (void)
 Exit caps:sc.
 
ServicecapsscGetServiceSession (void)
 Gets the Service for caps:sc.
 
Result capsscCaptureRawImageWithTimeout (void *buf, size_t size, ViLayerStack layer_stack, u64 width, u64 height, s64 buffer_count, s64 buffer_index, s64 timeout)
 This takes a screenshot, with the screenshot being written into the output buffer. More...
 
Result capsscOpenRawScreenShotReadStream (u64 *out_size, u64 *out_width, u64 *out_height, ViLayerStack layer_stack, s64 timeout)
 This takes a raw screenshot, with the screenshot being held until capsscCloseRawScreenShotReadStream is called. More...
 
Result capsscCloseRawScreenShotReadStream (void)
 Discards a stream opened by capsscOpenRawScreenShotReadStream. More...
 
Result capsscReadRawScreenShotReadStream (u64 *bytes_read, void *buf, size_t size, u64 offset)
 Reads from a stream opened by capsscOpenRawScreenShotReadStream. More...
 
Result capsscCaptureJpegScreenShot (u64 *out_jpeg_size, void *jpeg_buf, size_t jpeg_buf_size, ViLayerStack layer_stack, s64 timeout)
 This takes a screenshot, with the screenshot being written as jpeg into the output buffer. More...
 

Detailed Description

Screenshot control (caps:sc) service IPC wrapper.

Author
yellows8

Function Documentation

◆ capsscCaptureJpegScreenShot()

Result capsscCaptureJpegScreenShot ( u64 out_jpeg_size,
void *  jpeg_buf,
size_t  jpeg_buf_size,
ViLayerStack  layer_stack,
s64  timeout 
)

This takes a screenshot, with the screenshot being written as jpeg into the output buffer.

Note
Only available on [9.0.0+]. Requires debug mode before [10.0.0].
Parameters
out_jpeg_sizePointer to write the size of the captured jpeg to.
jpeg_bufOutput buffer containing the JPEG image.
jpeg_buf_sizeSize of jpeg_buf, official software uses 0x80000.
layer_stackViLayerStack
timeoutTimeout in nanoseconds.

◆ capsscCaptureRawImageWithTimeout()

Result capsscCaptureRawImageWithTimeout ( void *  buf,
size_t  size,
ViLayerStack  layer_stack,
u64  width,
u64  height,
s64  buffer_count,
s64  buffer_index,
s64  timeout 
)

This takes a screenshot, with the screenshot being written into the output buffer.

Note
Not available with [5.0.0+] (stubbed).
buffer_index and buffer_count correspond to buffers with size 0x384000(1280*720*4). These must not be negative.
Parameters
bufOutput buffer containing the RGBA8 image.
sizeSize of buf, should be 0x384000(1280*720*4) * buffer_count.
layer_stackViLayerStack
widthImage width, must be 1280.
heightImage height, must be 720.
buffer_countTotal number of output image buffers.
buffer_indexStarting image buffer index. Must be < buffer_count.
timeoutTimeout in nanoseconds. A default value of 100000000 can be used.

◆ capsscCloseRawScreenShotReadStream()

Result capsscCloseRawScreenShotReadStream ( void  )

Discards a stream opened by capsscOpenRawScreenShotReadStream.

Note
Only available on [3.0.0+]. Requires debug mode.

◆ capsscOpenRawScreenShotReadStream()

Result capsscOpenRawScreenShotReadStream ( u64 out_size,
u64 out_width,
u64 out_height,
ViLayerStack  layer_stack,
s64  timeout 
)

This takes a raw screenshot, with the screenshot being held until capsscCloseRawScreenShotReadStream is called.

Note
Only available on [3.0.0+]. Requires debug mode.
Parameters
out_sizePointer to write the size of the captured raw image to. Always 0x384000(1280*720*4).
out_widthPointer to write the width of the captured raw image to. Always 1280.
out_heightPointer to write the height of the captured raw image to. Always 720.
layer_stackViLayerStack
timeoutTimeout in nanoseconds.

◆ capsscReadRawScreenShotReadStream()

Result capsscReadRawScreenShotReadStream ( u64 bytes_read,
void *  buf,
size_t  size,
u64  offset 
)

Reads from a stream opened by capsscOpenRawScreenShotReadStream.

Note
Only available on [3.0.0+]. Requires debug mode.
Parameters
bytes_readPointer to write the amounts of bytes written to buffer.
bufOutput buffer containing the RGBA8 image.
sizeSize of buf.
offsetOffset in image where read should start.