1afa278e250034186497722b1bc49ced885770249reed/* 2afa278e250034186497722b1bc49ced885770249reed * Copyright 2014 Google Inc. 3afa278e250034186497722b1bc49ced885770249reed * 4afa278e250034186497722b1bc49ced885770249reed * Use of this source code is governed by a BSD-style license that can be 5afa278e250034186497722b1bc49ced885770249reed * found in the LICENSE file. 6afa278e250034186497722b1bc49ced885770249reed */ 7afa278e250034186497722b1bc49ced885770249reed 8afa278e250034186497722b1bc49ced885770249reed// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL 9afa278e250034186497722b1bc49ced885770249reed// DO NOT USE -- FOR INTERNAL TESTING ONLY 10afa278e250034186497722b1bc49ced885770249reed 11afa278e250034186497722b1bc49ced885770249reed#ifndef sk_matrix_DEFINED 12afa278e250034186497722b1bc49ced885770249reed#define sk_matrix_DEFINED 13afa278e250034186497722b1bc49ced885770249reed 14afa278e250034186497722b1bc49ced885770249reed#include "sk_types.h" 15afa278e250034186497722b1bc49ced885770249reed 16afa278e250034186497722b1bc49ced885770249reedSK_C_PLUS_PLUS_BEGIN_GUARD 17afa278e250034186497722b1bc49ced885770249reed 182880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** Set the matrix to identity */ 19afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_set_identity(sk_matrix_t*); 20afa278e250034186497722b1bc49ced885770249reed 212880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** Set the matrix to translate by (tx, ty). */ 22afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_set_translate(sk_matrix_t*, float tx, float ty); 232880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** 242880df2609eba09b555ca37be04b6ad89290c765Tom Hudson Preconcats the matrix with the specified translation. 252880df2609eba09b555ca37be04b6ad89290c765Tom Hudson M' = M * T(dx, dy) 262880df2609eba09b555ca37be04b6ad89290c765Tom Hudson*/ 27afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_pre_translate(sk_matrix_t*, float tx, float ty); 282880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** 292880df2609eba09b555ca37be04b6ad89290c765Tom Hudson Postconcats the matrix with the specified translation. 302880df2609eba09b555ca37be04b6ad89290c765Tom Hudson M' = T(dx, dy) * M 312880df2609eba09b555ca37be04b6ad89290c765Tom Hudson*/ 32afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_post_translate(sk_matrix_t*, float tx, float ty); 33afa278e250034186497722b1bc49ced885770249reed 342880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** Set the matrix to scale by sx and sy. */ 35afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_set_scale(sk_matrix_t*, float sx, float sy); 362880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** 372880df2609eba09b555ca37be04b6ad89290c765Tom Hudson Preconcats the matrix with the specified scale. 382880df2609eba09b555ca37be04b6ad89290c765Tom Hudson M' = M * S(sx, sy) 392880df2609eba09b555ca37be04b6ad89290c765Tom Hudson*/ 40afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_pre_scale(sk_matrix_t*, float sx, float sy); 412880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** 422880df2609eba09b555ca37be04b6ad89290c765Tom Hudson Postconcats the matrix with the specified scale. 432880df2609eba09b555ca37be04b6ad89290c765Tom Hudson M' = S(sx, sy) * M 442880df2609eba09b555ca37be04b6ad89290c765Tom Hudson*/ 45afa278e250034186497722b1bc49ced885770249reedvoid sk_matrix_post_scale(sk_matrix_t*, float sx, float sy); 46afa278e250034186497722b1bc49ced885770249reed 47afa278e250034186497722b1bc49ced885770249reedSK_C_PLUS_PLUS_END_GUARD 48afa278e250034186497722b1bc49ced885770249reed 49afa278e250034186497722b1bc49ced885770249reed#endif 50