libnx v4.9.0
Loading...
Searching...
No Matches
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.
13typedef struct {
14 Uuid uuid;
16
17/// Image attribute.
18typedef 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.
29void miiimgExit(void);
30
31/// Gets the Service object for the actual miiimg service session.
33
34/**
35 * @brief Reloads the image database.
36 */
38
39/**
40 * @brief Gets the number of mii images in the database.
41 * @param[out] out_count Mii image count.
42 */
44
45/**
46 * @brief Gets whether the image database is empty.
47 * @param[out] out_empty Whether the database is empty.
48 */
49Result 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 */
55Result 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 */
71Result miiimgLoadImage(MiiimgImageId id, void* out_image, size_t out_image_size);
Result miiimgReload(void)
Reloads the image database.
Service * miiimgGetServiceSession(void)
Gets the Service object for the actual miiimg service session.
Result miiimgIsFull(bool *out_full)
Gets whether the image database is full.
Result miiimgInitialize(void)
Initialize miiimg.
void miiimgExit(void)
Exit miiimg.
Result miiimgLoadImage(MiiimgImageId id, void *out_image, size_t out_image_size)
Loads the image data (raw RGBA8) for the specified image ID.
Result miiimgIsEmpty(bool *out_empty)
Gets whether the image database is empty.
Result miiimgGetAttribute(s32 index, MiiimgImageAttribute *out_attr)
Gets the image attribute for the specified image index.
Result miiimgGetCount(s32 *out_count)
Gets the number of mii images in the database.
Definition mii.h:57
Image attribute.
Definition miiimg.h:18
MiiimgImageId image_id
Image ID.
Definition miiimg.h:19
MiiCreateId create_id
Mii's create ID.
Definition miiimg.h:20
Image ID.
Definition miiimg.h:13
Service object structure.
Definition service.h:14
Definition types.h:48
#define NX_PACKED
Packs a struct so that it won't include padding bytes.
Definition types.h:63
uint16_t u16
16-bit unsigned integer.
Definition types.h:20
u32 Result
Function error code result type.
Definition types.h:44
int32_t s32
32-bit signed integer.
Definition types.h:27
uint32_t u32
32-bit unsigned integer.
Definition types.h:21