JeVoisBase  1.6
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
env_types.h
Go to the documentation of this file.
1 /*!@file Envision/env_types.h Basic integer types */
2 
3 // //////////////////////////////////////////////////////////////////// //
4 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
5 // University of Southern California (USC) and the iLab at USC. //
6 // See http://iLab.usc.edu for information about this project. //
7 // //////////////////////////////////////////////////////////////////// //
8 // Major portions of the iLab Neuromorphic Vision Toolkit are protected //
9 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
10 // in Visual Environments, and Applications'' by Christof Koch and //
11 // Laurent Itti, California Institute of Technology, 2001 (patent //
12 // pending; application number 09/912,225 filed July 23, 2001; see //
13 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). //
14 // //////////////////////////////////////////////////////////////////// //
15 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. //
16 // //
17 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can //
18 // redistribute it and/or modify it under the terms of the GNU General //
19 // Public License as published by the Free Software Foundation; either //
20 // version 2 of the License, or (at your option) any later version. //
21 // //
22 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope //
23 // that it will be useful, but WITHOUT ANY WARRANTY; without even the //
24 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
25 // PURPOSE. See the GNU General Public License for more details. //
26 // //
27 // You should have received a copy of the GNU General Public License //
28 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write //
29 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, //
30 // Boston, MA 02111-1307 USA. //
31 // //////////////////////////////////////////////////////////////////// //
32 //
33 // Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu>
34 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Envision/env_types.h $
35 // $Id: env_types.h 7975 2007-02-22 04:29:11Z rjpeters $
36 //
37 
38 #pragma once
39 
41 
42 //! 8-bit unsigned integer
43 typedef unsigned char byte;
44 
45 //! 16-bit signed integer
46 typedef short intg16;
47 
48 typedef char env_intg16_must_be_16_bits[sizeof(intg16) == 2
49  ? 1 : -1];
50 
51 //! 32-bit signed integer
53 
54 #define INTG32_MAX ((ENV_INTG32_TYPE)(((unsigned ENV_INTG32_TYPE)(-1)) >> 1))
55 #define INTG32_MIN ((ENV_INTG32_TYPE)((((unsigned ENV_INTG32_TYPE)(-1)) >> 1) + 1))
56 
57 typedef char env_intg32_must_be_32_bits[sizeof(intg32) == 4
58  ? 1 : -1];
59 
60 #ifdef ENV_INTG64_TYPE
61 
62 //! 64-bit signed integer
63 typedef long long intg64;
64 
65 typedef char env_intg64_must_be_64_bits[sizeof(intg64) == 8
66  ? 1 : -1];
67 
68 #endif
69 
70 typedef long env_ssize_t;
71 typedef unsigned long env_size_t;
72 
73 //! RGB pixel class
75 {
76  byte p[3];
77 };
78 
79 //! A simple struct to hold a pair of width/height dimensions.
80 struct env_dims
81 {
82  env_size_t w; //!< The width.
83  env_size_t h; //!< The height.
84 };
85 
86 /// Types of normalization
88 {
89  ENV_VCXNORM_NONE = 0, //!< no max-normalization, but may change range
90  ENV_VCXNORM_MAXNORM = 1, //!< non-iterative maxnorm
91 };
92 
93 #define ENV_MAX(a, b) ( (a) > (b) ? (a) : (b) )
94 #define ENV_MIN(a, b) ( (a) < (b) ? (a) : (b) )
95 #define ENV_ABS(a) ( (a) > 0 ? (a) : -(a) )
char env_intg32_must_be_32_bits[sizeof(intg32)==4 ? 1 :-1]
Definition: env_types.h:58
env_size_t w
The width.
Definition: env_types.h:82
short intg16
16-bit signed integer
Definition: env_types.h:46
char env_intg16_must_be_16_bits[sizeof(intg16)==2 ? 1 :-1]
Definition: env_types.h:49
no max-normalization, but may change range
Definition: env_types.h:89
env_maxnorm_type
Types of normalization.
Definition: env_types.h:87
byte p[3]
Definition: env_types.h:76
env_size_t h
The height.
Definition: env_types.h:83
unsigned long env_size_t
Definition: env_types.h:71
#define ENV_INTG32_TYPE
Definition: env_config.h:46
RGB pixel class.
Definition: env_types.h:74
unsigned char byte
8-bit unsigned integer
Definition: env_types.h:43
type_with_N_bits< unsigned char, 8 >::type byte
8-bit unsigned integer
Definition: Types.H:86
ENV_INTG32_TYPE intg32
32-bit signed integer
Definition: env_types.h:52
A simple struct to hold a pair of width/height dimensions.
Definition: env_types.h:80
long env_ssize_t
Definition: env_types.h:70
non-iterative maxnorm
Definition: env_types.h:90