xref: /aosp_15_r20/external/webp/src/mux/animi.h (revision b2055c353e87c8814eb2b6b1b11112a1562253bd)
1*b2055c35SXin Li // Copyright 2016 Google Inc. All Rights Reserved.
2*b2055c35SXin Li //
3*b2055c35SXin Li // Use of this source code is governed by a BSD-style license
4*b2055c35SXin Li // that can be found in the COPYING file in the root of the source
5*b2055c35SXin Li // tree. An additional intellectual property rights grant can be found
6*b2055c35SXin Li // in the file PATENTS. All contributing project authors may
7*b2055c35SXin Li // be found in the AUTHORS file in the root of the source tree.
8*b2055c35SXin Li // -----------------------------------------------------------------------------
9*b2055c35SXin Li //
10*b2055c35SXin Li // Internal header for animation related functions.
11*b2055c35SXin Li //
12*b2055c35SXin Li // Author: Hui Su ([email protected])
13*b2055c35SXin Li 
14*b2055c35SXin Li #ifndef WEBP_MUX_ANIMI_H_
15*b2055c35SXin Li #define WEBP_MUX_ANIMI_H_
16*b2055c35SXin Li 
17*b2055c35SXin Li #include "src/webp/mux.h"
18*b2055c35SXin Li 
19*b2055c35SXin Li #ifdef __cplusplus
20*b2055c35SXin Li extern "C" {
21*b2055c35SXin Li #endif
22*b2055c35SXin Li 
23*b2055c35SXin Li // Picks the optimal rectangle between two pictures, starting with initial
24*b2055c35SXin Li // values of offsets and dimensions that are passed in. The initial
25*b2055c35SXin Li // values will be clipped, if necessary, to make sure the rectangle is
26*b2055c35SXin Li // within the canvas. "use_argb" must be true for both pictures.
27*b2055c35SXin Li // Parameters:
28*b2055c35SXin Li //   prev_canvas, curr_canvas - (in) two input pictures to compare.
29*b2055c35SXin Li //   is_lossless, quality - (in) encoding settings.
30*b2055c35SXin Li //   x_offset, y_offset, width, height - (in/out) rectangle between the two
31*b2055c35SXin Li //                                                input pictures.
32*b2055c35SXin Li // Returns true on success.
33*b2055c35SXin Li int WebPAnimEncoderRefineRect(
34*b2055c35SXin Li     const struct WebPPicture* const prev_canvas,
35*b2055c35SXin Li     const struct WebPPicture* const curr_canvas,
36*b2055c35SXin Li     int is_lossless, float quality, int* const x_offset, int* const y_offset,
37*b2055c35SXin Li     int* const width, int* const height);
38*b2055c35SXin Li 
39*b2055c35SXin Li #ifdef __cplusplus
40*b2055c35SXin Li }    // extern "C"
41*b2055c35SXin Li #endif
42*b2055c35SXin Li 
43*b2055c35SXin Li #endif  // WEBP_MUX_ANIMI_H_
44