A high-performance general-purpose compute library

- Main Page
- Tutorials
- 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".
| Window (const char *const title)
| Creates a window object with default width and height using the title provided by the user.
| Window (const int width, const int height, const char *const title="ArrayFire")
| Creates a window object using the parameters provided by the user.
| Window (const af_window window)
| Creates a window object with default width and height with title set to "ArrayFire".
| ~Window ()
| Destroys the window handle.
af_window | get () const
void | setPos (const unsigned x, const unsigned y)
| Set the start position where the window will appear.
void | setTitle (const char *const title)
| Set the window title.
void | setSize (const unsigned w, const unsigned h)
| Set the window size.
void | setColorMap (const ColorMap cmap)
| Set the colormap to be used for subsequent rendering calls.
void | image (const array &in, const char *title=NULL)
| Renders the input array as an image to the window.
void | plot3 (const array &in, const char *title=NULL)
| Renders the input array as an 3d line plot to the window.
void | plot (const array &in, const char *const title=NULL)
| Renders the input arrays as a 2D or 3D plot to the window.
void | plot (const array &X, const array &Y, const array &Z, const char *const title=NULL)
| Renders the input arrays as a 3D plot to the window.
void | plot (const array &X, const array &Y, const char *const title=NULL)
| Renders the input arrays as a 2D plot to the window.
void | scatter (const array &in, const af::markerType marker=AF_MARKER_POINT, const char *const title=NULL)
| Renders the input arrays as a 2D or 3D scatter-plot to the window.
void | scatter (const array &X, const array &Y, const array &Z, const af::markerType marker=AF_MARKER_POINT, const char *const title=NULL)
| Renders the input arrays as a 3D scatter-plot to the window.
void | scatter (const array &X, const array &Y, const af::markerType marker=AF_MARKER_POINT, const char *const title=NULL)
| Renders the input arrays as a 2D scatter-plot to the window.
void | scatter3 (const array &P, const af::markerType marker=AF_MARKER_POINT, const char *const title=NULL)
| Renders the input arrays as a 3D scatter-plot to the 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.
void | surface (const array &S, const char *const title=NULL)
| Renders the input arrays as a 3D surface plot to the window.
void | surface (const array &xVals, const array &yVals, const array &S, const char *const title=NULL)
| Renders the input arrays as a 3D surface plot to the window.
void | vectorField (const array &points, const array &directions, const char *const title=NULL)
| Renders the input arrays as a 2D or 3D vector field plot to the window.
void | vectorField (const array &xPoints, const array &yPoints, const array &zPoints, const array &xDirs, const array &yDirs, const array &zDirs, const char *const title=NULL)
| Renders the input arrays as a 3D vector field plot to the window.
void | vectorField (const array &xPoints, const array &yPoints, const array &xDirs, const array &yDirs, const char *const title=NULL)
| Renders the input arrays as a 2D vector field plot to the window.
void | setAxesLimits (const array &x, const array &y, const bool exact=false)
| Setup the axes limits for a 2D histogram/plot/vector field.
void | setAxesLimits (const array &x, const array &y, const array &z, const bool exact=false)
| Setup the axes limits for a histogram/plot/surface/vector field.
void | setAxesLimits (const float xmin, const float xmax, const float ymin, const float ymax, const bool exact=false)
| Setup the axes limits for a histogram/plot/surface/vector field.
void | setAxesLimits (const float xmin, const float xmax, const float ymin, const float ymax, const float zmin, const float zmax, const bool exact=false)
| Setup the axes limits for a histogram/plot/surface/vector field.
void | setAxesTitles (const char *const xtitle="X-Axis", const char *const ytitle="Y-Axis", const char *const ztitle=NULL)
| Setup the axes titles for a plot/surface/vector field.
void | setAxesLabelFormat (const char *const xformat="4.1%f", const char *const yformat="4.1%f", const char *const zformat=NULL)
| Setup the axes label formats for charts.
void | grid (const int rows, const int cols)
| Setup grid layout for multiview mode in a window.
void | show ()
| This function swaps the background buffer to current view and polls for any key strokes while the window was in focus.
bool | close ()
| Check if window is marked for close.
void | setVisibility (const bool isVisible)
| Hide/Show the window.
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.

## Detailed Description

Window object to render af::arrays.

Windows are not CopyConstructible or CopyAssignable.

Examples
  computer_vision/fast.cpp, computer_vision/harris.cpp, computer_vision/matching.cpp, computer_vision/susan.cpp, graphics/conway.cpp, graphics/conway_pretty.cpp, graphics/field.cpp, graphics/fractal.cpp, graphics/gravity_sim.cpp, graphics/histogram.cpp, graphics/plot2d.cpp, graphics/plot3.cpp, graphics/surface.cpp, image_processing/adaptive_thresholding.cpp, image_processing/binary_thresholding.cpp, image_processing/brain_segmentation.cpp, image_processing/confidence_connected_components.cpp, image_processing/deconvolution.cpp, image_processing/edge.cpp, image_processing/filters.cpp, image_processing/gradient_diffusion.cpp, image_processing/image_demo.cpp, image_processing/image_editing.cpp, image_processing/morphing.cpp, image_processing/optical_flow.cpp, image_processing/pyramids.cpp, machine_learning/geneticalgorithm.cpp, machine_learning/kmeans.cpp, and pde/swe.cpp.

Definition at line 37 of file graphics.h.

## Member Function Documentation

## ◆ operator()()

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.

Parameters

  [in] | r | is row identifier where current object has to be rendered
  [in] | c | is column identifier where current object has to be rendered

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

Definition at line 560 of file graphics.h.

560 {
561 _r = r; _c = c;
562 return *this;
563 }

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

- graphics.h