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 FG_STATIC_ static
27 #else
28  #define FGAPI __attribute__((visibility("default")))
29  #include <stdbool.h>
30  #define FG_STATIC_
31 #endif
32 
33 #include <fg/version.h>
34 #ifndef FG_API_VERSION
35 #define FG_API_VERSION FG_API_VERSION_CURRENT
36 #endif
37 
38 #include <cstdlib>
39 
40 typedef void* fg_window;
41 typedef void* fg_font;
42 typedef void* fg_chart;
43 typedef void* fg_image;
44 typedef void* fg_histogram;
45 typedef void* fg_plot;
46 typedef void* fg_surface;
47 typedef void* fg_vector_field;
48 
49 typedef enum {
51  /*
52  * Arguement related error codes that are
53  * generated when invalid arguments are
54  * provided to any function. All these
55  * codes match the following pattern
56  * '1***'
57  * */
58  FG_ERR_SIZE = 1001,
61  /*
62  * OpenGL related error codes
63  * match the following pattern
64  * '2***'
65  * */
66  FG_ERR_GL_ERROR = 2001,
67  /*
68  * FreeType related error codes
69  * match the following pattern
70  * '3***'
71  * */
73  /*
74  * File IO related error codes
75  * match the following pattern
76  * '4***'
77  * */
79  /*
80  * Unsupported configurations
81  * and other similar error codes
82  * match the following pattern
83  * '5***'
84  * */
87  /*
88  * Font config related error codes
89  * '6**'
90  * */
92  /*
93  * FreeImage errors
94  */
98  /*
99  * other error codes
100  * match the following pattern
101  * '9**'
102  * */
104  FG_ERR_RUNTIME = 9002,
106 } fg_err;
107 
108 typedef enum {
109  FG_GRAYSCALE = 100,
110  FG_RG = 200,
111  FG_RGB = 300,
112  FG_BGR = 301,
113  FG_RGBA = 400,
114  FG_BGRA = 401
116 
117 typedef enum {
120 } fg_chart_type;
121 
127 typedef enum {
135 } fg_color_map;
136 
137 typedef enum {
138  FG_RED = 0xFF0000FF,
139  FG_GREEN = 0x00FF00FF,
140  FG_BLUE = 0x0000FFFF,
141  FG_YELLOW = 0xFFFF00FF,
142  FG_CYAN = 0x00FFFFFF,
143  FG_MAGENTA = 0xFF00FFFF,
144  FG_WHITE = 0xFFFFFFFF,
145  FG_BLACK = 0x000000FF
146 } fg_color;
147 
148 typedef enum {
149  FG_INT8 = 0,
150  FG_UINT8 = 1,
151  FG_INT32 = 2,
152  FG_UINT32 = 3,
154  FG_INT16 = 5,
156 } fg_dtype;
157 
158 typedef enum {
162 } fg_plot_type;
163 
164 typedef enum {
174 
175 
176 #ifdef __cplusplus
177 namespace forge
178 {
179  typedef fg_err ErrorCode;
183  typedef fg_color Color;
186 
187  typedef enum {
195  } dtype;
196 }
197 #endif
Point marker.
Definition: defines.h:166
Definition: defines.h:138
File IO errors.
Definition: defines.h:78
fg_chart_type ChartType
Definition: defines.h:181
Mood color map.
Definition: defines.h:132
Definition: defines.h:192
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:113
Two dimensional charts.
Definition: defines.h:118
freeimage memory allocation failed
Definition: defines.h:96
void * fg_chart
Definition: defines.h:42
Definition: defines.h:142
Blue color map.
Definition: defines.h:134
fg_marker_type
Definition: defines.h:164
No marker.
Definition: defines.h:165
Definition: chart.h:214
Definition: defines.h:140
fg_color
Definition: defines.h:137
Freetype library error.
Definition: defines.h:72
fg_color_map ColorMap
Definition: defines.h:182
fg_marker_type MarkerType
Definition: defines.h:185
Three(Red, Green & Blue) channels.
Definition: defines.h:112
Fuction returned successfully.
Definition: defines.h:50
Float (32-bits)
Definition: defines.h:153
Single channel.
Definition: defines.h:109
Definition: defines.h:141
Signed byte (8-bits)
Definition: defines.h:149
Plus symbol marker.
Definition: defines.h:171
fg_plot_type PlotType
Definition: defines.h:184
Definition: defines.h:139
Unsigned integer (16-bits)
Definition: defines.h:155
Signed integer (16-bits)
Definition: defines.h:154
fg_plot_type
Definition: defines.h:158
Three(Red, Green & Blue) channels.
Definition: defines.h:111
Feature not supported.
Definition: defines.h:85
dtype
Definition: defines.h:187
fg_channel_format
Definition: defines.h:108
fg_color_map
Color maps.
Definition: defines.h:127
Signed integer (32-bits)
Definition: defines.h:151
fg_chart_type
Definition: defines.h:117
Three(Red, Green & Blue) channels.
Definition: defines.h:110
Scatter plot.
Definition: defines.h:160
void * fg_vector_field
Definition: defines.h:47
fg_color Color
Definition: defines.h:183
Heat color map.
Definition: defines.h:133
Square marker.
Definition: defines.h:168
Unknown format, not supported by freeimage.
Definition: defines.h:95
Unsigned integer (32-bits)
Definition: defines.h:152
void * fg_surface
Definition: defines.h:46
freeimage file save failed
Definition: defines.h:97
Library configuration mismatch.
Definition: defines.h:86
Definition: defines.h:191
Triangle marker.
Definition: defines.h:169
Spectrum color.
Definition: defines.h:129
Fontconfig related error.
Definition: defines.h:91
Unkown error.
Definition: defines.h:105
Invalid argument.
Definition: defines.h:60
Four(Red, Green, Blue & Alpha) channels.
Definition: defines.h:114
Circle marker.
Definition: defines.h:167
Definition: defines.h:190
Definition: defines.h:194
Red color map.
Definition: defines.h:131
void * fg_plot
Definition: defines.h:45
Star symbol marker.
Definition: defines.h:172
Definition: defines.h:189
Three dimensional charts.
Definition: defines.h:119
Default [0-255] grayscale colormap.
Definition: defines.h:128
fg_channel_format ChannelFormat
Definition: defines.h:180
void * fg_image
Definition: defines.h:43
fg_err
Definition: defines.h:49
Definition: defines.h:143
Surface plot.
Definition: defines.h:161
Definition: defines.h:193
fg_err ErrorCode
Definition: defines.h:179
Unsigned byte (8-bits)
Definition: defines.h:150
Pure Colors.
Definition: defines.h:130
void * fg_font
Definition: defines.h:41
OpenGL error.
Definition: defines.h:66
Internal error.
Definition: defines.h:103
Definition: defines.h:145
Definition: defines.h:188
void * fg_histogram
Definition: defines.h:44
void * fg_window
Definition: defines.h:40
Line plot.
Definition: defines.h:159
Runtime error.
Definition: defines.h:104
Definition: defines.h:144
Cross-hair marker.
Definition: defines.h:170
fg_dtype
Definition: defines.h:148
Invalid size argument.
Definition: defines.h:58
Invalid type argument.
Definition: defines.h:59