blob: 244863c4f266b9f182c1766aff0f473e0084468f [file] [log] [blame]
reedafa278e2014-11-24 19:11:48 -08001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9// DO NOT USE -- FOR INTERNAL TESTING ONLY
10
11#ifndef sk_matrix_DEFINED
12#define sk_matrix_DEFINED
13
Mike Kleinc0bd9f92019-04-23 12:05:21 -050014#include "include/c/sk_types.h"
reedafa278e2014-11-24 19:11:48 -080015
16SK_C_PLUS_PLUS_BEGIN_GUARD
17
halcanaryc9119062015-09-01 10:45:09 -070018/** Set the matrix to identity */
reedafa278e2014-11-24 19:11:48 -080019void sk_matrix_set_identity(sk_matrix_t*);
20
halcanaryc9119062015-09-01 10:45:09 -070021/** Set the matrix to translate by (tx, ty). */
reedafa278e2014-11-24 19:11:48 -080022void sk_matrix_set_translate(sk_matrix_t*, float tx, float ty);
halcanaryc9119062015-09-01 10:45:09 -070023/**
24 Preconcats the matrix with the specified translation.
25 M' = M * T(dx, dy)
26*/
reedafa278e2014-11-24 19:11:48 -080027void sk_matrix_pre_translate(sk_matrix_t*, float tx, float ty);
halcanaryc9119062015-09-01 10:45:09 -070028/**
29 Postconcats the matrix with the specified translation.
30 M' = T(dx, dy) * M
31*/
reedafa278e2014-11-24 19:11:48 -080032void sk_matrix_post_translate(sk_matrix_t*, float tx, float ty);
33
halcanaryc9119062015-09-01 10:45:09 -070034/** Set the matrix to scale by sx and sy. */
reedafa278e2014-11-24 19:11:48 -080035void sk_matrix_set_scale(sk_matrix_t*, float sx, float sy);
halcanaryc9119062015-09-01 10:45:09 -070036/**
37 Preconcats the matrix with the specified scale.
38 M' = M * S(sx, sy)
39*/
reedafa278e2014-11-24 19:11:48 -080040void sk_matrix_pre_scale(sk_matrix_t*, float sx, float sy);
halcanaryc9119062015-09-01 10:45:09 -070041/**
42 Postconcats the matrix with the specified scale.
43 M' = S(sx, sy) * M
44*/
reedafa278e2014-11-24 19:11:48 -080045void sk_matrix_post_scale(sk_matrix_t*, float sx, float sy);
46
47SK_C_PLUS_PLUS_END_GUARD
48
49#endif