Forge
defines.h
Go to the documentation of this file.
1 /*******************************************************
2  * Copyright (c) 2015-2019, ArrayFire
3  * All rights reserved.
4  *
5  * This file is distributed under 3-clause BSD license.
6  * The complete license agreement can be obtained at:
7  * http://arrayfire.com/licenses/BSD-3-Clause
8  ********************************************************/
9 
10 #pragma once
11 
12 #ifdef OS_WIN
13  // http://msdn.microsoft.com/en-us/library/b0084kay(v=VS.80).aspx
14  // http://msdn.microsoft.com/en-us/library/3y1sfaz2%28v=VS.80%29.aspx
15  #ifdef FGDLL // libfg
16  #define FGAPI __declspec(dllexport)
17  #else
18  #define FGAPI __declspec(dllimport)
19  #endif
20 
21  #ifndef __cplusplus
22  #define false 0
23  #define true 1
24  #endif
25 
26  #define __PRETTY_FUNCTION__ __FUNCSIG__
27  #if _MSC_VER < 1900
28  #define snprintf sprintf_s
29  #endif
30  #define FG_STATIC_ static
31 #else
32  #define FGAPI __attribute__((visibility("default")))
33  #include <stdbool.h>
34  #define __PRETTY_FUNCTION__ __func__
35  #define FG_STATIC_
36 #endif
37 
38 #include <GL/glew.h>
39 
43 FGAPI GLEWContext* glewGetContext();
44 
45 namespace fg
46 {
47 
48 enum ErrorCode {
49  FG_SUCCESS = 0,
50  /*
51  * Arguement related error codes that are
52  * generated when invalid arguments are
53  * provided to any function. All these
54  * codes match the following pattern
55  * '1***'
56  * */
57  FG_ERR_SIZE = 1001,
60  /*
61  * OpenGL related error codes
62  * match the following pattern
63  * '2***'
64  * */
65  FG_ERR_GL_ERROR = 2001,
66  /*
67  * FreeType related error codes
68  * match the following pattern
69  * '3***'
70  * */
72  /*
73  * File IO related error codes
74  * match the following pattern
75  * '4***'
76  * */
78  /*
79  * Unsupported configurations
80  * and other similar error codes
81  * match the following pattern
82  * '5***'
83  * */
86  /*
87  * other error codes
88  * match the following pattern
89  * '9**'
90  * */
91  FG_ERR_INTERNAL = 9001,
92  FG_ERR_RUNTIME = 9002,
94 };
95 
97  FG_GRAYSCALE = 100,
98  FG_RG = 200,
99  FG_RGB = 300,
100  FG_BGR = 301,
101  FG_RGBA = 400,
102  FG_BGRA = 401
103 };
104 
110 enum ColorMap {
118 };
119 
120 enum Color {
121  FG_RED = 0xFF0000FF,
122  FG_GREEN = 0x00FF00FF,
123  FG_BLUE = 0x0000FFFF,
124  FG_YELLOW = 0xFFFF00FF,
125  FG_CYAN = 0x00FFFFFF,
126  FG_MAGENTA = 0xFF00FFFF,
127  FG_WHITE = 0xFFFFFFFF,
128  FG_BLACK = 0x000000FF
129 };
130 
131 enum dtype {
132  s8 = 0,
133  u8 = 1,
134  s32 = 2,
135  u32 = 3,
136  f32 = 4,
137  s16 = 5,
138  u16 = 6
139 };
140 
141 enum PlotType {
142  FG_LINE = 0,
145 };
146 
148  FG_NONE = 0,
149  FG_POINT = 1,
153  FG_CROSS = 5,
154  FG_PLUS = 6,
156 };
157 
158 
159 }
Definition: defines.h:142
Definition: defines.h:144
Heat color map.
Definition: defines.h:116
Definition: defines.h:152
Single channel.
Definition: defines.h:97
Fuction returned successfully.
Definition: defines.h:49
Definition: defines.h:124
Internal error.
Definition: defines.h:91
ChannelFormat
Definition: defines.h:96
Definition: CPUCopy.hpp:13
ColorMap
Color maps.
Definition: defines.h:110
OpenGL error.
Definition: defines.h:65
Definition: defines.h:126
Runtime error.
Definition: defines.h:92
Signed integer (16-bits)
Definition: defines.h:137
Definition: defines.h:128
Feature not supported.
Definition: defines.h:84
File IO errors.
Definition: defines.h:77
Definition: defines.h:121
Mood color map.
Definition: defines.h:115
Invalid argument.
Definition: defines.h:59
Three(Red, Green & Blue) channels.
Definition: defines.h:99
Freetype library error.
Definition: defines.h:71
Definition: defines.h:125
Signed byte (8-bits)
Definition: defines.h:132
Unkown error.
Definition: defines.h:93
Blue color map.
Definition: defines.h:117
Unsigned integer (32-bits)
Definition: defines.h:135
Library configuration mismatch.
Definition: defines.h:85
#define FGAPI
Definition: defines.h:32
Definition: defines.h:153
dtype
Definition: defines.h:131
Default [0-255] grayscale colormap.
Definition: defines.h:111
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:101
PlotType
Definition: defines.h:141
MarkerType
Definition: defines.h:147
Definition: defines.h:150
Unsigned integer (16-bits)
Definition: defines.h:138
Spectrum color.
Definition: defines.h:112
Definition: defines.h:149
Float (32-bits)
Definition: defines.h:136
Unsigned byte (8-bits)
Definition: defines.h:133
Definition: defines.h:151
Definition: defines.h:143
Three(Red, Green & Blue) channels.
Definition: defines.h:100
Definition: defines.h:148
Definition: defines.h:154
Definition: defines.h:155
Red color map.
Definition: defines.h:114
ErrorCode
Definition: defines.h:48
GLEWContext * glewGetContext()
Requirment by GLEWmx.
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:102
Three(Red, Green & Blue) channels.
Definition: defines.h:98
Signed integer (32-bits)
Definition: defines.h:134
Definition: defines.h:127
Definition: defines.h:123
Color
Definition: defines.h:120
Invalid type argument.
Definition: defines.h:58
Pure Colors.
Definition: defines.h:113
Invalid size argument.
Definition: defines.h:57
Definition: defines.h:122