Path: blob/master/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.h
9903 views
// Copyright 2022 Google Inc. All Rights Reserved.1//2// Use of this source code is governed by a BSD-style license3// that can be found in the COPYING file in the root of the source4// tree. An additional intellectual property rights grant can be found5// in the file PATENTS. All contributing project authors may6// be found in the AUTHORS file in the root of the source tree.7// -----------------------------------------------------------------------------8//9// Gamma correction utilities.1011#ifndef WEBP_SHARPYUV_SHARPYUV_GAMMA_H_12#define WEBP_SHARPYUV_SHARPYUV_GAMMA_H_1314#include "sharpyuv/sharpyuv.h"15#include "src/webp/types.h"1617#ifdef __cplusplus18extern "C" {19#endif2021// Initializes precomputed tables. Must be called once before calling22// SharpYuvGammaToLinear or SharpYuvLinearToGamma.23void SharpYuvInitGammaTables(void);2425// Converts a 'bit_depth'-bit gamma color value to a 16-bit linear value.26uint32_t SharpYuvGammaToLinear(uint16_t v, int bit_depth,27SharpYuvTransferFunctionType transfer_type);2829// Converts a 16-bit linear color value to a 'bit_depth'-bit gamma value.30uint16_t SharpYuvLinearToGamma(uint32_t value, int bit_depth,31SharpYuvTransferFunctionType transfer_type);3233#ifdef __cplusplus34} // extern "C"35#endif3637#endif // WEBP_SHARPYUV_SHARPYUV_GAMMA_H_383940