helpers.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: helpers.h
37 // Author: Pedram Azad
38 // Date: 2004
39 // ****************************************************************************
40 
41 
42 #ifndef _HELPERS_H_
43 #define _HELPERS_H_
44 
45 #if defined(__hppa__) || \
46  defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
47  (defined(__MIPS__) && defined(__MISPEB__)) || \
48  defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
49  defined(__sparc__)
50 
51 #ifndef IVT_BIG_ENDIAN
52 #define IVT_BIG_ENDIAN 1
53 #endif
54 
55 #endif
56 
57 
58 
59 // ****************************************************************************
60 // Defines
61 // ****************************************************************************
62 
63 #define MY_MAX(a, b) (((a) > (b)) ? (a) : (b))
64 #define MY_MIN(a, b) (((a) < (b)) ? (a) : (b))
65 
66 
67 // ****************************************************************************
68 // Declarations
69 // ****************************************************************************
70 
71 extern float invert_byte_order_float(float x);
72 extern unsigned long invert_byte_order_long(unsigned long x);
73 extern unsigned int invert_byte_order_int(unsigned int x);
74 extern unsigned short invert_byte_order_short(unsigned short x);
75 extern long invert_byte_order_long(long x);
76 extern int invert_byte_order_int(int x);
77 extern short invert_byte_order_short(short x);
78 extern void get_timer_value(unsigned int &sec, unsigned int &usec);
79 extern unsigned int get_timer_value(bool bResetTimer = false);
80 extern int my_round(double x);
81 extern int my_round(float x);
82 extern double uniform_random();
83 extern double gaussian_random();
84 extern float uniform_random_float();
85 extern float gaussian_random_float();
86 extern void sleep_ms(unsigned int ms);
87 extern void hsv2rgb(int h, int s, int v, int &r, int &g, int &b);
88 extern void rgb2hsv(int r, int g, int b, int &h, int &s, int &v);
89 extern void *aligned_malloc(unsigned int size, unsigned int align_size = 16);
90 extern void aligned_free(void *ptr);
91 extern const char *GetVersionIVT();
92 
93 
94 
95 #endif /* _HELPERS_H_ */
GLubyte g
Definition: glext.h:5166
double gaussian_random()
Definition: helpers.cpp:263
void * aligned_malloc(unsigned int size, unsigned int align_size=16)
Definition: helpers.cpp:409
float invert_byte_order_float(float x)
Definition: helpers.cpp:73
int my_round(double x)
Definition: helpers.cpp:325
void get_timer_value(unsigned int &sec, unsigned int &usec)
Definition: helpers.cpp:135
const char * GetVersionIVT()
Definition: helpers.cpp:435
GLdouble s
Definition: glext.h:3211
double uniform_random()
Definition: helpers.cpp:251
void rgb2hsv(int r, int g, int b, int &h, int &s, int &v)
Definition: helpers.cpp:381
void hsv2rgb(int h, int s, int v, int &r, int &g, int &b)
Definition: helpers.cpp:348
GLenum GLint x
Definition: glext.h:3125
float uniform_random_float()
Definition: helpers.cpp:256
void aligned_free(void *ptr)
Definition: helpers.cpp:426
unsigned short invert_byte_order_short(unsigned short x)
Definition: helpers.cpp:99
GLubyte GLubyte b
Definition: glext.h:5166
float gaussian_random_float()
Definition: helpers.cpp:294
GLdouble GLdouble GLdouble r
Definition: glext.h:3227
GLsizeiptr size
Definition: glext.h:3388
void sleep_ms(unsigned int ms)
Definition: helpers.cpp:336
const GLdouble * v
Definition: glext.h:3212
unsigned int invert_byte_order_int(unsigned int x)
Definition: helpers.cpp:89
unsigned long invert_byte_order_long(unsigned long x)
Definition: helpers.cpp:79


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