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_FUNCTIONS_EM_H
18#define bts_FUNCTIONS_EM_H
19
20/**
21 * This file contains general purpose functions.
22 */
23
24/* ---- includes ----------------------------------------------------------- */
25
26#include "b_BasicEm/Functions.h"
27
28/* ---- related objects  --------------------------------------------------- */
29
30/* ---- typedefs ----------------------------------------------------------- */
31
32enum bts_AltType
33{
34	bts_ALT_IDENTITY = 1,   /* identity transformation */
35	bts_ALT_TRANS,          /* restricted to translation only */
36	bts_ALT_TRANS_SCALE,    /* restricted to translation and scale only */
37	bts_ALT_RIGID,		    /* restricted to rigid transformation (translation + scale + rotation) */
38	bts_ALT_LINEAR,			/* allows all degrees of freedom for affine linear transformation  */
39	bts_ALT_TRANS_SCALE_XYZ	/* restricted to translation and scaling in x,y,z directions */
40};
41
42enum bts_RBFType
43{
44	bts_RBF_IDENTITY = 1,	/* no rbf deformation	*/
45	bts_RBF_LINEAR			/* linear, i.e. ||r||	*/
46};
47
48/* ---- constants ---------------------------------------------------------- */
49
50/* ---- external functions ------------------------------------------------- */
51
52/** compute the integer logarithm of the absolute value */
53uint32 bts_absIntLog2( int32 vA );
54
55/** compute the integer logarithm of the maximal absolute value of all arguments */
56uint32 bts_maxAbsIntLog2Of2( int32 v1A, int32 v2A );
57
58/** compute the integer logarithm of the maximal absolute value of all arguments */
59uint32 bts_maxAbsIntLog2Of3( int32 v1A, int32 v2A, int32 v3A );
60
61/** compute the integer logarithm of the maximal absolute value of all arguments */
62uint32 bts_maxAbsIntLog2Of4( int32 v1A, int32 v2A, int32 v3A, int32 v4A );
63
64#endif /* bts_FUNCTIONS_EM_H */
65
66