• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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 // Utilities for processing transparent channel.
11 //
12 // Author: Skal (pascal.massimino@gmail.com)
13 
14 #ifndef WEBP_UTILS_ALPHA_PROCESSING_H_
15 #define WEBP_UTILS_ALPHA_PROCESSING_H_
16 
17 #include "../webp/types.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 // Pre-Multiply operation transforms x into x * A / 255  (where x=Y,R,G or B).
24 // Un-Multiply operation transforms x into x * 255 / A.
25 
26 // Pre-Multiply or Un-Multiply (if 'inverse' is true) argb values in a row.
27 void WebPMultARGBRow(uint32_t* const ptr, int width, int inverse);
28 
29 // Same a WebPMultARGBRow(), but for several rows.
30 void WebPMultARGBRows(uint8_t* ptr, int stride, int width, int num_rows,
31                       int inverse);
32 
33 // Same for a row of single values, with side alpha values.
34 void WebPMultRow(uint8_t* const ptr, const uint8_t* const alpha,
35                  int width, int inverse);
36 
37 // Same a WebPMultRow(), but for several 'num_rows' rows.
38 void WebPMultRows(uint8_t* ptr, int stride,
39                   const uint8_t* alpha, int alpha_stride,
40                   int width, int num_rows, int inverse);
41 
42 #ifdef __cplusplus
43 }    // extern "C"
44 #endif
45 
46 #endif    // WEBP_UTILS_ALPHA_PROCESSING_H_
47