source: soft/giet_vm/applications/rosenfeld/nrc2/include/nrtype.h @ 772

Last change on this file since 772 was 772, checked in by meunier, 8 years ago
  • Ajout de l'application rosenfeld
  • Changement du nom du flag O_CREATE en O_CREAT
File size: 5.1 KB
Line 
1/* ---------------- */
2/* --- nrtype.h --- */
3/* ---------------- */
4
5/*
6 * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved
7 * Univ Paris Sud XI, CNRS
8 *
9 * Modif : 15/01/2001 : rgb16, rgb32 are now signed (int16, int32)
10 * modif : 22/02/2001 : new types : float32 & float64
11 * modif : 15/02/2004 : clean-up previous definition for mac-OSX port
12 * modif:  1/06/2010 : split of def.h into nrtype.h nrdefine.h ...
13 */
14
15#ifndef _NRTYPE_H_
16#define _NRTYPE_H_
17
18#ifdef __cplusplus
19#pragma message ("C++")
20extern "C" {
21#endif
22   
23#define VERBOSE_PRAGMA
24
25#ifdef VERBOSE_PRAGMA
26//#pragma message ("- include nrtype.h")
27#endif
28
29// ---------------------------------- //
30// -- don not write under the line -- //
31// ---------------------------------- //
32
33#include "mypredef.h"
34   
35typedef unsigned char BOOLEAN;
36typedef unsigned char boolean;
37typedef          int  BOOL;
38#ifdef VERBOSE_PRAGMA
39//#pragma message("boolean")
40#endif
41
42#ifndef TRUE
43#define TRUE 1
44#else
45#pragma message("  ATTENTION : TRUE  already defined")
46#endif
47
48#ifndef FALSE
49#define FALSE 0
50#else
51#pragma message("  ATTENTION : FALSE  already defined")
52#endif
53
54/* ------------------------------- */
55/* --- 8, 16, 32, 64 bit types --- */
56/* ------------------------------- */
57// old types to be removed
58//typedef sint16  usint16 ;
59//typedef int uint;
60
61// half-typed types
62
63typedef char  byte;
64//typedef char  usint16 ;
65//typedef char  uint;
66
67typedef char  int8;
68typedef short int16;
69typedef int   int32;
70typedef long long  int64;
71   
72#ifdef LIBCOMP
73#if defined(myCompiler_ICC) || defined (myCompiler_MSC)
74typedef __int64  int64;
75#else
76typedef long long  int64;
77#endif
78#endif
79
80// full-typed types
81typedef   signed char sint8;
82typedef unsigned char uint8;
83
84typedef   signed short  sint16;
85typedef unsigned short  uint16;
86
87typedef   signed int sint32;
88typedef unsigned int uint32;
89
90#if defined(myCompiler_ICC) || defined (myCompiler_MSC)
91typedef          __int64  int64;
92typedef   signed __int64 sint64;
93typedef unsigned __int64 uint64;
94#else
95typedef   signed long long sint64;
96typedef unsigned long long uint64;
97#endif
98
99typedef float   float32;
100typedef double  float64;
101
102/* -------------------- */
103/* --- complex type --- */
104/* -------------------- */
105typedef struct { float32 x; float32 y;} complex32;
106typedef struct { float64 x; float64 y;} complex64;
107
108/* --------------------- */
109/* --- RGB, BGR type --- */
110/* --------------------- */
111//typedef struct { byte  r; byte  g; byte  b; } rgb8;
112
113typedef struct { uint8   r; uint8   g; uint8   b; } rgb8;
114typedef struct { sint16  r; sint16  g; sint16  b; } rgb16;
115typedef struct { sint32  r; sint32  g; sint32  b; } rgb32;
116typedef struct { float32 r; float32 g; float32 b; } rgbf32;
117
118typedef struct { uint8   b; uint8   g; uint8   r; } bgr8;
119typedef struct { sint16  b; sint16  g; sint16  r; } bgr16;
120typedef struct { sint32  b; sint32  g; sint32  r; } bgr32;
121typedef struct { float32 b; float32 g; float32 r; } bgrf32;
122
123typedef struct { uint8   r; uint8   g; uint8   b; uint8   x; } rgbx8;
124typedef struct { int16   r; int16   g; int16   b; int16   x; } rgbx16;
125typedef struct { int32   r; int32   g; int32   b; int32   x; } rgbx32;
126typedef struct { float32 r; float32 g; float32 b; float32 x; } rgbxf32;
127
128typedef struct { uint8   x; uint8   b; uint8   g; uint8   r; } bgrx8;
129typedef struct { int16   x; int16   b; int16   g; int16   r; } bgrx16;
130typedef struct { int32   x; int32   b; int32   g; int32   r; } bgrx32;
131typedef struct { float32 x; float32 b; float32 g; float32 r; } bgrxf32;
132
133/* ---------------- */
134/* --- bitfield --- */
135/* ---------------- */
136typedef struct {
137    unsigned int b0  : 1;
138    unsigned int b1  : 1;
139    unsigned int b2  : 1;
140    unsigned int b3  : 1;
141    unsigned int b4  : 1;
142    unsigned int b5  : 1;
143    unsigned int b6  : 1;
144    unsigned int b7  : 1;
145    unsigned int b8  : 1;
146    unsigned int b9  : 1;
147    unsigned int b10 : 1;
148    unsigned int b11 : 1;
149    unsigned int b12 : 1;
150    unsigned int b13 : 1;
151    unsigned int b14 : 1;
152    unsigned int b15 : 1;
153    unsigned int b16 : 1;
154    unsigned int b17 : 1;
155    unsigned int b18 : 1;
156    unsigned int b19 : 1;
157    unsigned int b20 : 1;
158    unsigned int b21 : 1;
159    unsigned int b22 : 1;
160    unsigned int b23 : 1;
161    unsigned int b24 : 1;
162    unsigned int b25 : 1;
163    unsigned int b26 : 1;
164    unsigned int b27 : 1;
165    unsigned int b28 : 1;
166    unsigned int b29 : 1;
167    unsigned int b30 : 1;
168    unsigned int b31 : 1;
169} bitfield32;
170
171typedef struct {
172    unsigned int b0  : 1;
173    unsigned int b1  : 1;
174    unsigned int b2  : 1;
175    unsigned int b3  : 1;
176    unsigned int b4  : 1;
177    unsigned int b5  : 1;
178    unsigned int b6  : 1;
179    unsigned int b7  : 1;
180    unsigned int b8  : 1;
181    unsigned int b9  : 1;
182    unsigned int b10 : 1;
183    unsigned int b11 : 1;
184    unsigned int b12 : 1;
185    unsigned int b13 : 1;
186    unsigned int b14 : 1;
187    unsigned int b15 : 1;
188} bitfield16;
189
190typedef struct {
191    unsigned int b0  : 1;
192    unsigned int b1  : 1;
193    unsigned int b2  : 1;
194    unsigned int b3  : 1;
195    unsigned int b4  : 1;
196    unsigned int b5  : 1;
197    unsigned int b6  : 1;
198    unsigned int b7  : 1;
199} bitfield8;
200
201#ifdef __cplusplus
202}
203#endif
204
205#endif // _NR_TYPE_H_
Note: See TracBrowser for help on using the repository browser.