[irs] Name image transfer config variables

This commit is contained in:
Kostas Missos 2018-03-06 18:56:57 +02:00
parent e7a4eba71c
commit 794a5a4174
2 changed files with 31 additions and 17 deletions

View File

@ -26,22 +26,32 @@ typedef struct {
} PACKED irsPackedMomentProcessorConfig; } PACKED irsPackedMomentProcessorConfig;
typedef struct { typedef struct {
u64 unk_x0; //exposure controls the sensor's exposure time in microseconds.
u32 unk_x8; u64 exposure;
u32 unk_xc; //irLedsMode controls which group of IR leds is enabled. Can be all, group 1, group 2 or none.
u8 unk_x10; u32 irLeds;
//digitalGain controls the signal's digital gain.
u32 digitalGain;
//negative inverts the captured image.
u8 negative;
u8 pad[7]; u8 pad[7];
u32 unk_x18; //sensorResolution controls the sensor's resolution.
u32 sensorResolution;
} irsImageTransferProcessorConfig; } irsImageTransferProcessorConfig;
typedef struct { typedef struct {
u64 unk_x0; //exposure controls the sensor's exposure time in microseconds.
u8 unk_x8; u64 exposure;
u8 unk_x9; //irLedsMode controls which group of IR leds is enabled. Can be all, group 1, group 2 or none.
u8 unk_xa; u8 irLeds;
//digitalGain controls the signal's digital gain.
u8 digitalGain;
//negative inverts the captured image.
u8 negative;
u8 pad[5]; u8 pad[5];
u32 unk_constant;//offset 0x10 u32 unk_constant;//offset 0x10
u8 unk_x14; //sensorResolution controls the sensor's resolution.
u8 sensorResolution;
u8 pad2[3]; u8 pad2[3];
} irsPackedImageTransferProcessorConfig; } irsPackedImageTransferProcessorConfig;

View File

@ -334,12 +334,12 @@ Result irsRunImageTransferProcessor(u32 IrCameraHandle, irsImageTransferProcesso
memset(&packed_config, 0, sizeof(packed_config)); memset(&packed_config, 0, sizeof(packed_config));
packed_config.unk_x0 = config->unk_x0; packed_config.exposure = config->exposure;
packed_config.unk_x8 = config->unk_x8; packed_config.irLeds = config->irLeds;
packed_config.unk_x9 = config->unk_xc; packed_config.digitalGain = config->digitalGain;
packed_config.unk_xa = config->unk_x10; packed_config.negative = config->negative;
packed_config.unk_constant = 0xa0003; packed_config.unk_constant = 0xa0003;
packed_config.unk_x14 = config->unk_x18; packed_config.sensorResolution = config->sensorResolution;
rc = appletGetAppletResourceUserId(&AppletResourceUserId); rc = appletGetAppletResourceUserId(&AppletResourceUserId);
if (R_FAILED(rc)) if (R_FAILED(rc))
@ -416,8 +416,12 @@ Result irsGetImageTransferProcessorState(u32 IrCameraHandle, void* buffer, size_
void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config) { void irsGetDefaultImageTransferProcessorConfig(irsImageTransferProcessorConfig *config) {
memset(config, 0, sizeof(irsImageTransferProcessorConfig)); memset(config, 0, sizeof(irsImageTransferProcessorConfig));
config->unk_x0 = 0x493E0; //Set default exposure 300ms, IR LEDs all ON, 8x digital gain, normal image and resolution 240 x 320.
config->unk_xc = 0x8; config->exposure = 300000;
config->irLeds = 0;
config->digitalGain = 8;
config->negative = 0;
config->sensorResolution = 0;
} }
Result irsGetIrCameraHandle(u32 *IrCameraHandle, HidControllerID id) { Result irsGetIrCameraHandle(u32 *IrCameraHandle, HidControllerID id) {