defines.h
Go to the documentation of this file.
/*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
#ifdef OS_WIN
// http://msdn.microsoft.com/en-us/library/b0084kay(v=VS.80).aspx
// http://msdn.microsoft.com/en-us/library/3y1sfaz2%28v=VS.80%29.aspx
#ifdef FGDLL // libfg
#define FGAPI __declspec(dllexport)
#else
#define FGAPI __declspec(dllimport)
#endif
#ifndef __cplusplus
#define false 0
#define true 1
#endif
#define FG_STATIC_ static
#else
#define FGAPI __attribute__((visibility("default")))
#include <stdbool.h>
#define FG_STATIC_
#endif
#include <fg/version.h>
#ifndef FG_API_VERSION
#define FG_API_VERSION FG_API_VERSION_CURRENT
#endif
#include <cstdlib>
typedef void* fg_window;
typedef void* fg_font;
typedef void* fg_chart;
typedef void* fg_image;
typedef void* fg_histogram;
typedef void* fg_plot;
typedef void* fg_surface;
typedef void* fg_vector_field;
typedef enum {
FG_ERR_NONE = 0,
/*
* Arguement related error codes that are
* generated when invalid arguments are
* provided to any function. All these
* codes match the following pattern
* '1***'
* */
FG_ERR_SIZE = 1001,
FG_ERR_INVALID_TYPE = 1002,
FG_ERR_INVALID_ARG = 1003,
/*
* OpenGL related error codes
* match the following pattern
* '2***'
* */
FG_ERR_GL_ERROR = 2001,
/*
* FreeType related error codes
* match the following pattern
* '3***'
* */
FG_ERR_FREETYPE_ERROR = 3001,
/*
* File IO related error codes
* match the following pattern
* '4***'
* */
FG_ERR_FILE_NOT_FOUND = 4001,
/*
* Unsupported configurations
* and other similar error codes
* match the following pattern
* '5***'
* */
FG_ERR_NOT_SUPPORTED = 5001,
FG_ERR_NOT_CONFIGURED = 5002,
/*
* Font config related error codes
* '6**'
* */
FG_ERR_FONTCONFIG_ERROR = 6001,
/*
* FreeImage errors
*/
FG_ERR_FREEIMAGE_UNKNOWN_FORMAT = 7001,
FG_ERR_FREEIMAGE_BAD_ALLOC = 7002,
FG_ERR_FREEIMAGE_SAVE_FAILED = 7003,
/*
* other error codes
* match the following pattern
* '9**'
* */
FG_ERR_INTERNAL = 9001,
FG_ERR_RUNTIME = 9002,
FG_ERR_UNKNOWN = 9003
} fg_err;
typedef enum {
FG_GRAYSCALE = 100,
FG_RG = 200,
FG_RGB = 300,
FG_BGR = 301,
FG_RGBA = 400,
FG_BGRA = 401
} fg_channel_format;
typedef enum {
FG_CHART_2D = 2,
FG_CHART_3D = 3
} fg_chart_type;
typedef enum {
FG_COLOR_MAP_DEFAULT = 0,
FG_COLOR_MAP_SPECTRUM = 1,
FG_COLOR_MAP_RAINBOW = 2,
FG_COLOR_MAP_RED = 3,
FG_COLOR_MAP_MOOD = 4,
FG_COLOR_MAP_HEAT = 5,
FG_COLOR_MAP_BLUE = 6,
FG_COLOR_MAP_INFERNO = 7,
FG_COLOR_MAP_MAGMA = 8,
FG_COLOR_MAP_PLASMA = 9,
FG_COLOR_MAP_VIRIDIS = 10,
} fg_color_map;
typedef enum {
FG_RED = 0xFF0000FF,
FG_GREEN = 0x00FF00FF,
FG_BLUE = 0x0000FFFF,
FG_YELLOW = 0xFFFF00FF,
FG_CYAN = 0x00FFFFFF,
FG_MAGENTA = 0xFF00FFFF,
FG_WHITE = 0xFFFFFFFF,
FG_BLACK = 0x000000FF
} fg_color;
typedef enum {
FG_INT8 = 0,
FG_UINT8 = 1,
FG_INT32 = 2,
FG_UINT32 = 3,
FG_FLOAT32 = 4,
FG_INT16 = 5,
FG_UINT16 = 6
} fg_dtype;
typedef enum {
FG_PLOT_LINE = 0,
FG_PLOT_SCATTER = 1,
FG_PLOT_SURFACE = 2
} fg_plot_type;
typedef enum {
FG_MARKER_NONE = 0,
FG_MARKER_POINT = 1,
FG_MARKER_CIRCLE = 2,
FG_MARKER_SQUARE = 3,
FG_MARKER_TRIANGLE = 4,
FG_MARKER_CROSS = 5,
FG_MARKER_PLUS = 6,
FG_MARKER_STAR = 7
} fg_marker_type;
#ifdef __cplusplus
namespace forge
{
typedef fg_err ErrorCode;
typedef fg_channel_format ChannelFormat;
typedef fg_chart_type ChartType;
typedef fg_color_map ColorMap;
typedef fg_color Color;
typedef fg_plot_type PlotType;
typedef fg_marker_type MarkerType;
typedef enum {
s8 = FG_INT8,
u8 = FG_UINT8,
s32 = FG_INT32,
u32 = FG_UINT32,
f32 = FG_FLOAT32,
s16 = FG_INT16,
u16 = FG_UINT16,
} dtype;
}
#endif
fg_chart
void * fg_chart
Definition defines.h:42
fg_channel_format
fg_channel_format
Definition defines.h:108
FG_RG
@ FG_RG
Three(Red, Green & Blue) channels.
Definition defines.h:110
FG_RGBA
@ FG_RGBA
Four(Red, Green, Blue & Alpha) channels.
Definition defines.h:113
FG_BGRA
@ FG_BGRA
Four(Red, Green, Blue & Alpha) channels.
Definition defines.h:114
FG_BGR
@ FG_BGR
Three(Red, Green & Blue) channels.
Definition defines.h:112
FG_GRAYSCALE
@ FG_GRAYSCALE
Single channel.
Definition defines.h:109
FG_RGB
@ FG_RGB
Three(Red, Green & Blue) channels.
Definition defines.h:111
fg_plot_type
fg_plot_type
Definition defines.h:160
FG_PLOT_SCATTER
@ FG_PLOT_SCATTER
Scatter plot.
Definition defines.h:162
FG_PLOT_SURFACE
@ FG_PLOT_SURFACE
Surface plot.
Definition defines.h:163
FG_PLOT_LINE
@ FG_PLOT_LINE
Line plot.
Definition defines.h:161
fg_color_map
fg_color_map
Color maps.
Definition defines.h:125
FG_COLOR_MAP_MAGMA
@ FG_COLOR_MAP_MAGMA
perceptually uniform shades of black-red-white
Definition defines.h:134
FG_COLOR_MAP_DEFAULT
@ FG_COLOR_MAP_DEFAULT
Default [0-255] grayscale colormap.
Definition defines.h:126
FG_COLOR_MAP_SPECTRUM
@ FG_COLOR_MAP_SPECTRUM
Visual spectrum (390nm-830nm) in sRGB colorspace.
Definition defines.h:127
FG_COLOR_MAP_PLASMA
@ FG_COLOR_MAP_PLASMA
perceptually uniform shades of blue-red-yellow
Definition defines.h:135
FG_COLOR_MAP_INFERNO
@ FG_COLOR_MAP_INFERNO
perceptually uniform shades of black-red-yellow
Definition defines.h:133
FG_COLOR_MAP_RED
@ FG_COLOR_MAP_RED
Red color map.
Definition defines.h:129
FG_COLOR_MAP_VIRIDIS
@ FG_COLOR_MAP_VIRIDIS
perceptually uniform shades of blue-green-yellow
Definition defines.h:136
FG_COLOR_MAP_BLUE
@ FG_COLOR_MAP_BLUE
Blue color map.
Definition defines.h:132
FG_COLOR_MAP_MOOD
@ FG_COLOR_MAP_MOOD
Mood color map.
Definition defines.h:130
FG_COLOR_MAP_RAINBOW
@ FG_COLOR_MAP_RAINBOW
Rainbow color map.
Definition defines.h:128
FG_COLOR_MAP_HEAT
@ FG_COLOR_MAP_HEAT
Heat color map.
Definition defines.h:131
fg_font
void * fg_font
Definition defines.h:41
fg_marker_type
fg_marker_type
Definition defines.h:166
FG_MARKER_CIRCLE
@ FG_MARKER_CIRCLE
Circle marker.
Definition defines.h:169
FG_MARKER_NONE
@ FG_MARKER_NONE
No marker.
Definition defines.h:167
FG_MARKER_POINT
@ FG_MARKER_POINT
Point marker.
Definition defines.h:168
FG_MARKER_TRIANGLE
@ FG_MARKER_TRIANGLE
Triangle marker.
Definition defines.h:171
FG_MARKER_CROSS
@ FG_MARKER_CROSS
Cross-hair marker.
Definition defines.h:172
FG_MARKER_PLUS
@ FG_MARKER_PLUS
Plus symbol marker.
Definition defines.h:173
FG_MARKER_STAR
@ FG_MARKER_STAR
Star symbol marker.
Definition defines.h:174
FG_MARKER_SQUARE
@ FG_MARKER_SQUARE
Square marker.
Definition defines.h:170
fg_err
fg_err
Definition defines.h:49
FG_ERR_NOT_SUPPORTED
@ FG_ERR_NOT_SUPPORTED
Feature not supported.
Definition defines.h:85
FG_ERR_INTERNAL
@ FG_ERR_INTERNAL
Internal error.
Definition defines.h:103
FG_ERR_FILE_NOT_FOUND
@ FG_ERR_FILE_NOT_FOUND
File IO errors.
Definition defines.h:78
FG_ERR_FREEIMAGE_UNKNOWN_FORMAT
@ FG_ERR_FREEIMAGE_UNKNOWN_FORMAT
Unknown format, not supported by freeimage.
Definition defines.h:95
FG_ERR_RUNTIME
@ FG_ERR_RUNTIME
Runtime error.
Definition defines.h:104
FG_ERR_FREETYPE_ERROR
@ FG_ERR_FREETYPE_ERROR
Freetype library error.
Definition defines.h:72
FG_ERR_FONTCONFIG_ERROR
@ FG_ERR_FONTCONFIG_ERROR
Fontconfig related error.
Definition defines.h:91
FG_ERR_NONE
@ FG_ERR_NONE
Fuction returned successfully.
Definition defines.h:50
FG_ERR_FREEIMAGE_BAD_ALLOC
@ FG_ERR_FREEIMAGE_BAD_ALLOC
freeimage memory allocation failed
Definition defines.h:96
FG_ERR_NOT_CONFIGURED
@ FG_ERR_NOT_CONFIGURED
Library configuration mismatch.
Definition defines.h:86
FG_ERR_UNKNOWN
@ FG_ERR_UNKNOWN
Unkown error.
Definition defines.h:105
FG_ERR_INVALID_ARG
@ FG_ERR_INVALID_ARG
Invalid argument.
Definition defines.h:60
FG_ERR_INVALID_TYPE
@ FG_ERR_INVALID_TYPE
Invalid type argument.
Definition defines.h:59
FG_ERR_SIZE
@ FG_ERR_SIZE
Invalid size argument.
Definition defines.h:58
FG_ERR_GL_ERROR
@ FG_ERR_GL_ERROR
OpenGL error.
Definition defines.h:66
FG_ERR_FREEIMAGE_SAVE_FAILED
@ FG_ERR_FREEIMAGE_SAVE_FAILED
freeimage file save failed
Definition defines.h:97
fg_plot
void * fg_plot
Definition defines.h:45
fg_surface
void * fg_surface
Definition defines.h:46
fg_dtype
fg_dtype
Definition defines.h:150
FG_FLOAT32
@ FG_FLOAT32
Float (32-bits).
Definition defines.h:155
FG_INT32
@ FG_INT32
Signed integer (32-bits).
Definition defines.h:153
FG_INT8
@ FG_INT8
Signed byte (8-bits).
Definition defines.h:151
FG_UINT16
@ FG_UINT16
Unsigned integer (16-bits).
Definition defines.h:157
FG_UINT8
@ FG_UINT8
Unsigned byte (8-bits).
Definition defines.h:152
FG_UINT32
@ FG_UINT32
Unsigned integer (32-bits).
Definition defines.h:154
FG_INT16
@ FG_INT16
Signed integer (16-bits).
Definition defines.h:156
fg_image
void * fg_image
Definition defines.h:43
fg_vector_field
void * fg_vector_field
Definition defines.h:47
fg_color
fg_color
Definition defines.h:139
FG_WHITE
@ FG_WHITE
Definition defines.h:146
FG_GREEN
@ FG_GREEN
Definition defines.h:141
FG_CYAN
@ FG_CYAN
Definition defines.h:144
FG_MAGENTA
@ FG_MAGENTA
Definition defines.h:145
FG_BLACK
@ FG_BLACK
Definition defines.h:147
FG_RED
@ FG_RED
Definition defines.h:140
FG_BLUE
@ FG_BLUE
Definition defines.h:142
FG_YELLOW
@ FG_YELLOW
Definition defines.h:143
fg_window
void * fg_window
Definition defines.h:40
fg_histogram
void * fg_histogram
Definition defines.h:44
fg_chart_type
fg_chart_type
Definition defines.h:117
FG_CHART_3D
@ FG_CHART_3D
Three dimensional charts.
Definition defines.h:119
FG_CHART_2D
@ FG_CHART_2D
Two dimensional charts.
Definition defines.h:118
forge
Definition chart.h:305
forge::Color
fg_color Color
Definition defines.h:184
forge::ChartType
fg_chart_type ChartType
Definition defines.h:182
forge::ErrorCode
fg_err ErrorCode
Definition defines.h:180
forge::MarkerType
fg_marker_type MarkerType
Definition defines.h:186
forge::dtype
dtype
Definition defines.h:188
forge::u32
@ u32
Definition defines.h:192
forge::s32
@ s32
Definition defines.h:191
forge::f32
@ f32
Definition defines.h:193
forge::s16
@ s16
Definition defines.h:194
forge::s8
@ s8
Definition defines.h:189
forge::u16
@ u16
Definition defines.h:195
forge::u8
@ u8
Definition defines.h:190
forge::ChannelFormat
fg_channel_format ChannelFormat
Definition defines.h:181
forge::PlotType
fg_plot_type PlotType
Definition defines.h:185
forge::ColorMap
fg_color_map ColorMap
Definition defines.h:183
version.h