/* program to display a sequence of images
 *    each image has an outer blue border, a middle green region, 
 *       and an inner red section
 *    successive images the blue and green regions get 
 *       successively bigger, smaller, bigger, etc.
 *
 * This program and all MyroC software is licensed under the Creative Commons
 * Attribution-Noncommercial-Share Alike 3.0 United States License.
 * Details may be found at http://creativecommons.org/licenses/by-nc-sa/3.0/us/
 */

/* thus program only displays one image window, entitled "image window"
 */

/* utilize a MyroC-type package for rDisplayPicture
 */
#include "MyroC.h"
#include <stdio.h>
#include <unistd.h>   // needed for sleep function

int main ()
{
  Picture pic;

  /* printf statements added to example to report processing steps */
  printf ("example program to read and display a sequence of saved images\n");
  printf ("   saved images display rectangles, in which");
  printf ("   borders get bigger, smaller, bigger, etc.\n");

  int i;

  char * files[13] = {"one.jpg", "two.jpg", "three.jpg",
                       "four.jpg", "five.jpg", "six.jpg",
                       "seven.jpg", "eight.jpg", "nine.jpg",
                       "ten.jpg", "eleven.jpg", "twelve.jpg",
                       "thirteen.jpg"};

  for (i = 0; i < 5; i++)
    {
      printf ("reading image %s\n", files[i]);
      pic = rLoadPicture (files[i]);
      printf ("displaying image\n");
      rDisplayPicture (&pic, i+3, "saved images");
     }

  printf ("program completed\n");
  return 0;
}
