Window Class Reference

- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Public Member Functions
Window Class Reference
Graphics

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 | setSize (const unsigned w, const unsigned h)
| Set the window size. 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 | plot3 (const array &in, const char *title=NULL)
| Renders the input array as an 3d line plot 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 | surface (const array &S, const char *const title)
| Renders the input arrays as a 3D surface plot to the window. More...
void | surface (const array &xVals, const array &yVals, const array &S, const char *const title)
| Renders the input arrays as a 3D surface plot 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...

## Detailed Description

Window object to render af::arrays.

Examples:
  adaptive_thresholding.cpp, binary_thresholding.cpp, brain_segmentation.cpp, conway.cpp, conway_pretty.cpp, edge.cpp, filters.cpp, fractal.cpp, image_demo.cpp, image_editing.cpp, matching.cpp, morphing.cpp, optical_flow.cpp, plot2d.cpp, plot3.cpp, pyramids.cpp, surface.cpp, and swe.cpp.

## Member Function Documentation

Window& operator() | ( | const int | r,
|  | const int | c
| ) |  |
| 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.

Returns
  a reference to the object pointed by this to enable cascading this call with rendering functions.

The documentation for this class was generated from the following file:

- graphics.h