#include <cstdio>
#include <math.h>
int main(int argc, char *argv[])
{
try {
af::Window myWindow(512, 512,
"Histogram example using ArrayFire");
myWindow.
hist(hist_out, 0, 255);
}
}
fprintf(stderr,
"%s\n", e.
what());
throw;
}
return 0;
}
Window object to render af::arrays.
Definition: graphics.h:37
A multi dimensional data container.
Definition: array.h:27
Definition: exception.h:20
virtual const char * what() const
Definition: exception.h:34
@ u8
8-bit unsigned integral values
Definition: defines.h:203
void image(const array &in, const char *title=NULL)
Renders the input array as an image 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.
bool close()
Check if window is marked for close.
AFAPI array histogram(const array &in, const unsigned nbins, const double minval, const double maxval)
C++ Interface for histogram.
AFAPI array loadImage(const char *filename, const bool is_color=false)
C++ Interface for loading an image.
const array as(dtype type) const
Converts the array into another type.
Definition: algorithm.h:15