10 #include "../sf/service.h"
11 #include "../services/hid.h"
13 #define IRS_MAX_CAMERAS 0x9
346 u8 plugin_data[0x12c];
HidNpadIdType
HID controller IDs.
Definition: hid.h:214
Result irsGetIrCameraStatus(IrsIrCameraHandle handle, IrsIrCameraStatus *out)
GetIrCameraStatus.
Result irsGetImageTransferProcessorState(IrsIrCameraHandle handle, void *buffer, size_t size, IrsImageTransferProcessorState *state)
GetImageTransferProcessorState.
Result irsStopImageProcessor(IrsIrCameraHandle handle)
Stop the current Processor.
IrsImageTransferProcessorFormat
ImageTransferProcessorFormat. IR Sensor image resolution.
Definition: irs.h:53
@ IrsImageTransferProcessorFormat_40x30
[4.0.0+] 40x30
Definition: irs.h:57
@ IrsImageTransferProcessorFormat_80x60
80x60
Definition: irs.h:56
@ IrsImageTransferProcessorFormat_20x15
[4.0.0+] 20x15
Definition: irs.h:58
@ IrsImageTransferProcessorFormat_160x120
160x120
Definition: irs.h:55
@ IrsImageTransferProcessorFormat_320x240
320x240
Definition: irs.h:54
IrsAdaptiveClusteringTargetDistance
AdaptiveClusteringTargetDistance.
Definition: irs.h:68
@ IrsAdaptiveClusteringTargetDistance_Far
Far.
Definition: irs.h:71
@ IrsAdaptiveClusteringTargetDistance_Middle
Middle.
Definition: irs.h:70
@ IrsAdaptiveClusteringTargetDistance_Near
Near.
Definition: irs.h:69
void irsGetDefaultImageTransferProcessorExConfig(IrsImageTransferProcessorExConfig *config)
Gets the default configuration for ImageTransferProcessorEx.
Result irsGetIrCameraHandle(IrsIrCameraHandle *handle, HidNpadIdType id)
Gets the IrsIrCameraHandle for the specified controller.
Service * irsGetServiceSession(void)
Gets the Service object for the actual irs service session.
void irsExit(void)
Exit irs.
Result irsStopImageProcessorAsync(IrsIrCameraHandle handle)
Stop the current Processor, async.
Result irsRunTeraPluginProcessor(IrsIrCameraHandle handle, const IrsTeraPluginProcessorConfig *config)
Run the TeraPluginProcessor.
IrsIrCameraStatus
IrCameraStatus.
Definition: irs.h:16
@ IrsIrCameraStatus_Unsupported
Unsupported.
Definition: irs.h:18
@ IrsIrCameraStatus_Available
Available.
Definition: irs.h:17
@ IrsIrCameraStatus_Unconnected
Unconnected.
Definition: irs.h:19
IrsMomentStatistic irsCalculateMomentRegionStatistic(const IrsMomentProcessorState *state, IrsRect rect, s32 region_x, s32 region_y, s32 region_width, s32 region_height)
Calculates an IrsMomentStatistic from the specified region in the input IrsMomentProcessorState.
IrsHandAnalysisMode
HandAnalysisMode.
Definition: irs.h:75
@ IrsHandAnalysisMode_Image
Image.
Definition: irs.h:77
@ IrsHandAnalysisMode_SilhouetteAndImage
SilhouetteAndImage.
Definition: irs.h:78
@ IrsHandAnalysisMode_SilhouetteOnly
[4.0.0+] SilhouetteOnly
Definition: irs.h:79
@ IrsHandAnalysisMode_Silhouette
Silhouette.
Definition: irs.h:76
IrsImageProcessorStatus
ImageProcessorStatus.
Definition: irs.h:47
@ IrsImageProcessorStatus_Stopped
Stopped.
Definition: irs.h:48
@ IrsImageProcessorStatus_Running
Running.
Definition: irs.h:49
void * irsGetSharedmemAddr(void)
Gets the address of the SharedMemory (IrsStatusManager).
Result irsGetPointingProcessorStates(IrsIrCameraHandle handle, IrsPointingProcessorState *states, s32 count, s32 *total_out)
Gets the states for IrsPointingProcessorState.
void irsGetDefaultImageTransferProcessorConfig(IrsImageTransferProcessorConfig *config)
Gets the default configuration for ImageTransferProcessor.
Result irsRunImageTransferExProcessor(IrsIrCameraHandle handle, const IrsImageTransferProcessorExConfig *config, size_t size)
Run the ImageTransferExProcessor.
Result irsGetClusteringProcessorStates(IrsIrCameraHandle handle, IrsClusteringProcessorState *states, s32 count, s32 *total_out)
Gets the states for ClusteringProcessor.
Result irsGetImageProcessorStatus(IrsIrCameraHandle handle, IrsImageProcessorStatus *out)
GetImageProcessorStatus Only available on [4.0.0+].
Result irsRunAdaptiveClusteringProcessor(IrsIrCameraHandle handle, const IrsAdaptiveClusteringProcessorConfig *config)
Run the AdaptiveClusteringProcessor.
Result irsRunIrLedProcessor(IrsIrCameraHandle handle, const IrsIrLedProcessorConfig *config)
Run the IrLedProcessor.
IrsAdaptiveClusteringMode
AdaptiveClusteringMode.
Definition: irs.h:62
@ IrsAdaptiveClusteringMode_DynamicFov
DynamicFov.
Definition: irs.h:64
@ IrsAdaptiveClusteringMode_StaticFov
StaticFov.
Definition: irs.h:63
Result irsRunMomentProcessor(IrsIrCameraHandle handle, const IrsMomentProcessorConfig *config)
Run the MomentProcessor.
void irsGetMomentProcessorDefaultConfig(IrsMomentProcessorConfig *config)
Gets the default configuration for MomentProcessor.
Result irsCheckFirmwareUpdateNecessity(IrsIrCameraHandle handle, bool *out)
CheckFirmwareUpdateNecessity When successful where the output flag is set, the user should use hidLaS...
IrsIrSensorMode
IrSensorMode.
Definition: irs.h:36
@ IrsIrSensorMode_ClusteringProcessor
ClusteringProcessor.
Definition: irs.h:39
@ IrsIrSensorMode_PointingProcessor
PointingProcessor.
Definition: irs.h:41
@ IrsIrSensorMode_MomentProcessor
MomentProcessor.
Definition: irs.h:38
@ IrsIrSensorMode_IrLedProcessor
IrLedProcessor (doesn't apply to IrsDeviceFormat::ir_sensor_mode)
Definition: irs.h:43
@ IrsIrSensorMode_ImageTransferProcessor
ImageTransferProcessor.
Definition: irs.h:40
@ IrsIrSensorMode_None
None.
Definition: irs.h:37
@ IrsIrSensorMode_TeraPluginProcessor
TeraPluginProcessor.
Definition: irs.h:42
Result irsInitialize(void)
Initialize irs.
bool(* IrsValidationCb)(void *userdata, void *arg)
Internal validation callblack.
Definition: irs.h:83
Result irsRunPointingProcessor(IrsIrCameraHandle handle)
Run the PointingProcessor.
Result irsRunHandAnalysis(IrsIrCameraHandle handle, const IrsHandAnalysisConfig *config)
Run HandAnalysis.
static void irsGetIrLedProcessorDefaultConfig(IrsIrLedProcessorConfig *config)
Gets the default configuration for IrLedProcessor.
Definition: irs.h:572
Result irsGetMomentProcessorStates(IrsIrCameraHandle handle, IrsMomentProcessorState *states, s32 count, s32 *total_out)
Gets the states for MomentProcessor or IrLedProcessor.
IrsIrCameraInternalStatus
IrCameraInternalStatus.
Definition: irs.h:23
@ IrsIrCameraInternalStatus_Stopped
Stopped.
Definition: irs.h:24
@ IrsIrCameraInternalStatus_FirmwareVersionIsInvalid
FirmwareVersionIsInvalid.
Definition: irs.h:30
@ IrsIrCameraInternalStatus_Ready
[4.0.0+] Ready
Definition: irs.h:31
@ IrsIrCameraInternalStatus_FirmwareVersionRequested
FirmwareVersionRequested.
Definition: irs.h:29
@ IrsIrCameraInternalStatus_Unknown3
Unknown.
Definition: irs.h:27
@ IrsIrCameraInternalStatus_FirmwareUpdateNeeded
FirmwareUpdateNeeded.
Definition: irs.h:25
@ IrsIrCameraInternalStatus_Setting
[4.0.0+] Setting
Definition: irs.h:32
@ IrsIrCameraInternalStatus_Unknown4
Unknown.
Definition: irs.h:28
@ IrsIrCameraInternalStatus_Unknown2
Unknown.
Definition: irs.h:26
Result irsGetTeraPluginProcessorStates(IrsIrCameraHandle handle, IrsTeraPluginProcessorState *states, s32 count, s64 sampling_number, u32 prefix_data, u32 prefix_bitcount, s32 *total_out)
Gets the states for TeraPluginProcessor, filtered using the input params.
Result irsRunImageTransferProcessor(IrsIrCameraHandle handle, const IrsImageTransferProcessorConfig *config, size_t size)
Run the ImageTransferProcessor.
void irsGetClusteringProcessorDefaultConfig(IrsClusteringProcessorConfig *config)
Gets the default configuration for ClusteringProcessor.
Result irsRunClusteringProcessor(IrsIrCameraHandle handle, const IrsClusteringProcessorConfig *config)
Run the ClusteringProcessor.
Result irsGetPointingProcessorMarkerStates(IrsIrCameraHandle handle, IrsPointingProcessorMarkerState *states, s32 count, s32 *total_out)
Gets the states for PointingProcessor.
AdaptiveClusteringProcessorConfig.
Definition: irs.h:263
u32 mode
IrsAdaptiveClusteringMode
Definition: irs.h:264
u32 target_distance
[6.0.0+] IrsAdaptiveClusteringTargetDistance
Definition: irs.h:265
ClusteringData.
Definition: irs.h:291
u16 boundt_width
BoundtWidth.
Definition: irs.h:298
float average_intensity
AverageIntensity.
Definition: irs.h:292
float centroid_y
CentroidY.
Definition: irs.h:294
u16 bound_y
BoundY.
Definition: irs.h:297
u16 bound_x
BoundX.
Definition: irs.h:296
u32 pixel_count
PixelCount.
Definition: irs.h:295
u16 bound_height
BoundHeight.
Definition: irs.h:299
float centroid_x
CentroidX.
Definition: irs.h:293
ClusteringProcessorConfig.
Definition: irs.h:139
u8 is_external_light_filter_enabled
IsExternalLightFilterEnabled.
Definition: irs.h:149
u32 object_pixel_count_min
ObjectPixelCountMin.
Definition: irs.h:146
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:143
u32 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:141
u32 object_intensity_min
ObjectIntensityMin.
Definition: irs.h:148
u32 object_pixel_count_max
ObjectPixelCountMax.
Definition: irs.h:147
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:140
IrsRect window_of_interest
WindowOfInterest.
Definition: irs.h:145
u32 gain
IR sensor signal's digital gain.
Definition: irs.h:142
ClusteringProcessorState.
Definition: irs.h:303
s64 sampling_number
SamplingNumber.
Definition: irs.h:304
u64 timestamp
TimeStamp.
Definition: irs.h:305
u32 ambient_noise_level
AmbientNoiseLevel.
Definition: irs.h:309
u8 object_count
ObjectCount.
Definition: irs.h:307
HandAnalysisConfig.
Definition: irs.h:269
u32 mode
IrsHandAnalysisMode
Definition: irs.h:270
ImageTransferProcessorConfig.
Definition: irs.h:169
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:170
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:173
u32 gain
IR sensor signal's digital gain.
Definition: irs.h:172
u32 format
IrsImageTransferProcessorFormat
Definition: irs.h:175
u32 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:171
ImageTransferProcessorExConfig.
Definition: irs.h:179
u16 trimming_start_x
TrimmingStartX.
Definition: irs.h:187
u16 trimming_start_y
TrimmingStartY.
Definition: irs.h:188
u8 is_external_light_filter_enabled
IsExternalLightFilterEnabled.
Definition: irs.h:189
u32 orig_format
OrigFormat IrsImageTransferProcessorFormat.
Definition: irs.h:185
u32 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:181
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:180
u32 trimming_format
TrimmingFormat IrsImageTransferProcessorFormat.
Definition: irs.h:186
u32 gain
IR sensor signal's digital gain.
Definition: irs.h:182
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:183
ImageTransferProcessorState.
Definition: irs.h:221
u32 ambient_noise_level
AmbientNoiseLevel.
Definition: irs.h:223
u64 sampling_number
SamplingNumber.
Definition: irs.h:222
IrCameraHandle.
Definition: irs.h:86
u8 player_number
PlayerNumber.
Definition: irs.h:87
u8 device_type
DeviceType.
Definition: irs.h:88
IrLedProcessorConfig.
Definition: irs.h:251
u32 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:252
IrsMomentProcessorConfig.
Definition: irs.h:113
IrsRect window_of_interest
WindowOfInterest.
Definition: irs.h:119
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:117
u32 gain
IR sensor signal's digital gain.
Definition: irs.h:116
u32 preprocess
Preprocess.
Definition: irs.h:120
u32 preprocess_intensity_threshold
PreprocessIntensityThreshold.
Definition: irs.h:121
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:114
u32 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:115
MomentProcessorState.
Definition: irs.h:281
u32 ambient_noise_level
AmbientNoiseLevel.
Definition: irs.h:285
u64 timestamp
TimeStamp.
Definition: irs.h:283
s64 sampling_number
SamplingNumber.
Definition: irs.h:282
MomentStatistic.
Definition: irs.h:274
float centroid_y
CentroidY.
Definition: irs.h:277
float centroid_x
CentroidX.
Definition: irs.h:276
float average_intensity
AverageIntensity.
Definition: irs.h:275
PackedClusteringProcessorConfig.
Definition: irs.h:153
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:160
u32 object_pixel_count_min
ObjectPixelCountMin.
Definition: irs.h:161
u8 is_external_light_filter_enabled
IsExternalLightFilterEnabled.
Definition: irs.h:164
u32 object_pixel_count_max
ObjectPixelCountMax.
Definition: irs.h:162
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:154
u8 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:155
u8 gain
IR sensor signal's digital gain.
Definition: irs.h:156
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:157
u8 object_intensity_min
ObjectIntensityMin.
Definition: irs.h:163
IrsRect window_of_interest
WindowOfInterest.
Definition: irs.h:159
PackedFunctionLevel.
Definition: irs.h:99
u8 ir_sensor_function_level
IrSensorFunctionLevel.
Definition: irs.h:100
PackedImageTransferProcessorConfig.
Definition: irs.h:193
u8 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:195
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:194
u8 gain
IR sensor signal's digital gain.
Definition: irs.h:196
u8 format
IrsImageTransferProcessorFormat
Definition: irs.h:200
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:199
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:197
PackedImageTransferProcessorExConfig.
Definition: irs.h:205
u8 gain
IR sensor signal's digital gain.
Definition: irs.h:208
u8 is_external_light_filter_enabled
IsExternalLightFilterEnabled.
Definition: irs.h:216
u16 trimming_start_x
TrimmingStartX.
Definition: irs.h:214
u8 orig_format
OrigFormat IrsImageTransferProcessorFormat.
Definition: irs.h:212
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:206
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:209
u8 trimming_format
TrimmingFormat IrsImageTransferProcessorFormat.
Definition: irs.h:213
u16 trimming_start_y
TrimmingStartY.
Definition: irs.h:215
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:211
u8 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:207
PackedIrLedProcessorConfig.
Definition: irs.h:256
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:257
u8 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:258
PackedMcuVersion.
Definition: irs.h:93
u16 major_version
MajorVersion.
Definition: irs.h:94
u16 minor_version
MinorVersion.
Definition: irs.h:95
PackedMomentProcessorConfig.
Definition: irs.h:125
u64 exposure_time
IR Sensor exposure time in nanoseconds.
Definition: irs.h:126
u8 preprocess
Preprocess.
Definition: irs.h:133
IrsRect window_of_interest
WindowOfInterest.
Definition: irs.h:131
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:132
u8 preprocess_intensity_threshold
PreprocessIntensityThreshold.
Definition: irs.h:134
u8 light_target
Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
Definition: irs.h:127
u8 gain
IR sensor signal's digital gain.
Definition: irs.h:128
u8 is_negative_image_used
Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
Definition: irs.h:129
PackedPointingProcessorConfig.
Definition: irs.h:228
IrsRect window_of_interest
WindowOfInterest.
Definition: irs.h:229
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:230
PackedTeraPluginProcessorConfig.
Definition: irs.h:242
u8 unk_x5
[6.0.0+] This is set to 0x2 | (IrsTeraPluginProcessorConfig::unk_x1 << 7).
Definition: irs.h:245
IrsPackedMcuVersion required_mcu_version
RequiredMcuVersion.
Definition: irs.h:243
u8 unk_x7
[6.0.0+] IrsTeraPluginProcessorConfig::unk_x3
Definition: irs.h:247
u8 mode
Mode.
Definition: irs.h:244
u8 unk_x6
[6.0.0+] IrsTeraPluginProcessorConfig::unk_x2
Definition: irs.h:246
PointingProcessorMarkerState.
Definition: irs.h:314
IrsRect window_of_interest
WindowOfInterest.
Definition: irs.h:326
float unk_x14
Unknown.
Definition: irs.h:325
s64 sampling_number
SamplingNumber.
Definition: irs.h:315
float position_x
PositionX.
Definition: irs.h:323
u8 pointing_status
PointingStatus.
Definition: irs.h:319
float position_y
PositionY.
Definition: irs.h:324
float unk_x8
Unknown.
Definition: irs.h:322
u64 timestamp
TimeStamp.
Definition: irs.h:316
PointingProcessorState.
Definition: irs.h:331
u64 timestamp
TimeStamp.
Definition: irs.h:333
float position_x
PositionX.
Definition: irs.h:336
float position_y
PositionY.
Definition: irs.h:337
s64 sampling_number
SamplingNumber.
Definition: irs.h:332
u32 pointing_status
PointingStatus.
Definition: irs.h:335
ProcessorState.
Definition: irs.h:350
s64 start
Start.
Definition: irs.h:351
u32 count
Count.
Definition: irs.h:352
u32 pad
Padding.
Definition: irs.h:353
Rect.
Definition: irs.h:105
s16 height
Height.
Definition: irs.h:109
s16 x
X.
Definition: irs.h:106
s16 y
Y.
Definition: irs.h:107
s16 width
Width.
Definition: irs.h:108
TeraPluginProcessorConfig.
Definition: irs.h:234
u8 unk_x1
[6.0.0+] Unknown
Definition: irs.h:236
u8 unk_x3
[6.0.0+] Unknown
Definition: irs.h:238
u8 mode
Mode.
Definition: irs.h:235
u8 unk_x2
[6.0.0+] Unknown
Definition: irs.h:237
TeraPluginProcessorState.
Definition: irs.h:342
s64 sampling_number
SamplingNumber.
Definition: irs.h:343
u64 timestamp
TimeStamp.
Definition: irs.h:344
u32 ambient_noise_level
AmbientNoiseLevel.
Definition: irs.h:345
Service object structure.
Definition: service.h:14
int64_t s64
64-bit signed integer.
Definition: types.h:28
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
int16_t s16
16-bit signed integer.
Definition: types.h:26
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
#define NX_CONSTEXPR
Flags a function as constexpr in C++14 and above; or as (always) inline otherwise.
Definition: types.h:92
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21