[irs] Name image transfer config variables (#61)

* [irs] Name image transfer config variables
This commit is contained in:
Kostas Missos 2018-03-07 02:33:45 +02:00 committed by yellows8
parent a3933c7a85
commit e243e4507e
2 changed files with 24 additions and 17 deletions

View File

@ -26,22 +26,22 @@ typedef struct {
} PACKED irsPackedMomentProcessorConfig;
typedef struct {
u64 unk_x0;
u32 unk_x8;
u32 unk_xc;
u8 unk_x10;
u64 exposure; ///< IR Sensor exposure time in nanoseconds.
u32 ir_leds; ///< Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
u32 digital_gain; ///< IR sensor signal's digital gain.
u8 color_invert; ///< Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
u8 pad[7];
u32 unk_x18;
u32 sensor_res; ///< IR Sensor resolution. 0: 240x320, 1: 120x160, 2: 60x80.
} irsImageTransferProcessorConfig;
typedef struct {
u64 unk_x0;
u8 unk_x8;
u8 unk_x9;
u8 unk_xa;
u64 exposure; ///< IR Sensor exposure time in nanoseconds.
u8 ir_leds; ///< Controls the IR leds. 0: All leds, 1: Bright group, 2: Dim group, 3: None.
u8 digital_gain; ///< IR sensor signal's digital gain.
u8 color_invert; ///< Inverts the colors of the captured image. 0: Normal image, 1: Negative image.
u8 pad[5];
u32 unk_constant;//offset 0x10
u8 unk_x14;
u8 sensor_res; ///< IR Sensor resolution. 0: 240x320, 1: 120x160, 2: 60x80.
u8 pad2[3];
} irsPackedImageTransferProcessorConfig;
@ -79,4 +79,8 @@ Result irsStopImageProcessor(u32 IrCameraHandle);
/// TODO: What does this really do?
Result irsSuspendImageProcessor(u32 IrCameraHandle);
/**
* Gets the default configuration for Image Transfer mode.
* Defaults are exposure 300us, IR LEDs all ON, 8x digital gain, normal image and resolution 240 x 320.
*/
void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config);

View File

@ -334,12 +334,12 @@ Result irsRunImageTransferProcessor(u32 IrCameraHandle, irsImageTransferProcesso
memset(&packed_config, 0, sizeof(packed_config));
packed_config.unk_x0 = config->unk_x0;
packed_config.unk_x8 = config->unk_x8;
packed_config.unk_x9 = config->unk_xc;
packed_config.unk_xa = config->unk_x10;
packed_config.exposure = config->exposure;
packed_config.ir_leds = config->ir_leds;
packed_config.digital_gain = config->digital_gain;
packed_config.color_invert = config->color_invert;
packed_config.unk_constant = 0xa0003;
packed_config.unk_x14 = config->unk_x18;
packed_config.sensor_res = config->sensor_res;
rc = appletGetAppletResourceUserId(&AppletResourceUserId);
if (R_FAILED(rc))
@ -416,8 +416,11 @@ Result irsGetImageTransferProcessorState(u32 IrCameraHandle, void* buffer, size_
void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config) {
memset(config, 0, sizeof(irsImageTransferProcessorConfig));
config->unk_x0 = 0x493E0;
config->unk_xc = 0x8;
config->exposure = 300000;
config->ir_leds = 0;
config->digital_gain = 8;
config->color_invert = 0;
config->sensor_res = 0;
}
Result irsGetIrCameraHandle(u32 *IrCameraHandle, HidControllerID id) {