Window object to render af::arrays. More...
#include <graphics.h>
Public Member Functions | |
| Window () | |
| Creates a window object with default width and height with title set to "ArrayFire". More... | |
| Window (const char *const title) | |
| Creates a window object with default width and height using the title provided by the user. More... | |
| Window (const int width, const int height, const char *const title="ArrayFire") | |
| Creates a window object using the parameters provided by the user. More... | |
| Window (const af_window wnd) | |
| Creates a window object with default width and height with title set to "ArrayFire". More... | |
| ~Window () | |
| Destroys the window handle. More... | |
| af_window | get () const |
| void | setPos (const unsigned x, const unsigned y) |
| Set the start position where the window will appear. More... | |
| void | setTitle (const char *const title) |
| Set the window title. More... | |
| void | setColorMap (const ColorMap cmap) |
| Set the colormap to be used for subsequent rendering calls. More... | |
| void | image (const array &in, const char *title=NULL) |
| Renders the input array as an image to the window. More... | |
| void | plot (const array &X, const array &Y, const char *const title=NULL) |
| Renders the input arrays as a 2D plot to the window. More... | |
| void | hist (const array &X, const double minval, const double maxval, const char *const title=NULL) |
| Renders the input array as a histogram to the window. More... | |
| void | grid (const int rows, const int cols) |
| Setup grid layout for multiview mode in a window. More... | |
| void | show () |
| This function swaps the background buffer to current view and polls for any key strokes while the window was in focus. More... | |
| bool | close () |
| Check if window is marked for close. More... | |
| Window & | operator() (const int r, const int c) |
| This function is used to keep track of which cell in the grid mode is being currently rendered. More... | |
Window object to render af::arrays.
| Window | ( | ) |
Creates a window object with default width and height with title set to "ArrayFire".
| Window | ( | const char *const | title | ) |
Creates a window object with default width and height using the title provided by the user.
| [in] | title | is the window title |
| Window | ( | const int | width, |
| const int | height, | ||
| const char *const | title = "ArrayFire" |
||
| ) |
Creates a window object using the parameters provided by the user.
| [in] | width | is the window width |
| [in] | height | is the window height |
| [in] | title | is the window title with default value as "ArrayFire" |
| ~Window | ( | ) |
Destroys the window handle.
| bool close | ( | ) |
Check if window is marked for close.
This usually happens when user presses ESC key while the window is in focus.
| void grid | ( | const int | rows, |
| const int | cols | ||
| ) |
Setup grid layout for multiview mode in a window.
| [in] | rows | is number of rows you want to show in a window |
| [in] | cols | is number of coloumns you want to show in a window |
| void hist | ( | const array & | X, |
| const double | minval, | ||
| const double | maxval, | ||
| const char *const | title = NULL |
||
| ) |
Renders the input array as a histogram to the window.
| [in] | X | is the data frequency array |
| [in] | minval | is the value of the minimum data point of the array whose histogram(X) is going to be rendered. |
| [in] | maxval | is the value of the maximum data point of the array whose histogram(X) is going to be rendered. |
| [in] | title | parameter is used when this function is called in grid mode |
X should be a vector. | void image | ( | const array & | in, |
| const char * | title = NULL |
||
| ) |
Renders the input array as an image to the window.
| [in] | in | is an array |
| [in] | title | parameter is used when this function is called in grid mode |
in should be 2d array or 3d array with 3 channels.
|
inline |
This function is used to keep track of which cell in the grid mode is being currently rendered.
When a user does Window(0,0), we internally store the cell coordinates and return a reference to the very object that called upon this function. This reference can be used later to issue draw calls using rendering functions.
Renders the input arrays as a 2D plot to the window.
| [in] | X | is an array with the x-axis data points |
| [in] | Y | is an array with the y-axis data points |
| [in] | title | parameter is used when this function is called in grid mode |
X and Y should be vectors. | void setColorMap | ( | const ColorMap | cmap | ) |
Set the colormap to be used for subsequent rendering calls.
| [in] | cmap | should be one of the enum values from ColorMap |
| void setPos | ( | const unsigned | x, |
| const unsigned | y | ||
| ) |
Set the start position where the window will appear.
| [in] | x | is horizontal coordinate |
| [in] | y | is vertical coordinate |
| void setTitle | ( | const char *const | title | ) |
Set the window title.
| [in] | title | is the window title |
| void show | ( | ) |
This function swaps the background buffer to current view and polls for any key strokes while the window was in focus.