libnx  v4.7.0
capssu.h
Go to the documentation of this file.
1 /**
2  * @file capssu.h
3  * @brief Application screenshot saving (caps:su) service IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 #include "../services/acc.h"
11 #include "../services/caps.h"
12 
13 /// Initialize caps:su. Only available on [4.0.0+].
15 
16 /// Exit caps:su.
17 void capssuExit(void);
18 
19 /// Gets the Service for caps:su.
21 
22 /**
23  * @brief This is a wrapper for \ref capssuSaveScreenShotEx0.
24  * @note This uses an all-zero \ref CapsScreenShotAttribute with orientation = input orientation, and unk_xc = 1.
25  * @param[in] buffer RGBA8 1280x720 image buffer.
26  * @param[in] size Size of the buffer.
27  * @param[in] reportoption \ref AlbumReportOption
28  * @param[in] orientation \ref AlbumImageOrientation
29  * @param[out] out \ref CapsApplicationAlbumEntry. Optional, can be NULL.
30  */
31 Result capssuSaveScreenShot(const void* buffer, size_t size, AlbumReportOption reportoption, AlbumImageOrientation orientation, CapsApplicationAlbumEntry *out);
32 
33 /**
34  * @brief Similar to \ref capssuSaveScreenShot, except this is a wrapper for \ref capssuSaveScreenShotEx1.
35  * @note This uses an all-zero \ref CapsScreenShotAttribute with orientation = input orientation, and unk_xc = 1.
36  * @note Only available on [8.0.0+].
37  * @param[in] buffer RGBA8 1280x720 image data buffer.
38  * @param[in] size Size of the buffer.
39  * @param[in] reportoption \ref AlbumReportOption
40  * @param[in] orientation \ref AlbumImageOrientation
41  * @param[in] userdata Input UserData buffer. If NULL, the \ref CapsApplicationData will be empty.
42  * @param[in] userdata_size Input UserData size, must be within bounds for CapsApplicationData::userdata. If 0, the \ref CapsApplicationData will be empty.
43  * @param[out] out \ref CapsApplicationAlbumEntry. Optional, can be NULL.
44  */
45 Result capssuSaveScreenShotWithUserData(const void* buffer, size_t size, AlbumReportOption reportoption, AlbumImageOrientation orientation, const void* userdata, size_t userdata_size, CapsApplicationAlbumEntry *out);
46 
47 /**
48  * @brief Similar to \ref capssuSaveScreenShot, except this is a wrapper for \ref capssuSaveScreenShotEx2.
49  * @note This uses an all-zero \ref CapsScreenShotAttribute with orientation = input orientation, and unk_xc = 1.
50  * @note Only available on [6.0.0+].
51  * @param[in] buffer RGBA8 1280x720 image data buffer.
52  * @param[in] size Size of the buffer.
53  * @param[in] reportoption \ref AlbumReportOption
54  * @param[in] orientation \ref AlbumImageOrientation
55  * @param[in] uids Input array of \ref AccountUid. If NULL, the \ref CapsUserIdList will be empty.
56  * @param[in] uid_count Size of the uids array in entries, must be within bounds for CapsUserIdList::uids. If 0, the \ref CapsUserIdList will be empty.
57  * @param[out] out \ref CapsApplicationAlbumEntry. Optional, can be NULL.
58  */
59 Result capssuSaveScreenShotWithUserIds(const void* buffer, size_t size, AlbumReportOption reportoption, AlbumImageOrientation orientation, const AccountUid* uids, size_t uid_count, CapsApplicationAlbumEntry *out);
60 
61 /**
62  * @brief Saves an Album screenshot using the specified gfx data in the buffer, with the specified \ref CapsScreenShotAttribute.
63  * @param[in] buffer RGBA8 1280x720 image data buffer.
64  * @param[in] size Size of the buffer, must be at least 0x384000.
65  * @param[in] attr \ref CapsScreenShotAttribute
66  * @param[in] reportoption \ref AlbumReportOption
67  * @param[out] out \ref CapsApplicationAlbumEntry. Optional, can be NULL.
68  */
69 Result capssuSaveScreenShotEx0(const void* buffer, size_t size, const CapsScreenShotAttribute *attr, AlbumReportOption reportoption, CapsApplicationAlbumEntry *out);
70 
71 /**
72  * @brief Same as \ref capssuSaveScreenShotEx0, except this allows specifying the \ref CapsApplicationData.
73  * @note Only available on [8.0.0+].
74  * @param[in] buffer RGBA8 1280x720 image data buffer.
75  * @param[in] size Size of the buffer, must be at least 0x384000.
76  * @param[in] attr \ref CapsScreenShotAttribute
77  * @param[in] reportoption \ref AlbumReportOption
78  * @param[in] appdata \ref CapsApplicationData
79  * @param[out] out \ref CapsApplicationAlbumEntry. Optional, can be NULL.
80  */
81 Result capssuSaveScreenShotEx1(const void* buffer, size_t size, const CapsScreenShotAttribute *attr, AlbumReportOption reportoption, CapsApplicationData *appdata, CapsApplicationAlbumEntry *out);
82 
83 /**
84  * @brief Same as \ref capssuSaveScreenShotEx0, except this allows specifying the \ref CapsUserIdList.
85  * @note Only available on [6.0.0+].
86  * @param[in] buffer RGBA8 1280x720 image data buffer.
87  * @param[in] size Size of the buffer, must be at least 0x384000.
88  * @param[in] attr \ref CapsScreenShotAttribute
89  * @param[in] reportoption \ref AlbumReportOption
90  * @param[in] list \ref CapsUserIdList
91  * @param[out] out \ref CapsApplicationAlbumEntry. Optional, can be NULL.
92  */
93 Result capssuSaveScreenShotEx2(const void* buffer, size_t size, const CapsScreenShotAttribute *attr, AlbumReportOption reportoption, CapsUserIdList *list, CapsApplicationAlbumEntry *out);
94 
AlbumImageOrientation
ImageOrientation.
Definition: caps.h:12
AlbumReportOption
AlbumReportOption.
Definition: caps.h:20
Result capssuSaveScreenShotEx1(const void *buffer, size_t size, const CapsScreenShotAttribute *attr, AlbumReportOption reportoption, CapsApplicationData *appdata, CapsApplicationAlbumEntry *out)
Same as capssuSaveScreenShotEx0, except this allows specifying the CapsApplicationData.
Result capssuSaveScreenShotWithUserData(const void *buffer, size_t size, AlbumReportOption reportoption, AlbumImageOrientation orientation, const void *userdata, size_t userdata_size, CapsApplicationAlbumEntry *out)
Similar to capssuSaveScreenShot, except this is a wrapper for capssuSaveScreenShotEx1.
Result capssuSaveScreenShotEx0(const void *buffer, size_t size, const CapsScreenShotAttribute *attr, AlbumReportOption reportoption, CapsApplicationAlbumEntry *out)
Saves an Album screenshot using the specified gfx data in the buffer, with the specified CapsScreenSh...
Result capssuSaveScreenShotWithUserIds(const void *buffer, size_t size, AlbumReportOption reportoption, AlbumImageOrientation orientation, const AccountUid *uids, size_t uid_count, CapsApplicationAlbumEntry *out)
Similar to capssuSaveScreenShot, except this is a wrapper for capssuSaveScreenShotEx2.
void capssuExit(void)
Exit caps:su.
Result capssuInitialize(void)
Initialize caps:su. Only available on [4.0.0+].
Result capssuSaveScreenShot(const void *buffer, size_t size, AlbumReportOption reportoption, AlbumImageOrientation orientation, CapsApplicationAlbumEntry *out)
This is a wrapper for capssuSaveScreenShotEx0.
Result capssuSaveScreenShotEx2(const void *buffer, size_t size, const CapsScreenShotAttribute *attr, AlbumReportOption reportoption, CapsUserIdList *list, CapsApplicationAlbumEntry *out)
Same as capssuSaveScreenShotEx0, except this allows specifying the CapsUserIdList.
Service * capssuGetServiceSession(void)
Gets the Service for caps:su.
Account UserId.
Definition: acc.h:25
ApplicationAlbumEntry.
Definition: caps.h:106
ApplicationData.
Definition: caps.h:134
ScreenShotAttribute.
Definition: caps.h:38
UserIdList.
Definition: caps.h:173
Service object structure.
Definition: service.h:14
u32 Result
Function error code result type.
Definition: types.h:44