Home | History | Annotate | Download | only in b_TensorEm
      1 /*
      2  * Copyright (C) 2008 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef bts_INT16MAT2D_EM_H
     18 #define bts_INT16MAT2D_EM_H
     19 
     20 /* ---- includes ----------------------------------------------------------- */
     21 
     22 #include "b_BasicEm/Basic.h"
     23 #include "b_BasicEm/Phase.h"
     24 #include "b_TensorEm/Int16Vec2D.h"
     25 
     26 /* ---- related objects  --------------------------------------------------- */
     27 
     28 /* ---- typedefs ----------------------------------------------------------- */
     29 
     30 /* ---- constants ---------------------------------------------------------- */
     31 
     32 /* ---- object definition -------------------------------------------------- */
     33 
     34 /** 2d matrix */
     35 struct bts_Int16Mat2D
     36 {
     37 
     38 	/* ---- private data --------------------------------------------------- */
     39 
     40 	/* ---- public data ---------------------------------------------------- */
     41 
     42 	/** xx component */
     43 	int16 xxE;
     44 
     45 	/** xy component */
     46 	int16 xyE;
     47 
     48 	/** yx component */
     49 	int16 yxE;
     50 
     51 	/** yy component */
     52 	int16 yyE;
     53 
     54 	/** fixed point position */
     55 	int16 bbpE;
     56 };
     57 
     58 /* ---- associated objects ------------------------------------------------- */
     59 
     60 /* ---- external functions ------------------------------------------------- */
     61 
     62 /* ---- \ghd{ constructor/destructor } ------------------------------------- */
     63 
     64 /* ---- \ghd{ operators } -------------------------------------------------- */
     65 
     66 /* ---- \ghd{ query functions } -------------------------------------------- */
     67 
     68 /* ---- \ghd{ modify functions } ------------------------------------------- */
     69 
     70 /* ---- \ghd{ memory I/O } ------------------------------------------------- */
     71 
     72 /* ---- \ghd{ exec functions } --------------------------------------------- */
     73 
     74 /** creates identity matrix */
     75 struct bts_Int16Mat2D bts_Int16Mat2D_createIdentity( void );
     76 
     77 /** creates rotation matrix */
     78 struct bts_Int16Mat2D bts_Int16Mat2D_createRotation( phase16 angleA );
     79 
     80 /** creates rigid matrix (scale & rotation) */
     81 struct bts_Int16Mat2D bts_Int16Mat2D_createRigid( phase16 angleA, struct flt16 scaleA );
     82 
     83 /** scales matrix by a factor */
     84 void bts_Int16Mat2D_scale( struct bts_Int16Mat2D* ptrA, struct flt16 scaleA );
     85 
     86 /** multiplies matrix with vecA; returns resulting vector */
     87 struct bts_Int16Vec2D bts_Int16Mat2D_map( const struct bts_Int16Mat2D* matPtrA,
     88 								          const struct bts_Int16Vec2D* vecPtrA );
     89 
     90 /** multiplies matrix with matA; returns resulting matrix */
     91 struct bts_Int16Mat2D bts_Int16Mat2D_mul( const struct bts_Int16Mat2D* mat1PtrA,
     92 								          const struct bts_Int16Mat2D* mat2PtrA );
     93 
     94 #endif /* bts_INT16MAT2D_EM_H */
     95 
     96