Skip to content

Commit db329f1

Browse files
author
pradeep
committed
Added colormap option to examples to make them look pretty
1 parent ad07a2d commit db329f1

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

examples/graphics/conway_pretty.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ int main(int argc, char *argv[])
4040

4141
af::Window simpleWindow(512, 512, "Conway's Game Of Life - Current State");
4242
af::Window prettyWindow(512, 512, "Conway's Game Of Life - Visualizing States");
43+
simpleWindow.setPos(25, 25);
44+
prettyWindow.setPos(125, 15);
4345

4446
int frame_count = 0;
4547

@@ -50,7 +52,7 @@ int main(int argc, char *argv[])
5052

5153
array display = tile(state, 1, 1, 3, 1);
5254

53-
while(!simpleWindow.close() || !prettyWindow.close()) {
55+
while(!simpleWindow.close() && !prettyWindow.close()) {
5456
af::timer delay = timer::start();
5557

5658
if(!simpleWindow.close()) simpleWindow.image(state);

examples/graphics/fractal.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ int main(int argc, char **argv)
7373
info();
7474
printf("** ArrayFire Fractals Demo **\n");
7575
af::Window wnd("Fractal Demo");
76+
wnd.setColorMap(AF_COLORMAP_SPECTRUM);
7677

7778
float center[] = {-0.5, 0};
7879
// Keep zomming out for each frame
79-
for (int zoom = 1000; zoom > 10; zoom -= 5) {
80+
for (int zoom = 1000; zoom > 100; zoom -= 1) {
8081
// Generate the grid at the current zoom factor
8182
array c = complex_grid(WIDTH, HEIGHT, zoom, center);
8283

examples/image_processing/brain_segmentation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ array segment_volume(array A, int k)
9191
void brain_seg(bool console)
9292
{
9393
af::Window wnd("Brain Segmentation Demo");
94+
wnd.setColorMap(AF_COLORMAP_HEAT);
9495

9596
double time_total = 30; // run for N seconds
9697

examples/image_processing/optical_flow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static void diffs(array& Ix, array& Iy, array& It, array I1, array I2)
3838
static void optical_flow_demo(bool console)
3939
{
4040
af::Window wnd("Horn-Schunck Optical Flow Demo");
41+
wnd.setColorMap(AF_COLORMAP_COLORS);
4142

4243
double time_total = 10; // run for N seconds
4344

0 commit comments

Comments
 (0)