diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-06-09 17:08:51 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-06-09 17:08:51 +0300 |
commit | 6a1af670d52492ab0955933b830026b2a18ed6d6 (patch) | |
tree | 14e423ab81da7312ac0f800aaa6afce7e23abc20 /src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h | |
parent | e57b0df609d744c3ddb2d3f23926a7922e661cb6 (diff) | |
parent | 8fb9a4fdcb05984bb6e9e532e4462aa7bfbeb62e (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into tqtc/lts-5.15-opensourcev5.15.11-lts-lgpl
Change-Id: I1ef7b4328096b0adb6abc46471100b5779504d05
Diffstat (limited to 'src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h')
-rw-r--r-- | src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h b/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h new file mode 100644 index 0000000..2f1a3ff --- /dev/null +++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h @@ -0,0 +1,35 @@ +// Copyright 2022 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Gamma correction utilities. + +#ifndef WEBP_SHARPYUV_SHARPYUV_GAMMA_H_ +#define WEBP_SHARPYUV_SHARPYUV_GAMMA_H_ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// Initializes precomputed tables. Must be called once before calling +// SharpYuvGammaToLinear or SharpYuvLinearToGamma. +void SharpYuvInitGammaTables(void); + +// Converts a gamma color value on 'bit_depth' bits to a 16 bit linear value. +uint32_t SharpYuvGammaToLinear(uint16_t v, int bit_depth); + +// Converts a 16 bit linear color value to a gamma value on 'bit_depth' bits. +uint16_t SharpYuvLinearToGamma(uint32_t value, int bit_depth); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_SHARPYUV_SHARPYUV_GAMMA_H_ |