OptimizedFunctions.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // This file is part of the Integrating Vision Toolkit (IVT).
3 //
4 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
5 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
6 //
7 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
8 // All rights reserved.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are met:
12 //
13 // 1. Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
19 //
20 // 3. Neither the name of the KIT nor the names of its contributors may be
21 // used to endorse or promote products derived from this software
22 // without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
25 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
28 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // ****************************************************************************
35 // ****************************************************************************
36 // Filename: OptimizedFunctions.h
37 // Author: Florian Hecht
38 // Date: 2008
39 // ****************************************************************************
40 
41 #ifndef _OPTIMIZED_FUNCTIONS_H_
42 #define _OPTIMIZED_FUNCTIONS_H_
43 
44 
45 
46 #ifdef OPT_DEFINE
47 #define OPTIMIZED_FUNCTION
48 #define OPTIMIZED_FUNCTION_END = 0
49 #else
50 #define OPTIMIZED_FUNCTION extern
51 #define OPTIMIZED_FUNCTION_END
52 #endif
53 
54 // the header and footer have to be placed in each function that has an optimized version
55 // different macros for different number of parameters
56 #define OPTIMIZED_FUNCTION_HEADER_0(name) if (Optimized##name == NULL || Optimized##name() == 0) {
57 #define OPTIMIZED_FUNCTION_HEADER_1(name, p1) if (Optimized##name == NULL || Optimized##name(p1) == 0) {
58 #define OPTIMIZED_FUNCTION_HEADER_2(name, p1, p2) if (Optimized##name == NULL || Optimized##name(p1, p2) == 0) {
59 #define OPTIMIZED_FUNCTION_HEADER_2_ROI(name, p1, p2, p3) if (Optimized##name == NULL || p3 != 0 || Optimized##name(p1, p2) == 0) {
60 #define OPTIMIZED_FUNCTION_HEADER_3(name, p1, p2, p3) if (Optimized##name == NULL || Optimized##name(p1, p2, p3) == 0) {
61 #define OPTIMIZED_FUNCTION_HEADER_3_ROI(name, p1, p2, p3, p4) if (Optimized##name == NULL || p4 != 0 || Optimized##name(p1, p2, p3) == 0) {
62 #define OPTIMIZED_FUNCTION_HEADER_4(name, p1, p2, p3, p4) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4) == 0) {
63 #define OPTIMIZED_FUNCTION_HEADER_5(name, p1, p2, p3, p4, p5) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4, p5) == 0) {
64 #define OPTIMIZED_FUNCTION_HEADER_5_RET(name, p1, p2, p3, p4, p5) int nRet; if (Optimized##name != NULL && Optimized##name(p1, p2, p3, p4, p5, nRet) != 0) return nRet;
65 #define OPTIMIZED_FUNCTION_HEADER_8(name, p1, p2, p3, p4, p5, p6, p7, p8) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4, p5, p6, p7, p8) == 0) {
66 #define OPTIMIZED_FUNCTION_HEADER_8_ROI(name, p1, p2, p3, p4, p5, p6, p7, p8, p9) if (Optimized##name == NULL || p9 != 0 || Optimized##name(p1, p2, p3, p4, p5, p6, p7, p8) == 0) {
67 #define OPTIMIZED_FUNCTION_HEADER_9(name, p1, p2, p3, p4, p5, p6, p7, p8, p9) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4, p5, p6, p7, p8, p9) == 0) {
68 
69 #define OPTIMIZED_FUNCTION_FOOTER }
70 
71 // these macros create a type definition of function and declare a function pointer to that function
72 // different macros for different number of parameters
73 #define DECLARE_OPTIMIZED_FUNCTION_0(name) typedef int (*DefOptimized##name)(); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
74 #define DECLARE_OPTIMIZED_FUNCTION_1(name, p1) typedef int (*DefOptimized##name)(p1); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
75 #define DECLARE_OPTIMIZED_FUNCTION_2(name, p1, p2) typedef int (*DefOptimized##name)(p1, p2); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
76 #define DECLARE_OPTIMIZED_FUNCTION_3(name, p1, p2, p3) typedef int (*DefOptimized##name)(p1, p2, p3); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
77 #define DECLARE_OPTIMIZED_FUNCTION_4(name, p1, p2, p3, p4) typedef int (*DefOptimized##name)(p1, p2, p3, p4); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
78 #define DECLARE_OPTIMIZED_FUNCTION_5(name, p1, p2, p3, p4, p5) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
79 #define DECLARE_OPTIMIZED_FUNCTION_5_RET(name, p1, p2, p3, p4, p5) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5, int &nRet); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
80 #define DECLARE_OPTIMIZED_FUNCTION_8(name, p1, p2, p3, p4, p5, p6, p7, p8) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5, p6, p7, p8); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
81 #define DECLARE_OPTIMIZED_FUNCTION_9(name, p1, p2, p3, p4, p5, p6, p7, p8, p9) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
82 
83 // this include will generate the necessary declaration
84 // due to the DECLARE_OPTIMIZED_FUNCTION_x macros
85 #include "OptimizedFunctionsList.h"
86 
87 
88 
89 #endif /* _OPTIMIZED_FUNCTIONS_H_ */


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28