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 <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,
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  * */
77  /*
78  * File IO related error codes
79  * match the following pattern
80  * '4***'
81  * */
83  /*
84  * Unsupported configurations
85  * and other similar error codes
86  * match the following pattern
87  * '5***'
88  * */
91  /*
92  * other error codes
93  * match the following pattern
94  * '9**'
95  * */
96  FG_ERR_INTERNAL = 9001,
97  FG_ERR_RUNTIME = 9002,
99 };
100 
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 {
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,
150 };
151 
153  FG_NONE = 0,
154  FG_POINT = 1,
158  FG_CROSS = 5,
159  FG_PLUS = 6,
161 };
162 
163 }
Definition: defines.h:147
Definition: defines.h:149
Heat color map.
Definition: defines.h:121
Definition: defines.h:157
Single channel.
Definition: defines.h:102
Fuction returned successfully.
Definition: defines.h:54
Definition: defines.h:129
Internal error.
Definition: defines.h:96
ChannelFormat
Definition: defines.h:101
Definition: CPUCopy.hpp:13
ColorMap
Color maps.
Definition: defines.h:115
OpenGL error.
Definition: defines.h:70
Definition: defines.h:131
Runtime error.
Definition: defines.h:97
Signed integer (16-bits)
Definition: defines.h:142
Definition: defines.h:133
Feature not supported.
Definition: defines.h:89
File IO errors.
Definition: defines.h:82
Definition: defines.h:126
Mood color map.
Definition: defines.h:120
Invalid argument.
Definition: defines.h:64
Three(Red, Green & Blue) channels.
Definition: defines.h:104
Freetype library error.
Definition: defines.h:76
Definition: defines.h:130
Signed byte (8-bits)
Definition: defines.h:137
Unkown error.
Definition: defines.h:98
Blue color map.
Definition: defines.h:122
Unsigned integer (32-bits)
Definition: defines.h:140
Library configuration mismatch.
Definition: defines.h:90
#define FGAPI
Definition: defines.h:32
Definition: defines.h:158
dtype
Definition: defines.h:136
Default [0-255] grayscale colormap.
Definition: defines.h:116
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:106
PlotType
Definition: defines.h:146
MarkerType
Definition: defines.h:152
Definition: defines.h:155
Unsigned integer (16-bits)
Definition: defines.h:143
Spectrum color.
Definition: defines.h:117
Definition: defines.h:154
Float (32-bits)
Definition: defines.h:141
Unsigned byte (8-bits)
Definition: defines.h:138
Definition: defines.h:156
Definition: defines.h:148
Three(Red, Green & Blue) channels.
Definition: defines.h:105
Definition: defines.h:153
Definition: defines.h:159
Definition: defines.h:160
Red color map.
Definition: defines.h:119
ErrorCode
Definition: defines.h:53
GLEWContext * glewGetContext()
Requirment by GLEWmx.
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:107
Three(Red, Green & Blue) channels.
Definition: defines.h:103
Signed integer (32-bits)
Definition: defines.h:139
Definition: defines.h:132
Definition: defines.h:128
Color
Definition: defines.h:125
Invalid type argument.
Definition: defines.h:63
Pure Colors.
Definition: defines.h:118
Invalid size argument.
Definition: defines.h:62
Definition: defines.h:127