summaryrefslogtreecommitdiff
path: root/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-08-23 16:47:48 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-08-23 19:05:53 +0200
commite5e34f21fc36c8a162bb46e845bb3465cd434150 (patch)
tree604818f4a22ad5ab35c8defba0baedad40d203ed /thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h
parente95872eb7f4e94f8daac565d67020bb2260e92bd (diff)
libwebp: Sync with upstream 1.2.4
Changes: https://chromium.googlesource.com/webm/libwebp/+/1.2.4/NEWS
Diffstat (limited to 'thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h')
-rw-r--r--thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h b/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h
new file mode 100644
index 0000000000..2f1a3ff4a0
--- /dev/null
+++ b/thirdparty/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_