home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Updates / Flash / flashplayer / flashlib / h / matrix < prev    next >
Encoding:
Text File  |  2000-03-23  |  1.4 KB  |  61 lines

  1. /////////////////////////////////////////////////////////////
  2. // Flash Plugin and Player
  3. // Copyright (C) 1998,1999 Olivier Debon
  4. //
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. //
  19. ///////////////////////////////////////////////////////////////
  20. #ifndef _MATRIX_H_
  21. #define _MATRIX_H_
  22.  
  23. #if defined(USE_FIX)
  24. #include "fixpoint.h"
  25. #endif
  26.  
  27.  
  28. struct Matrix {
  29. #if defined(USE_FIX)
  30.     fixpoint a,b,c,d;
  31. #else
  32.     float a,b,c,d;
  33. #endif
  34.     long tx,ty;
  35. public:
  36.     Matrix operator*(Matrix);
  37.     Matrix invert();
  38.     Matrix();
  39.  
  40. #ifdef DUMP
  41.     void dump(BitStream *bs);
  42. #endif
  43.  
  44.     inline
  45.     long Matrix::getX(long x, long y)
  46.     {
  47. //        return (long) ((x*a)+(y*b)+tx);
  48.         return (long) (a*x+b*y+tx);
  49.     };
  50.  
  51.     inline
  52.     long Matrix::getY(long x, long y)
  53.     {
  54. //        return (long) (x*c+y*d+ty);
  55.         return (long) (c*x+d*y+ty);
  56.     };
  57.  
  58. };
  59.  
  60. #endif /* _MATRIX_H_ */
  61.