libnx  v4.2.0
miiimg.h
Go to the documentation of this file.
1 /**
2  * @file miiimg.h
3  * @brief Mii image (miiimg) service IPC wrapper.
4  * @author XorTroll
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 #include "../services/mii.h"
11 
12 /// Image ID.
13 typedef struct {
14  Uuid uuid;
16 
17 /// Image attribute.
18 typedef struct {
19  MiiimgImageId image_id; ///< Image ID.
20  MiiCreateId create_id; ///< Mii's create ID.
21  u32 unk;
22  u16 mii_name[10+1]; ///< utf-16be, null-terminated
24 
25 /// Initialize miiimg.
27 
28 /// Exit miiimg.
29 void miiimgExit(void);
30 
31 /// Gets the Service object for the actual miiimg service session.
33 
34 /**
35  * @brief Reloads the image database.
36  */
37 Result miiimgReload(void);
38 
39 /**
40  * @brief Gets the number of mii images in the database.
41  * @param[out] out_count Mii image count.
42  */
43 Result miiimgGetCount(s32 *out_count);
44 
45 /**
46  * @brief Gets whether the image database is empty.
47  * @param[out] out_empty Whether the database is empty.
48  */
49 Result miiimgIsEmpty(bool *out_empty);
50 
51 /**
52  * @brief Gets whether the image database is full.
53  * @param[out] out_empty Whether the database is full.
54  */
55 Result miiimgIsFull(bool *out_full);
56 
57 /**
58  * @brief Gets the image attribute for the specified image index.
59  * @param[in] index Image index.
60  * @param[out] out_attr Out image attribute.
61  */
63 
64 /**
65  * @brief Loads the image data (raw RGBA8) for the specified image ID.
66  * @note Server doesn't seem to check the image buffer size, but 0x40000 is the optimal size.
67  * @param[in] id Input image ID.
68  * @param[out] out_image Out iamge buffer.
69  * @param[in] out_image_size Out image buffer size.
70  */
71 Result miiimgLoadImage(MiiimgImageId id, void* out_image, size_t out_image_size);
miiimgIsFull
Result miiimgIsFull(bool *out_full)
Gets whether the image database is full.
miiimgLoadImage
Result miiimgLoadImage(MiiimgImageId id, void *out_image, size_t out_image_size)
Loads the image data (raw RGBA8) for the specified image ID.
s32
int32_t s32
32-bit signed integer.
Definition: types.h:27
MiiimgImageAttribute::create_id
MiiCreateId create_id
Mii's create ID.
Definition: miiimg.h:20
miiimgGetCount
Result miiimgGetCount(s32 *out_count)
Gets the number of mii images in the database.
MiiimgImageId
Image ID.
Definition: miiimg.h:13
miiimgGetServiceSession
Service * miiimgGetServiceSession(void)
Gets the Service object for the actual miiimg service session.
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
miiimgInitialize
Result miiimgInitialize(void)
Initialize miiimg.
Result
u32 Result
Function error code result type.
Definition: types.h:44
miiimgExit
void miiimgExit(void)
Exit miiimg.
Uuid
Definition: types.h:48
MiiimgImageAttribute::image_id
MiiimgImageId image_id
Image ID.
Definition: miiimg.h:19
miiimgGetAttribute
Result miiimgGetAttribute(s32 index, MiiimgImageAttribute *out_attr)
Gets the image attribute for the specified image index.
miiimgReload
Result miiimgReload(void)
Reloads the image database.
MiiCreateId
Definition: mii.h:57
PACKED
#define PACKED
Packs a struct so that it won't include padding bytes.
Definition: types.h:59
MiiimgImageAttribute
Image attribute.
Definition: miiimg.h:18
Service
Service object structure.
Definition: service.h:13
miiimgIsEmpty
Result miiimgIsEmpty(bool *out_empty)
Gets whether the image database is empty.
u16
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20