mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
Merge pull request #2812 from kwagyeman/kwabena/cleanup_post_processing
Some checks are pending
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Waiting to run
🔥 Firmware Build / build-firmware (DOCKER) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV2) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Waiting to run
🔥 Firmware Build / code-size-report (push) Blocked by required conditions
🔥 Firmware Build / stable-release (push) Blocked by required conditions
🔥 Firmware Build / development-release (push) Blocked by required conditions
Some checks are pending
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Waiting to run
🔥 Firmware Build / build-firmware (DOCKER) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV2) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Waiting to run
🔥 Firmware Build / code-size-report (push) Blocked by required conditions
🔥 Firmware Build / stable-release (push) Blocked by required conditions
🔥 Firmware Build / development-release (push) Blocked by required conditions
drivers/sensors: Update to using post_process callback.
This commit is contained in:
commit
20e9b465d5
@ -138,13 +138,7 @@ static int set_colorbar(omv_csi_t *csi, int enable) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
||||
int ret = ((omv_csi_snapshot_t) csi->priv)(csi, image, flags);
|
||||
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int post_process(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
||||
int num_pixels = csi->resolution[boson_framesize][0] * csi->resolution[boson_framesize][1];
|
||||
|
||||
if (csi->color_palette && (framebuffer_get_buffer_size(csi->fb) >= (num_pixels * sizeof(uint16_t)))) {
|
||||
@ -156,7 +150,7 @@ static int snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
||||
csi->fb->pixfmt = PIXFORMAT_RGB565;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int boson_init(omv_csi_t *csi) {
|
||||
@ -165,8 +159,7 @@ int boson_init(omv_csi_t *csi) {
|
||||
csi->set_pixformat = set_pixformat;
|
||||
csi->set_framesize = set_framesize;
|
||||
csi->set_colorbar = set_colorbar;
|
||||
csi->priv = csi->snapshot;
|
||||
csi->snapshot = snapshot;
|
||||
csi->post_process = post_process;
|
||||
|
||||
// Set csi flags
|
||||
csi->vsync_pol = 0;
|
||||
|
@ -667,21 +667,16 @@ static int reset(omv_csi_t *csi) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int paj6100_snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
||||
int ret = ((omv_csi_snapshot_t) csi->priv)(csi, image, flags);
|
||||
|
||||
if (ret == 0) {
|
||||
l_total = 0;
|
||||
int iml = image->h * image->w;
|
||||
for (int i = 0; i < iml; ++i) {
|
||||
l_total += image->data[i];
|
||||
}
|
||||
// PAJ6100 doesn't support HW auto-exposure,
|
||||
// we provide a software implementation.
|
||||
auto_exposure(csi);
|
||||
static int post_process(omv_csi_t *csi, image_t *image, uint32_t flags) {
|
||||
l_total = 0;
|
||||
int iml = image->h * image->w;
|
||||
for (int i = 0; i < iml; ++i) {
|
||||
l_total += image->data[i];
|
||||
}
|
||||
|
||||
return ret;
|
||||
// PAJ6100 doesn't support HW auto-exposure,
|
||||
// we provide a software implementation.
|
||||
auto_exposure(csi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int paj6100_init(omv_csi_t *csi) {
|
||||
@ -708,8 +703,7 @@ int paj6100_init(omv_csi_t *csi) {
|
||||
csi->set_special_effect = set_special_effect;
|
||||
csi->set_lens_correction = set_lens_correction;
|
||||
|
||||
csi->priv = csi->snapshot;
|
||||
csi->snapshot = paj6100_snapshot;
|
||||
csi->post_process = post_process;
|
||||
|
||||
// Set csi flags
|
||||
csi->vsync_pol = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user