last update 20 Sep 2009 |
00001 /* 00002 * Copyright (C) 1998 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * 00006 * This file is part of the Computer Vision and Robotics Library (CVR-Lib) 00007 * 00008 * The CVR-Lib is free software; you can redistribute it and/or 00009 * modify it under the terms of the BSD License. 00010 * 00011 * All rights reserved. 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions are met: 00015 * 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 00019 * 2. Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * 00023 * 3. Neither the name of the authors nor the names of its contributors may be 00024 * used to endorse or promote products derived from this software without 00025 * specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00028 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00031 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00032 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00033 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00034 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00035 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00036 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00037 * POSSIBILITY OF SUCH DAMAGE. 00038 */ 00039 00040 00041 00042 /** 00043 * \file cvrTypes.h 00044 * This file contains the definitions of the basic types used in the 00045 * CVR-Lib. 00046 * 00047 * Some types are redefined to compensate the lack of specification in 00048 * the C++ Standard about the byte length of the standard types int, 00049 * char, float, etc. Here an cvr::uint32 uses always four bytes, 00050 * cvr::uint16 uses two bytes and so on. 00051 * 00052 * The defined basic types are: 00053 * - cvr::ubyte (1 byte unsigned) 00054 * - cvr::byte (1 byte signed) 00055 * - cvr::uint16 (2 byte unsigned) 00056 * - cvr::int16 (2 byte signed) 00057 * - cvr::uint32 (4 byte unsigned) 00058 * - cvr::int32 (4 byte signed) 00059 * - cvr::uint64 (8 byte unsigned) 00060 * - cvr::int64 (8 byte signed) 00061 * - cvr::sreal (4 byte floating point) 00062 * - cvr::dreal (8 byte floating point) 00063 * 00064 * \author Pablo Alvarado 00065 * \date 31.03.1999 00066 * 00067 * $Id: cvrTypes.h,v 1.7 2007/04/18 21:13:40 alvarado Exp $ 00068 */ 00069 00070 #ifndef _CVR_TYPES_H 00071 #define _CVR_TYPES_H 00072 00073 #include "cvrConfig.h" 00074 00075 namespace cvr { 00076 /** 00077 * 8-bit unsigned type (0..255) 00078 * 00079 * @ingroup gTypes 00080 */ 00081 typedef unsigned _CVR_BYTE ubyte; 00082 00083 /** 00084 * 8-bit signed type (-128..127) 00085 * 00086 * @ingroup gTypes 00087 */ 00088 typedef signed _CVR_BYTE byte; 00089 00090 /** 00091 * 16-bit unsigned type (0..65535) 00092 * 00093 * @ingroup gTypes 00094 */ 00095 typedef unsigned _CVR_WORD16 uint16; 00096 00097 /** 00098 * 16-bit signed type (-32768..32767) 00099 * 00100 * @ingroup gTypes 00101 */ 00102 typedef signed _CVR_WORD16 int16; 00103 00104 /** 00105 * 32-bit unsigned type (0..(2^32)-1) 00106 * 00107 * @ingroup gTypes 00108 */ 00109 typedef unsigned _CVR_WORD32 uint32; 00110 00111 /** 00112 * 32-bit signed type (-(2^31)..(2^31-1)) 00113 * 00114 * @ingroup gTypes 00115 */ 00116 typedef signed _CVR_WORD32 int32; 00117 00118 /** 00119 * 64-bit unsigned type (0..(2^64)-1) 00120 * 00121 * @ingroup gTypes 00122 */ 00123 __extension__ typedef unsigned _CVR_WORD64 uint64; 00124 00125 /** 00126 * 64-bit signed type (-(2^63)..(2^63-1)) 00127 * 00128 * @ingroup gTypes 00129 */ 00130 __extension__ typedef signed _CVR_WORD64 int64; 00131 00132 /** 00133 * 32-bit floating point type 00134 * 00135 * @ingroup gTypes 00136 */ 00137 typedef float sreal; 00138 00139 /** 00140 * 64-bit floating point type 00141 * 00142 * @ingroup gTypes 00143 */ 00144 typedef double dreal; 00145 00146 /** 00147 * Minimal int32 value achievable using only 24bits 00148 */ 00149 const int32 MinInt24 = -0x00800000; 00150 00151 /** 00152 * Maximal int32 value achievable using only 24bits 00153 */ 00154 const int32 MaxInt24 = +0x007fffff; 00155 00156 } 00157 00158 #endif 00159