-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Demosaic.h
29 lines (25 loc) · 1.08 KB
/
Demosaic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef FCAM_DEMOSAIC_H
#define FCAM_DEMOSAIC_H
/** \file
* Converting RAW data to RGB24 by demosiacking and gamma correcting. */
#include "HalideImage.h"
namespace FCam {
/** Demosaic, white balance, and gamma correct a raw frame, and
* return a slightly smaller RGB24 format image. At least four
* pixels are lost from each side of the image, more if necessary
* to maintain the following constraint on the output size: The
* output will have a width that is a multiple of 40, and a height
* which is a multiple of 24. In order to color correct, this uses
* the frame's shot's custom color matrix if it exists. Otherwise,
* it uses the frame's platform's \ref Platform::rawToRGBColorMatrix
* method to retrieve the correct white-balanced color conversion
* matrix. */
void demosaic(Halide::Tools::Image<uint16_t> input,
Halide::Tools::Image<uint8_t> out,
float colorTemp = 3700.0f,
float contrast = 50.0f,
bool denoise = true, int blackLevel = 25,
int whiteLevel = 1023,
float gamma = 2.2f);
}
#endif