117Raster environment for colour images

The 117raster environment is a framework for experimenting with raster images. You can add your own modules to the project, which is run as a WinForms application.

117raster app

Project

The framework in question can be found in the 117raster project from the repository grcis (GIT): this project also uses some shared classes from the common subdirectory. The basic application can read and save raster images, and run modules that are implemented using the IRasterModule interface.

The project contains a ModuleGlobalHistogram class, which is stored in the ModuleHistogram subdirectory and is embedded in the VS project. This module can calculate the histograms of an image, and draw them either in aggregate (gray) or in individual color components ("red", "green" or "blue")

Control

After compiling and running the 117raster project, a form appears in which you can load raster images either with the Load image button or via "Drag & Drop" into the application window. After loading the image into memory, you can view it in the application (use the scroll wheel or the right mouse button to scale or scroll).

In the bottom left of the list box all the "modules" (i.e. all classes implementing the interface IRasterModule)) that were found during compilation are shown. The module can be activated by selecting it and pressing the Activate module button. If the module has a GUI window, it will be displayed in this case and the user can then repeatedly run the calculation, which overwrites the input image. The calculation will be restarted:

  • after pressing the "Recompute" button if an input image is defined
  • After changing the text parameters "Param:" and pressing the "Enter" key
  • after pressing the left mouse button together with the Ctrl key on the input image, if the module has the HasPixelUpdate property and the PixelUpdate() method implemented.

Interface IRasterModule

This is a general interface to work with bitmap images. Each module can have several input images (of classes Bitmap or FloatImage), several output images (Bitmap or FloatImage), and an optional GUI window (form) in which one can enter additional information and / or display directly calculated results. If the module computes a raster image as result, it can be directly displayed in the original 117raster application form (to switch input and output use the check-box "result")

Overview of the most important IRasterModule functionality

  • string Author – full name of the module author
  • string Name – module name
  • string Tooltip – tool-tip help for text parameter "Param"
  • string Param – current value of the text parameter (it is entirely up to the author what content is expected in the text parameter field; the content is entered by the user in the Param:: line of the UI)
  • int InputSlots – number of input raster images (typically 1 to M)
  • void SetInput (Bitmap inputImage, int slot) – set the input image to the given slot
  • void Update () – perform calculation in module (synchronous method)
  • bool HasPixelUpdate – Should PixelUpdate() be called after user interaction on input (default is left mouse button)?
  • void PixelUpdate (int x, int y) – perform local calculation (handler interaction) in the module (synchronous method). Invoked by pressing Ctrl + left mouse button on the source image.
  • int outputSlots – number of output raster images (typically 0 to N)
  • Bitmap GetOutput (int slot) – output image reading (after the calculation is completed)
  • bool GuiWindow – activate / deactivate the GUI window of the module

Controlling the image viewer

Right mouse button – scroll the image.
Mouse Wheel – zoom in / zoom out (with Shift key: faster).
"Page Up", "Page Down", "+", "-" – zoom in / zoom out (s klávesou Shift faster).
"Zoom 100%" button – reset the image = 100% magnification, image returns to upper right corner.

Adding modules

Just add a new class to the 117raster project which implements the interface IRasterModule (or even better, derive a child of the class DefaultRasterModule class ). The application automatically recognises this class, and and adds "Module" to the user interface.

HDR Functionality

Not implemented yet.


Copyright (C) 2019 J. Pelikán and A. Wilkie , last change: 2019-05-09 17:52:59 +0200 (Thu, 09 May 2019)