no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / media / libwebp / sharpyuv / sharpyuv_gamma.h
blobd13aff59e185b825b9f87d650c8544843e045c5c
1 // Copyright 2022 Google Inc. All Rights Reserved.
2 //
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the COPYING file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 // -----------------------------------------------------------------------------
9 //
10 // Gamma correction utilities.
12 #ifndef WEBP_SHARPYUV_SHARPYUV_GAMMA_H_
13 #define WEBP_SHARPYUV_SHARPYUV_GAMMA_H_
15 #include "src/webp/types.h"
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 // Initializes precomputed tables. Must be called once before calling
22 // SharpYuvGammaToLinear or SharpYuvLinearToGamma.
23 void SharpYuvInitGammaTables(void);
25 // Converts a gamma color value on 'bit_depth' bits to a 16 bit linear value.
26 uint32_t SharpYuvGammaToLinear(uint16_t v, int bit_depth);
28 // Converts a 16 bit linear color value to a gamma value on 'bit_depth' bits.
29 uint16_t SharpYuvLinearToGamma(uint32_t value, int bit_depth);
31 #ifdef __cplusplus
32 } // extern "C"
33 #endif
35 #endif // WEBP_SHARPYUV_SHARPYUV_GAMMA_H_