A high-performance general-purpose compute library
Rendering Functions

Rendering functions to draw images, plots etc. More...

Functions

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 &in, const char *const title=NULL)
 Renders the input arrays as a 2D or 3D plot to the window. More...
 
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. 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 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. More...
 
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. More...
 
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. More...
 
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. 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=NULL)
 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=NULL)
 Renders the input arrays as a 3D surface plot to the window. More...
 
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. More...
 
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. More...
 
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. More...
 
AFAPI af_err af_draw_image (const af_window wind, const af_array in, const af_cell *const props)
 C Interface wrapper for drawing an array as an image. More...
 
AFAPI af_err af_draw_plot (const af_window wind, const af_array X, const af_array Y, const af_cell *const props)
 C Interface wrapper for drawing an array as a plot. More...
 
AFAPI af_err af_draw_plot3 (const af_window wind, const af_array P, const af_cell *const props)
 C Interface wrapper for drawing an array as a plot. More...
 
AFAPI af_err af_draw_plot_nd (const af_window wind, const af_array P, const af_cell *const props)
 C Interface wrapper for drawing an array as a 2D or 3D plot. More...
 
AFAPI af_err af_draw_plot_2d (const af_window wind, const af_array X, const af_array Y, const af_cell *const props)
 C Interface wrapper for drawing an array as a 2D plot. More...
 
AFAPI af_err af_draw_plot_3d (const af_window wind, const af_array X, const af_array Y, const af_array Z, const af_cell *const props)
 C Interface wrapper for drawing an array as a 3D plot. More...
 
AFAPI af_err af_draw_scatter (const af_window wind, const af_array X, const af_array Y, const af_marker_type marker, const af_cell *const props)
 C Interface wrapper for drawing an array as a plot. More...
 
AFAPI af_err af_draw_scatter3 (const af_window wind, const af_array P, const af_marker_type marker, const af_cell *const props)
 C Interface wrapper for drawing an array as a plot. More...
 
AFAPI af_err af_draw_scatter_nd (const af_window wind, const af_array P, const af_marker_type marker, const af_cell *const props)
 C Interface wrapper for drawing an array as a plot. More...
 
AFAPI af_err af_draw_scatter_2d (const af_window wind, const af_array X, const af_array Y, const af_marker_type marker, const af_cell *const props)
 C Interface wrapper for drawing an array as a 2D plot. More...
 
AFAPI af_err af_draw_scatter_3d (const af_window wind, const af_array X, const af_array Y, const af_array Z, const af_marker_type marker, const af_cell *const props)
 C Interface wrapper for drawing an array as a 3D plot. More...
 
AFAPI af_err af_draw_hist (const af_window wind, const af_array X, const double minval, const double maxval, const af_cell *const props)
 C Interface wrapper for drawing an array as a histogram. More...
 
AFAPI af_err af_draw_surface (const af_window wind, const af_array xVals, const af_array yVals, const af_array S, const af_cell *const props)
 C Interface wrapper for drawing array's as a surface. More...
 
AFAPI af_err af_draw_vector_field_nd (const af_window wind, const af_array points, const af_array directions, const af_cell *const props)
 C Interface wrapper for drawing array's as a 2D or 3D vector field. More...
 
AFAPI af_err af_draw_vector_field_3d (const af_window wind, const af_array xPoints, const af_array yPoints, const af_array zPoints, const af_array xDirs, const af_array yDirs, const af_array zDirs, const af_cell *const props)
 C Interface wrapper for drawing array's as a 3D vector field. More...
 
AFAPI af_err af_draw_vector_field_2d (const af_window wind, const af_array xPoints, const af_array yPoints, const af_array xDirs, const af_array yDirs, const af_cell *const props)
 C Interface wrapper for drawing array's as a 2D vector field. More...
 

Detailed Description

Rendering functions to draw images, plots etc.

Function Documentation

◆ af_draw_hist()

