MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / main

Function main

examples/graphics/histogram.cpp:16–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace af;
15
16int main(int, char**) {
17 try {
18 // Initialize the kernel array just once
19 af::info();
20 af::Window myWindow(512, 512, "Histogram example using ArrayFire");
21 af::Window imgWnd(480, 640, "Input Image");
22
23 array img = loadImage(ASSETS_DIR "/examples/images/arrow.jpg", false);
24 array hist_out = histogram(img, 256, 0, 255);
25
26 myWindow.setAxesTitles("Bins", "Frequency");
27 myWindow.setPos(480, 0);
28
29 while (!myWindow.close() && !imgWnd.close()) {
30 myWindow.hist(hist_out, 0, 255);
31 imgWnd.image(img.as(u8));
32 }
33 }
34
35 catch (af::exception& e) {
36 fprintf(stderr, "%s\n", e.what());
37 throw;
38 }
39 return 0;
40}

Callers

nothing calls this directly

Calls 9

infoFunction · 0.85
loadImageFunction · 0.85
setAxesTitlesMethod · 0.80
setPosMethod · 0.80
closeMethod · 0.80
histMethod · 0.80
imageMethod · 0.80
asMethod · 0.80
histogramFunction · 0.50

Tested by

no test coverage detected