Creating and reading images from an E100 program

This web page describes how to create images and read them from an E100 program.

First, create the source image. You may use any program to create the source image, e.g., Linux programs kolourpaint or gimp. kiconedit works well for drawing small low-resolution images (e.g., fonts). After you have created the source image, save it as a 24-bit truecolor image, preferably in a non-compressed format (e.g., PNG). Truecolor images represent color as a 24-bit value (8 bits each for red, green, and blue).

Next, you need to access the image data from your E100 program. There are two main ways for your E100 program to read the pixel color values for your image. For small images, your E100 program can include an array of E100 assembly-language .data lines. For large images, E100 memory is not big enough to store all the pixel color values, so your E100 program will need to read the image data from an SD card. (For monochromatic images such as fonts, you can save space by storing on/off values for 32 pixels in a single word.)

To help you access the image from an E100 program, we provide a Matlab function color100. color100 reads a source image and outputs the color value of each pixel to two files: a binary file (suitable for an SD card) and an E100 assembly file. Each word in the output is a proper VGA color for the E100, so it can be sent directly to vga_color_write. The output starts at the upper left of the image and sweeps across a row, then goes to the next row, eventually reaching the lower right corner of the image.