restore behavior (#2418)

This commit is contained in:
ZwX1616 2020-10-26 14:49:28 -07:00 committed by GitHub
parent e1eec3b589
commit d7052094c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -293,7 +293,8 @@ void set_exposure_target(CameraState *c, const uint8_t *pix_ptr, bool front, int
uint8_t lum = pix_ptr[(y * b->yuv_width) + x];
lum_binning[lum]++;
} else {
const uint8_t *pix = &pix_ptr[y * b->rgb_width * 3 + x * 3];
// TODO: should get rid of RGB here
const uint8_t *pix = &pix_ptr[y * b->rgb_stride + x * 3];
unsigned int lum = (unsigned int)(pix[0] + pix[1] + pix[2]);
lum_binning[std::min(lum / 3, 255u)]++;
}