AFAPI af_err af_draw_hist ( const af_window  wind,
const af_array  X,
const double  minval,
const double  maxval,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a histogram.

Parameters
[in]windis the window handle
[in]Xis the data frequency af_array
[in]minvalis the value of the minimum data point of the array whose histogram(X) is going to be rendered.
[in]maxvalis the value of the maximum data point of the array whose histogram(X) is going to be rendered.
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X should be a vector.

◆ af_draw_image()

AFAPI af_err af_draw_image ( const af_window  wind,
const af_array  in,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as an image.

Parameters
[in]windis the window handle
[in]inis an af_array
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
in should be 2d array or 3d array with 3 channels.

◆ af_draw_plot()

AFAPI af_err af_draw_plot ( const af_window  wind,
const af_array  X,
const af_array  Y,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a plot.

Parameters
[in]windis the window handle
[in]Xis an af_array with the x-axis data points
[in]Yis an af_array with the y-axis data points
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X and Y should be vectors.

◆ af_draw_plot3()

AFAPI af_err af_draw_plot3 ( const af_window  wind,
const af_array  P,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a plot.

Parameters
[in]windis the window handle
[in]Pis an af_array or matrix with the xyz-values of the points
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
P should be a 3n x 1 vector or one of a 3xn or nx3 matrices.

◆ af_draw_plot_2d()

AFAPI af_err af_draw_plot_2d ( const af_window  wind,
const af_array  X,
const af_array  Y,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a 2D plot.

Parameters
[in]windis the window handle
[in]Xis an af_array with the x-axis data points
[in]Yis an af_array with the y-axis data points
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X and Y should be vectors.

◆ af_draw_plot_3d()

AFAPI af_err af_draw_plot_3d ( const af_window  wind,
const af_array  X,
const af_array  Y,
const af_array  Z,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a 3D plot.

Parameters
[in]windis the window handle
[in]Xis an af_array with the x-axis data points
[in]Yis an af_array with the y-axis data points
[in]Zis an af_array with the z-axis data points
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X, Y and Z should be vectors.

◆ af_draw_plot_nd()

AFAPI af_err af_draw_plot_nd ( const af_window  wind,
const af_array  P,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a 2D or 3D plot.

Parameters
[in]windis the window handle
[in]Pis an af_array or matrix with the xyz-values of the points
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
in must be 2d and of the form [n, order], where order is either 2 or 3. If order is 2, then chart is 2D and if order is 3, then chart is 3D.

◆ af_draw_scatter()

AFAPI af_err af_draw_scatter ( const af_window  wind,
const af_array  X,
const af_array  Y,
const af_marker_type  marker,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a plot.

Parameters
[in]windis the window handle
[in]Xis an af_array with the x-axis data points
[in]Yis an af_array with the y-axis data points
[in]markeris an af_marker_type enum specifying which marker to use in the scatter plot
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X and Y should be vectors.

◆ af_draw_scatter3()

AFAPI af_err af_draw_scatter3 ( const af_window  wind,
const af_array  P,
const af_marker_type  marker,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a plot.

Parameters
[in]windis the window handle
[in]Pis an af_array or matrix with the xyz-values of the points
[in]markeris an af_marker_type enum specifying which marker to use in the scatter plot
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.

◆ af_draw_scatter_2d()

AFAPI af_err af_draw_scatter_2d ( const af_window  wind,
const af_array  X,
const af_array  Y,
const af_marker_type  marker,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a 2D plot.

Parameters
[in]windis the window handle
[in]Xis an af_array with the x-axis data points
[in]Yis an af_array with the y-axis data points
[in]markeris an af_marker_type enum specifying which marker to use in the scatter plot
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X and Y should be vectors.

◆ af_draw_scatter_3d()

AFAPI af_err af_draw_scatter_3d ( const af_window  wind,
const af_array  X,
const af_array  Y,
const af_array  Z,
const af_marker_type  marker,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a 3D plot.

Parameters
[in]windis the window handle
[in]Xis an af_array with the x-axis data points
[in]Yis an af_array with the y-axis data points
[in]Zis an af_array with the z-axis data points
[in]markeris an af_marker_type enum specifying which marker to use in the scatter plot
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X, Y and Z should be vectors.

◆ af_draw_scatter_nd()

AFAPI af_err af_draw_scatter_nd ( const af_window  wind,
const af_array  P,
const af_marker_type  marker,
const af_cell *const  props 
)

C Interface wrapper for drawing an array as a plot.

Parameters
[in]windis the window handle
[in]Pis an af_array or matrix with the xyz-values of the points
[in]markeris an af_marker_type enum specifying which marker to use in the scatter plot
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
in must be 2d and of the form [n, order], where order is either 2 or 3. If order is 2, then chart is 2D and if order is 3, then chart is 3D.

◆ af_draw_surface()

AFAPI af_err af_draw_surface ( const af_window  wind,
const af_array  xVals,
const af_array  yVals,
const af_array  S,
const af_cell *const  props 
)

C Interface wrapper for drawing array's as a surface.

Parameters
[in]windis the window handle
[in]xValsis an af_array with the x-axis data points
[in]yValsis an af_array with the y-axis data points
[in]Sis an af_array with the z-axis data points
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
X and Y should be vectors. S should be a 2D array

◆ af_draw_vector_field_2d()

AFAPI af_err af_draw_vector_field_2d ( const af_window  wind,
const af_array  xPoints,
const af_array  yPoints,
const af_array  xDirs,
const af_array  yDirs,
const af_cell *const  props 
)

C Interface wrapper for drawing array's as a 2D vector field.

Parameters
[in]windis the window handle
[in]xPointsis an af_array with the x-axis points
[in]yPointsis an af_array with the y-axis points
[in]xDirsis an af_array with the x-axis directions
[in]yDirsis an af_array with the y-axis directions
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
all the af_array inputs should be vectors and the same size

◆ af_draw_vector_field_3d()

AFAPI af_err af_draw_vector_field_3d ( const af_window  wind,
const af_array  xPoints,
const af_array  yPoints,
const af_array  zPoints,
const af_array  xDirs,
const af_array  yDirs,
const af_array  zDirs,
const af_cell *const  props 
)

C Interface wrapper for drawing array's as a 3D vector field.

Parameters
[in]windis the window handle
[in]xPointsis an af_array with the x-axis points
[in]yPointsis an af_array with the y-axis points
[in]zPointsis an af_array with the z-axis points
[in]xDirsis an af_array with the x-axis directions
[in]yDirsis an af_array with the y-axis directions
[in]zDirsis an af_array with the z-axis directions
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
all the af_array inputs should be vectors and the same size

◆ af_draw_vector_field_nd()

AFAPI af_err af_draw_vector_field_nd ( const af_window  wind,
const af_array  points,
const af_array  directions,
const af_cell *const  props 
)

C Interface wrapper for drawing array's as a 2D or 3D vector field.

Parameters
[in]windis the window handle
[in]pointsis an af_array with the points
[in]directionsis an af_array with the directions
[in]propsis structure af_cell that has the properties that are used for the current rendering.
Returns
AF_SUCCESS if rendering is successful, otherwise an appropriate error code is returned.
Note
points and directions should have the same size and must be 2D. The number of rows (dim 0) determines are number of points and the number columns determines the type of plot. If the number of columns are 2, then the plot is 2D and if there are 3 columns, then the plot is 3D.
all the af_array inputs should be vectors and the same size

◆ hist()

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.

Parameters
[in]Xis the data frequency array
[in]minvalis the value of the minimum data point of the array whose histogram(X) is going to be rendered.
[in]maxvalis the value of the maximum data point of the array whose histogram(X) is going to be rendered.
[in]titleparameter is used when this function is called in grid mode
Note
X should be a vector.
Examples
graphics/histogram.cpp.

◆ image()

void image ( const array in,
const char *  title = NULL 
)

Renders the input array as an image to the window.

Parameters
[in]inis an array
[in]titleparameter is used when this function is called in grid mode
Note
in should be 2d array or 3d array with 3 channels.
Examples
computer_vision/fast.cpp, computer_vision/harris.cpp, computer_vision/susan.cpp, graphics/conway.cpp, graphics/conway_pretty.cpp, and graphics/histogram.cpp.

◆ plot() [1/3]

void plot ( const array in,
const char *const  title = NULL 
)

Renders the input arrays as a 2D or 3D plot to the window.

Parameters
[in]inis an array with the data points
[in]titleparameter is used when this function is called in grid mode
Note
in must be 2d and of the form [n, order], where order is either 2 or 3. If order is 2, then chart is 2D and if order is 3, then chart is 3D.
Examples
graphics/plot2d.cpp, and graphics/plot3.cpp.

◆ plot() [2/3]

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.

Parameters
[in]Xis an array with the x-axis data points
[in]Yis an array with the y-axis data points
[in]Zis an array with the z-axis data points
[in]titleparameter is used when this function is called in grid mode
Note
X, Y and Z should be vectors.

◆ plot() [3/3]

void plot ( const array X,
const array Y,
const char *const  title = NULL 
)

Renders the input arrays as a 2D plot to the window.

Parameters
[in]Xis an array with the x-axis data points
[in]Yis an array with the y-axis data points
[in]titleparameter is used when this function is called in grid mode
Note
X and Y should be vectors.

◆ plot3()

void plot3 ( const array in,
const char *  title = NULL 
)

Renders the input array as an 3d line plot to the window.

Parameters
[in]inis an array
[in]titleparameter is used when this function is called in grid mode
Note
in should be 1d array of size 3n or 2d array with (3 x n) or (n x 3) channels.

◆ scatter() [1/3]

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.

Parameters
[in]inis an array with the data points
[in]markeris an markerType enum specifying which marker to use in the scatter plot
[in]titleparameter is used when this function is called in grid mode
Note
in must be 2d and of the form [n, order], where order is either 2 or 3. If order is 2, then chart is 2D and if order is 3, then chart is 3D.
Examples
graphics/plot2d.cpp.

◆ scatter() [2/3]

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.

Parameters
[in]Xis an array with the x-axis data points
[in]Yis an array with the y-axis data points
[in]markeris an markerType enum specifying which marker to use in the scatter plot
[in]titleparameter is used when this function is called in grid mode
Note
X and Y should be vectors.

◆ scatter() [3/3]

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.

Parameters
[in]Xis an array with the x-axis data points
[in]Yis an array with the y-axis data points
[in]Zis an array with the z-axis data points
[in]markeris an markerType enum specifying which marker to use in the scatter plot
[in]titleparameter is used when this function is called in grid mode
Note
X, Y and Z should be vectors.

◆ scatter3()

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.

Parameters
[in]Pis an af_array or matrix with the xyz-values of the points
[in]markeris an markerType enum specifying which marker to use in the scatter plot
[in]titleparameter is used when this function is called in grid mode

◆ surface() [1/2]

void surface ( const array S,
const char *const  title = NULL 
)

Renders the input arrays as a 3D surface plot to the window.

Parameters
[in]Sis an array with the z-axis data points
[in]titleparameter is used when this function is called in grid mode
Note
S should be a 2D array
Examples
graphics/surface.cpp.

◆ surface() [2/2]

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.

Parameters
[in]xValsis an array with the x-axis data points
[in]yValsis an array with the y-axis data points
[in]Sis an array with the z-axis data points
[in]titleparameter is used when this function is called in grid mode
Note
X and Y should be vectors or 2D arrays S should be s 2D array

◆ vectorField() [1/3]

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.

Parameters
[in]pointsis an array with the points
[in]directionsis an array with the directions at the points
[in]titleparameter is used when this function is called in grid mode
Note
points and directions should have the same size and must be 2D. The number of rows (dim 0) determines are number of points and the number columns determines the type of plot. If the number of columns are 2, then the plot is 2D and if there are 3 columns, then the plot is 3D.
Examples
graphics/field.cpp.

◆ vectorField() [2/3]

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.

Parameters
[in]xPointsis an array with the x-coordinate points
[in]yPointsis an array with the y-coordinate points
[in]xDirsis an array with the x-coordinate directions at the points
[in]yDirsis an array with the y-coordinate directions at the points
[in]titleparameter is used when this function is called in grid mode
Note
All the array inputs must be vectors and must have the size sizes.

◆ vectorField() [3/3]

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.

Parameters
[in]xPointsis an array with the x-coordinate points
[in]yPointsis an array with the y-coordinate points
[in]zPointsis an array with the z-coordinate points
[in]xDirsis an array with the x-coordinate directions at the points
[in]yDirsis an array with the y-coordinate directions at the points
[in]zDirsis an array with the z-coordinate directions at the points
[in]titleparameter is used when this function is called in grid mode
Note
All the array inputs must be vectors and must have the size sizes.