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 <fg/version.h>
39 #ifndef FG_API_VERSION
40 #define FG_API_VERSION FG_API_VERSION_CURRENT
41 #endif
42
43 #include <GL/glew.h>
44
48 FGAPI GLEWContext* glewGetContext();
49
50 namespace fg
51 {
52
53 enum ErrorCode {
54 FG_SUCCESS = 0,
55 /*
56 * Arguement related error codes that are
57 * generated when invalid arguments are
58 * provided to any function. All these
59 * codes match the following pattern
60 * '1***'
61 * */
62 FG_ERR_SIZE = 1001,
63 FG_ERR_INVALID_TYPE = 1002,
64 FG_ERR_INVALID_ARG = 1003,
65 /*
66 * OpenGL related error codes
67 * match the following pattern
68 * '2***'
69 * */
70 FG_ERR_GL_ERROR = 2001,
71 /*
72 * FreeType related error codes
73 * match the following pattern
74 * '3***'
75 * */
76 FG_ERR_FREETYPE_ERROR = 3001,
77 /*
78 * File IO related error codes
79 * match the following pattern
80 * '4***'
81 * */
82 FG_ERR_FILE_NOT_FOUND = 4001,
83 /*
84 * Unsupported configurations
85 * and other similar error codes
86 * match the following pattern
87 * '5***'
88 * */
89 FG_ERR_NOT_SUPPORTED = 5001,
90 FG_ERR_NOT_CONFIGURED = 5002,
91 /*
92 * other error codes
93 * match the following pattern
94 * '9**'
95 * */
96 FG_ERR_INTERNAL = 9001,
97 FG_ERR_RUNTIME = 9002,
98 FG_ERR_UNKNOWN = 9003
99 };
100
101 enum ChannelFormat {
102 FG_GRAYSCALE = 100,
103 FG_RG = 200,
104 FG_RGB = 300,
105 FG_BGR = 301,
106 FG_RGBA = 400,
107 FG_BGRA = 401
108 };
109
115 enum ColorMap {
116 FG_DEFAULT_MAP = 0,
117 FG_SPECTRUM_MAP = 1,
118 FG_COLORS_MAP = 2,
119 FG_RED_MAP = 3,
120 FG_MOOD_MAP = 4,
121 FG_HEAT_MAP = 5,
122 FG_BLUE_MAP = 6
123 };
124
125 enum Color {
126 FG_RED = 0xFF0000FF,
127 FG_GREEN = 0x00FF00FF,
128 FG_BLUE = 0x0000FFFF,
129 FG_YELLOW = 0xFFFF00FF,
130 FG_CYAN = 0x00FFFFFF,
131 FG_MAGENTA = 0xFF00FFFF,
132 FG_WHITE = 0xFFFFFFFF,
133 FG_BLACK = 0x000000FF
134 };
135
136 enum dtype {
137 s8 = 0,
138 u8 = 1,
139 s32 = 2,
140 u32 = 3,
141 f32 = 4,
142 s16 = 5,
143 u16 = 6
144 };
145
146 enum PlotType {
147 FG_LINE = 0,
148 FG_SCATTER = 1,
149 FG_SURFACE = 2
150 };
151
152 enum MarkerType {
153 FG_NONE = 0,
154 FG_POINT = 1,
155 FG_CIRCLE = 2,
156 FG_SQUARE = 3,
157 FG_TRIANGLE = 4,
158 FG_CROSS = 5,
159 FG_PLUS = 6,
160 FG_STAR = 7
161 };
162
163 }
fg::FG_LINE
Definition: defines.h:147
fg::FG_SURFACE
Definition: defines.h:149
fg::FG_HEAT_MAP
Heat color map.
Definition: defines.h:121
fg::FG_TRIANGLE
Definition: defines.h:157
fg::FG_GRAYSCALE
Single channel.
Definition: defines.h:102
fg::FG_SUCCESS
Fuction returned successfully.
Definition: defines.h:54
fg::FG_YELLOW
Definition: defines.h:129
fg::FG_ERR_INTERNAL
Internal error.
Definition: defines.h:96
fg::ChannelFormat
ChannelFormat
Definition: defines.h:101
fg
Definition: CPUCopy.hpp:13
fg::ColorMap
ColorMap
Color maps.
Definition: defines.h:115
fg::FG_ERR_GL_ERROR
OpenGL error.
Definition: defines.h:70
fg::FG_MAGENTA
Definition: defines.h:131
fg::FG_ERR_RUNTIME
Runtime error.
Definition: defines.h:97
fg::s16
Signed integer (16-bits)
Definition: defines.h:142
fg::FG_BLACK
Definition: defines.h:133
fg::FG_ERR_NOT_SUPPORTED
Feature not supported.
Definition: defines.h:89
fg::FG_ERR_FILE_NOT_FOUND
File IO errors.
Definition: defines.h:82
fg::FG_RED
Definition: defines.h:126
fg::FG_MOOD_MAP
Mood color map.
Definition: defines.h:120
fg::FG_ERR_INVALID_ARG
Invalid argument.
Definition: defines.h:64
fg::FG_RGB
Three(Red, Green & Blue) channels.
Definition: defines.h:104
fg::FG_ERR_FREETYPE_ERROR
Freetype library error.
Definition: defines.h:76
fg::FG_CYAN
Definition: defines.h:130
fg::s8
Signed byte (8-bits)
Definition: defines.h:137
fg::FG_ERR_UNKNOWN
Unkown error.
Definition: defines.h:98
fg::FG_BLUE_MAP
Blue color map.
Definition: defines.h:122
fg::u32
Unsigned integer (32-bits)
Definition: defines.h:140
fg::FG_ERR_NOT_CONFIGURED
Library configuration mismatch.
Definition: defines.h:90
FGAPI
#define FGAPI
Definition: defines.h:32
fg::FG_CROSS
Definition: defines.h:158
fg::dtype
dtype
Definition: defines.h:136
fg::FG_DEFAULT_MAP
Default [0-255] grayscale colormap.
Definition: defines.h:116
fg::FG_RGBA
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:106
fg::PlotType
PlotType
Definition: defines.h:146
fg::MarkerType
MarkerType
Definition: defines.h:152
fg::FG_CIRCLE
Definition: defines.h:155
fg::u16
Unsigned integer (16-bits)
Definition: defines.h:143
fg::FG_SPECTRUM_MAP
Spectrum color.
Definition: defines.h:117
fg::FG_POINT
Definition: defines.h:154
fg::f32
Float (32-bits)
Definition: defines.h:141
fg::u8
Unsigned byte (8-bits)
Definition: defines.h:138
fg::FG_SQUARE
Definition: defines.h:156
fg::FG_SCATTER
Definition: defines.h:148
fg::FG_BGR
Three(Red, Green & Blue) channels.
Definition: defines.h:105
fg::FG_NONE
Definition: defines.h:153
fg::FG_PLUS
Definition: defines.h:159
fg::FG_STAR
Definition: defines.h:160
fg::FG_RED_MAP
Red color map.
Definition: defines.h:119
fg::ErrorCode
ErrorCode
Definition: defines.h:53
glewGetContext
GLEWContext * glewGetContext()
Requirment by GLEWmx.
fg::FG_BGRA
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:107
fg::FG_RG
Three(Red, Green & Blue) channels.
Definition: defines.h:103
fg::s32
Signed integer (32-bits)
Definition: defines.h:139
fg::FG_WHITE
Definition: defines.h:132
fg::FG_BLUE
Definition: defines.h:128
fg::Color
Color
Definition: defines.h:125
version.h
fg::FG_ERR_INVALID_TYPE
Invalid type argument.
Definition: defines.h:63
fg::FG_COLORS_MAP
Pure Colors.
Definition: defines.h:118
fg::FG_ERR_SIZE
Invalid size argument.
Definition: defines.h:62
fg::FG_GREEN
Definition: defines.h:127