# HISTORY
# 2012-04-14 23:26
#   Tried recompiling everything and setting up a test case.
# 2011-12-19 17:16
#   Fixed the greyscaling of the resampled images being imported.
#   Implemented the import button to select an image file and to resample to w x h x c as specifed in the open db
# 2011-12-18 14:00
#   Created basic gui with all contols.
#   Created test image dialog to generate random images
#   Implemented the open, create and tools buttons

ERRORS:
#  2012-04-14 23:36
#     When importing images the grayscale image pallete is not ordered as expected. THIS USED TO WORK!






QUICKSTART:

Testing the commandline programs:

  Start a dos prompt to the perm directory.
  Run the batch file permtest.bat like this:  permtest ruemorgue1.png 100 100 256
  This will create test.png and permindex.txt
  test.png should be identical to ruemorgue1.png
  permindex.txt will contain a very large number which is the permutation index of this image.
  test.png was generated using the value in permindex.txt
  Try another image file but make sure its a png and has a linear greyscale palette


Testing the gui image import:

  Start the permgui.exe
  Select create, and enter name: TEST width:100 height:100 colours:256
  Press import
  Select an image file e.g ruemorgue1.jpg
  It will create ruemorgue1.jpg.png in the same direction
  The image will be grayscale, 100x100 with 256 colour pallete.
  The file test_100_100_256.perm  will be created aswell, records the width height colors and permutation key for the image imported.



TODO:
  When creating db, also create the image subdirectory where imported images go.
  On the import button allow multiple files to be selected
  Display completion bar while sampling the images importing.
  Copy the imported files to the db directory for the images.
  For each image imported  Add entry to internal db structure and calculate the perm key, x and y grid point, for it, save it to the file
  Modify the open to read the image data and populate the structure.
  Update the image list on main dialog with images in db.
  When clicking on an image in the list, load the file and show in the preview window.
  Implement the graph button to draw and graph of the x/ys of the images in the canvas window.(do i need a graph button? maybe it should always render it.)


OTHER THINGS:
  Show whcih database is open somewhere (title?)
  Maybe scale the preview images so they are easier to see the small ones.
  Dialog to add key predictor/calculators functions.  e.g a filter that will generate a set of meaningful keys.
  Dialog for key arithmetic (add, sub, mul)
