Glyph Generator 1.12 for Linux

Glyph Generator


Note: GlyphGen is also available as a java applet: Click here.


I've written a glyph generator for the POV devices. It will generate a header file for a glyph, ready to be compiled into the POV source. It's got a few features to make things as easy as possible for the user, but you still might prefer to create the actual image in another program (gimp, paint, whatever), and then import it into glyphgen to create the header. Several image formats are supported, such as .png, .jpg, .bmp, and .tif.

Contact with any questions/comments.

Features:
    *  Glyphs can be saved as images, header files, or project files.
    *  A few built-in tools are available, such as resize, flip, autocrop, etc.
    *  Unlimited undo/redo functionality.
    *  Opens and saves images in several popular formats (.png, .jpg, .bmp, .tif)
    *  Image can be moved around with the arrow keys for convenience. This makes it easy to center or otherwise align the image very quickly. A large buffer is provided so the entire image can be shifted off-screen and still be retrieved by shifting it back onto the screen using the opposite arrow key. Note that this buffer is not considered part of the image. Any portions of the image which are moved off-screen are guaranteed to be lost when the image is:
      + Changed by clicking or unclicking a pixel
      + Modified by any of the tools
      + Saved
  Also, the Home, End, PageUp, and PageDown keys are supported for moving the image around. These keys move the image to the extremes of the canvas (left, right, top, and bottom, respectively).


Download:
       GlyphGen version 1.12
       If this does not build on your system using the included Makefile, see the qmake documentation for generating your own Makefile from the included project file (*.pro).
       Requirements: Linux, Qt 4.6 development lib


General Use:
    *  Left-click a pixel to turn it on (drag to paint).
    *  Right-click a pixel to turn it off (drag to unpaint).
    *  Shift the image around using arrow keys.
    *  Use the menu options for all other operations.
    *  When saving as a header file, you will be asked for a Glyph Name, a Constant Name, and a Constant value.
  In the "bat" example below, these are:
 Glyph Name = "my_bat"
 Constant Name = "MY_BAT"
 Constant Value = "254"
 Note that the Constant Value is an unsigned char, so it's maximum value (usually 255) is limited by that data type.
 You also must make sure that your choice for "Constant Value" does not conflict with other character/glyph
 values defined in other header files such as "characters8.h", etc.
    *  See this page about glyphs for additional information on using glyphs on the POV boards.


Sample header file generated for the bat image above:

#ifndef __H__MyBat_h__H__
#define __H__MyBat_h__H__
#define MY_BAT (unsigned char)254
unsigned char my_bat[45][2]=
{   0x00, 0x18,
 0x00, 0x0c,
 0x00, 0x0e,
 0x00, 0x07,
 0x80, 0x07,
 0xc0, 0x0f,
 0xc0, 0x1f,
 0xe0, 0x0f,
 0xe0, 0x07,
 0xf0, 0x07,
 0xf0, 0x07,
 0xf0, 0x0f,
 0xf0, 0x1f,
 0xf8, 0x0f,
 0xf0, 0x07,
 0xf0, 0x07,
 0xf0, 0x07,
 0xf0, 0x0f,
 0xe0, 0x1f,
 0xc0, 0x0f,
 0xfe, 0x07,
 0xec, 0x3f,
 0xf8, 0x7f,
 0xec, 0x3f,
 0xfe, 0x07,
 0xc0, 0x0f,
 0xe0, 0x1f,
 0xf0, 0x0f,
 0xf0, 0x07,
 0xf0, 0x07,
 0xf0, 0x07,
 0xf8, 0x0f,
 0xf0, 0x1f,
 0xf0, 0x0f,
 0xf0, 0x07,
 0xf0, 0x07,
 0xe0, 0x07,
 0xe0, 0x0f,
 0xc0, 0x1f,
 0xc0, 0x0f,
 0x80, 0x07,
 0x00, 0x07,
 0x00, 0x0e,
 0x00, 0x0c,
 0x00, 0x18
};// End definition of glyph "my_bat"
#endif    // __H__MyBat_h__H__



So now how do we get this image into the POV board? For the answer, search in the V3 source code for "CHECKERED". There will be one instance in main() as a "case" statement in the switch(PatternNum) block (around line 391), and one instance in the ShowChar15() function as a "case" statement in the switch(character) block (around line 939). Simply add "case" statements for your new image(s). Don't forget to #include your new header file in pov.c!





2010-08-31: Added ability to read in large images and resize based on user preferences.
Here is an example image (original):
rifle - orig

And here is the glyph generated by glyphgen:
rifle - glyph
(A couple of pixels were tweaked afterwards, but not much was done to it!)

Simple, high-contrast images will work best. Most imported photographs
won't be recognizable, but this is an example of one that works.