Window Functions

Window creation, modification and destruction functions. More...

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 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...
 
void setVisibility (const bool isVisible)
 Hide/Show the window. More...
 
AFAPI af_err af_create_window (af_window *out, const int width, const int height, const char *const title)
 C Interface wrapper for creating a window. More...
 
AFAPI af_err af_set_position (const af_window wind, const unsigned x, const unsigned y)
 C Interface wrapper for setting the start position when window is displayed. More...
 
AFAPI af_err af_set_title (const af_window wind, const char *const title)
 C Interface wrapper for setting window title. More...
 
AFAPI af_err af_set_size (const af_window wind, const unsigned w, const unsigned h)
 C Interface wrapper for setting window position. More...
 
AFAPI af_err af_grid (const af_window wind, const int rows, const int cols)
 C Interface wrapper for grid setup in a window. More...
 
AFAPI af_err af_show (const af_window wind)
 C Interface wrapper for showing a window. More...
 
AFAPI af_err af_is_window_closed (bool *out, const af_window wind)
 C Interface wrapper for checking if window is marked for close. More...
 
AFAPI af_err af_set_visibility (const af_window wind, const bool is_visible)
 Hide/Show a window. More...
 
AFAPI af_err af_destroy_window (const af_window wind)
 C Interface wrapper for destroying a window handle. More...
 

Detailed Description

Window creation, modification and destruction functions.

Function Documentation

AFAPI af_err af_create_window ( af_window out,
const int  width,
const int  height,
const char *const  title 
)

C Interface wrapper for creating a window.

Parameters
[out]outis the handle to the created window
[in]widthis the width of the window that will be created
[in]heightis the height of the window that will be created
[in]titleis the window title
Returns
AF_SUCCESS if window creation is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_destroy_window ( const af_window  wind)

C Interface wrapper for destroying a window handle.

Parameters
[in]windis the window handle
Returns
AF_SUCCESS if window destroy is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_grid ( const af_window  wind,
const int  rows,
const int  cols 
)

C Interface wrapper for grid setup in a window.

Parameters
[in]windis the window handle
[in]rowsis number of rows you want to show in a window
[in]colsis number of coloumns you want to show in a window
Returns
AF_SUCCESS if grid setup for window is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_is_window_closed ( bool *  out,
const af_window  wind 
)

C Interface wrapper for checking if window is marked for close.

Parameters
[out]outis a boolean which indicates whether window is marked for close. This usually happens when user presses ESC key while the window is in focus.
[in]windis the window handle
Returns
AF_SUCCESS if wind show is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_set_position ( const af_window  wind,
const unsigned  x,
const unsigned  y 
)

C Interface wrapper for setting the start position when window is displayed.

Parameters
[in]windis the window handle
[in]xis horizontal start coordinate
[in]yis vertical start coordinate
Returns
AF_SUCCESS if set position for window is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_set_size ( const af_window  wind,
const unsigned  w,
const unsigned  h 
)

C Interface wrapper for setting window position.

Parameters
[in]windis the window handle
[in]wis target width of the window
[in]his target height of the window
Returns
AF_SUCCESS if set size for window is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_set_title ( const af_window  wind,
const char *const  title 
)

C Interface wrapper for setting window title.

Parameters
[in]windis the window handle
[in]titleis title of the window
Returns
AF_SUCCESS if set title for window is successful, otherwise an appropriate error code is returned.
AFAPI af_err af_set_visibility ( const af_window  wind,
const bool  is_visible 
)

Hide/Show a window.

Parameters
[in]windis the window whose visibility is to be changed
[in]is_visibleindicates if the window is to be hidden or brought into focus
AFAPI af_err af_show ( const af_window  wind)

C Interface wrapper for showing a window.

Parameters
[in]windis the window handle
Returns
AF_SUCCESS if window show is successful, otherwise an appropriate error code is returned.
af_window get ( ) const
inline
Returns
Returns the af_window window handle.
void grid ( const int  rows,
const int  cols 
)
void setColorMap ( const ColorMap  cmap)

Set the colormap to be used for subsequent rendering calls.

Parameters
[in]cmapshould be one of the enum values from ColorMap
Examples:
computer_vision/matching.cpp, graphics/fractal.cpp, image_processing/brain_segmentation.cpp, image_processing/optical_flow.cpp, and pde/swe.cpp.
void setPos ( const unsigned  x,
const unsigned  y 
)

Set the start position where the window will appear.

Parameters
[in]xis horizontal coordinate
[in]yis vertical coordinate
Examples:
graphics/conway_pretty.cpp, and image_processing/pyramids.cpp.
void setSize ( const unsigned  w,
const unsigned  h 
)

Set the window size.

Parameters
[in]wis target width of the window
[in]his target height of the window
void setTitle ( const char *const  title)

Set the window title.

Parameters
[in]titleis the window title
void setVisibility ( const bool  isVisible)

Hide/Show the window.

Parameters
[in]isVisibleindicates if the window is to be hidden or brought into focus
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.

Parameters
[in]titleis 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.

Parameters
[in]widthis the window width
[in]heightis the window height
[in]titleis the window title with default value as "ArrayFire"
Window ( const af_window  wnd)

Creates a window object with default width and height with title set to "ArrayFire".

Parameters
[in]wndis an af_window handle which can be retrieved by doing a get call on any Window object
~Window ( )

Destroys the window handle.