sk_matrix.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  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. // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
  8. // DO NOT USE -- FOR INTERNAL TESTING ONLY
  9. #ifndef sk_matrix_DEFINED
  10. #define sk_matrix_DEFINED
  11. #include "include/c/sk_types.h"
  12. SK_C_PLUS_PLUS_BEGIN_GUARD
  13. /** Set the matrix to identity */
  14. void sk_matrix_set_identity(sk_matrix_t*);
  15. /** Set the matrix to translate by (tx, ty). */
  16. void sk_matrix_set_translate(sk_matrix_t*, float tx, float ty);
  17. /**
  18. Preconcats the matrix with the specified translation.
  19. M' = M * T(dx, dy)
  20. */
  21. void sk_matrix_pre_translate(sk_matrix_t*, float tx, float ty);
  22. /**
  23. Postconcats the matrix with the specified translation.
  24. M' = T(dx, dy) * M
  25. */
  26. void sk_matrix_post_translate(sk_matrix_t*, float tx, float ty);
  27. /** Set the matrix to scale by sx and sy. */
  28. void sk_matrix_set_scale(sk_matrix_t*, float sx, float sy);
  29. /**
  30. Preconcats the matrix with the specified scale.
  31. M' = M * S(sx, sy)
  32. */
  33. void sk_matrix_pre_scale(sk_matrix_t*, float sx, float sy);
  34. /**
  35. Postconcats the matrix with the specified scale.
  36. M' = S(sx, sy) * M
  37. */
  38. void sk_matrix_post_scale(sk_matrix_t*, float sx, float sy);
  39. SK_C_PLUS_PLUS_END_GUARD
  40. #endif