libnx  v4.8.0
capsdc.h
Go to the documentation of this file.
1 /**
2  * @file capsdc.h
3  * @brief Jpeg Decoder (caps:dc) service IPC wrapper. Only available on [4.0.0+].
4  * @note Only holds one session that is occupied by capsrv.
5  * @author Behemoth
6  * @copyright libnx Authors
7  */
8 #pragma once
9 #include "../types.h"
10 #include "../sf/service.h"
11 #include "../services/caps.h"
12 
13 /// Initialize caps:dc
15 
16 /// Exit caps:dc.
17 void capsdcExit(void);
18 
19 /// Gets the Service for caps:dc.
21 
22 /**
23  * @brief Decodes a jpeg buffer into RGBX.
24  * @param[in] width Image width.
25  * @param[in] height Image height.
26  * @param[in] opts \ref CapsScreenShotDecodeOption.
27  * @param[in] jpeg Jpeg image input buffer.
28  * @param[in] jpeg_size Input image buffer size.
29  * @param[out] out_image RGBA8 image output buffer.
30  * @param[in] out_image_size Output image buffer size, should be at least large enough for RGBA8 width x height.
31  */
32 Result capsdcDecodeJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_image, size_t out_image_size);
33 
34 /**
35  * @brief Shrinks a jpeg's dimensions by 2.
36  */
37 Result capsdcShrinkJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_jpeg, size_t out_jpeg_size, u64 *out_result_size);
Result capsdcInitialize(void)
Initialize caps:dc.
Service * capsdcGetServiceSession(void)
Gets the Service for caps:dc.
Result capsdcDecodeJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void *jpeg, size_t jpeg_size, void *out_image, size_t out_image_size)
Decodes a jpeg buffer into RGBX.
void capsdcExit(void)
Exit caps:dc.
Result capsdcShrinkJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void *jpeg, size_t jpeg_size, void *out_jpeg, size_t out_jpeg_size, u64 *out_result_size)
Shrinks a jpeg's dimensions by 2.
ScreenShotDecodeOption.
Definition: caps.h:74
Service object structure.
Definition: service.h:14
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21