Forge: defines.h Source File

Forge

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

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,
58 FG_ERR_INVALID_TYPE = 1002,
59 FG_ERR_INVALID_ARG = 1003,
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 * */
71 FG_ERR_FREETYPE_ERROR = 3001,
72 /*
73 * File IO related error codes
74 * match the following pattern
75 * '4***'
76 * */
77 FG_ERR_FILE_NOT_FOUND = 4001,
78 /*
79 * Unsupported configurations
80 * and other similar error codes
81 * match the following pattern
82 * '5***'
83 * */
84 FG_ERR_NOT_SUPPORTED = 5001,
85 FG_ERR_NOT_CONFIGURED = 5002,
86 /*
87 * other error codes
88 * match the following pattern
89 * '9**'
90 * */
91 FG_ERR_INTERNAL = 9001,
92 FG_ERR_RUNTIME = 9002,
93 FG_ERR_UNKNOWN = 9003
94 };
95
96 enum ChannelFormat {
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 {
111 FG_DEFAULT_MAP = 0,
112 FG_SPECTRUM_MAP = 1,
113 FG_COLORS_MAP = 2,
114 FG_RED_MAP = 3,
115 FG_MOOD_MAP = 4,
116 FG_HEAT_MAP = 5,
117 FG_BLUE_MAP = 6
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,
143 FG_SCATTER = 1,
144 FG_SURFACE = 2
145 };
146
147 enum MarkerType {
148 FG_NONE = 0,
149 FG_POINT = 1,
150 FG_CIRCLE = 2,
151 FG_SQUARE = 3,
152 FG_TRIANGLE = 4,
153 FG_CROSS = 5,
154 FG_PLUS = 6,
155 FG_STAR = 7
156 };
157
158
159 }
fg::FG_LINE
Definition: defines.h:142
fg::FG_SURFACE
Definition: defines.h:144
fg::FG_HEAT_MAP
Heat color map.
Definition: defines.h:116
fg::FG_TRIANGLE
Definition: defines.h:152
fg::FG_GRAYSCALE
Single channel.
Definition: defines.h:97
fg::FG_SUCCESS
Fuction returned successfully.
Definition: defines.h:49
fg::FG_YELLOW
Definition: defines.h:124
fg::FG_ERR_INTERNAL
Internal error.
Definition: defines.h:91
fg::ChannelFormat
ChannelFormat
Definition: defines.h:96
fg
Definition: CPUCopy.hpp:13
fg::ColorMap
ColorMap
Color maps.
Definition: defines.h:110
fg::FG_ERR_GL_ERROR
OpenGL error.
Definition: defines.h:65
fg::FG_MAGENTA
Definition: defines.h:126
fg::FG_ERR_RUNTIME
Runtime error.
Definition: defines.h:92
fg::s16
Signed integer (16-bits)
Definition: defines.h:137
fg::FG_BLACK
Definition: defines.h:128
fg::FG_ERR_NOT_SUPPORTED
Feature not supported.
Definition: defines.h:84
fg::FG_ERR_FILE_NOT_FOUND
File IO errors.
Definition: defines.h:77
fg::FG_RED
Definition: defines.h:121
fg::FG_MOOD_MAP
Mood color map.
Definition: defines.h:115
fg::FG_ERR_INVALID_ARG
Invalid argument.
Definition: defines.h:59
fg::FG_RGB
Three(Red, Green & Blue) channels.
Definition: defines.h:99
fg::FG_ERR_FREETYPE_ERROR
Freetype library error.
Definition: defines.h:71
fg::FG_CYAN
Definition: defines.h:125
fg::s8
Signed byte (8-bits)
Definition: defines.h:132
fg::FG_ERR_UNKNOWN
Unkown error.
Definition: defines.h:93
fg::FG_BLUE_MAP
Blue color map.
Definition: defines.h:117
fg::u32
Unsigned integer (32-bits)
Definition: defines.h:135
fg::FG_ERR_NOT_CONFIGURED
Library configuration mismatch.
Definition: defines.h:85
FGAPI
#define FGAPI
Definition: defines.h:32
fg::FG_CROSS
Definition: defines.h:153
fg::dtype
dtype
Definition: defines.h:131
fg::FG_DEFAULT_MAP
Default [0-255] grayscale colormap.
Definition: defines.h:111
fg::FG_RGBA
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:101
fg::PlotType
PlotType
Definition: defines.h:141
fg::MarkerType
MarkerType
Definition: defines.h:147
fg::FG_CIRCLE
Definition: defines.h:150
fg::u16
Unsigned integer (16-bits)
Definition: defines.h:138
fg::FG_SPECTRUM_MAP
Spectrum color.
Definition: defines.h:112
fg::FG_POINT
Definition: defines.h:149
fg::f32
Float (32-bits)
Definition: defines.h:136
fg::u8
Unsigned byte (8-bits)
Definition: defines.h:133
fg::FG_SQUARE
Definition: defines.h:151
fg::FG_SCATTER
Definition: defines.h:143
fg::FG_BGR
Three(Red, Green & Blue) channels.
Definition: defines.h:100
fg::FG_NONE
Definition: defines.h:148
fg::FG_PLUS
Definition: defines.h:154
fg::FG_STAR
Definition: defines.h:155
fg::FG_RED_MAP
Red color map.
Definition: defines.h:114
fg::ErrorCode
ErrorCode
Definition: defines.h:48
glewGetContext
GLEWContext * glewGetContext()
Requirment by GLEWmx.
fg::FG_BGRA
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:102
fg::FG_RG
Three(Red, Green & Blue) channels.
Definition: defines.h:98
fg::s32
Signed integer (32-bits)
Definition: defines.h:134
fg::FG_WHITE
Definition: defines.h:127
fg::FG_BLUE
Definition: defines.h:123
fg::Color
Color
Definition: defines.h:120
fg::FG_ERR_INVALID_TYPE
Invalid type argument.
Definition: defines.h:58
fg::FG_COLORS_MAP
Pure Colors.
Definition: defines.h:113
fg::FG_ERR_SIZE
Invalid size argument.
Definition: defines.h:57
fg::FG_GREEN
Definition: defines.h:122