You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
1014 B

// SPDX-FileCopyrightText: 2020 Foundation Devices, Inc. <hello@foundationdevices.com>
4 years ago
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <stdint.h>
// Convert the RGB565 image to 1-byte-per-pixel grayscale
// The conversion is performed with a 90 degree rotation due to the fact that the camera is installed portrait,
// but the data stream is still the landscape orientation.
//
// This function is very much hard-coded to our use case where the grayscale image is used for QR decoding,
// and the monochrome image is cropped and used for the viewfinder image on screen.
void convert_rgb565_to_grayscale_and_mono(uint16_t *rgb565,
uint8_t *grayscale,
uint32_t gray_width,
uint32_t gray_height,
uint8_t *mono,
uint32_t mono_width,
uint32_t mono_height);