MagicEye

0.02

MagicEye graphic effect implemetation library.

Introduction

MagicEye is a graphical effect: it is a circular ring of coloured pixels that can be rotated in any way. I called it MagicEye becose it recalls in some way to old magic eye tubes used in radio receivers.

A single MagicEye can be made by a number of rings, each ring is the projection of a linear array of pixels in a circular shape, changing the pixels color in the linear array involve changing the colors in the circular ring. A single MagicEye can be made by more the one ring, in this case the MagicEye is the projection of a rectangular array of pixels: all rings have the same number of sectors, this means all linear arrays have the same size, resulting in a rectangular array with one line for each ring.

The linear size (aka the number of sectors in a ring) can be choosen in any way, there are no constraints in choosing the linear array size but some dimensions should be better than others.

All the rings of one MagicEye are parts of the MagicEye itself and there is no way to separate them, the whole MagicEye is drawn in an SDL_Surface by calling the MagicEye_Perspection() function, this is the product of this library; in this way it can be integrated in any application that makes use of SDL library.

How to create a magic eye

A MagicEye is a projection form a rectangular array of pixels to a circual shape, so to begin you have to choose the horizontal size of this array, this will be refenced to as linear array. The horizontal axis of the linear array corresponds to the ring itself: the first pixel on the left of the linear array is placed on the top of the ring turning to the right while moving in the right direction in the linear axis. The first pixel on the left of the linear array and the last on the right are in contact in the ring and both are placed to the top of the ring.

Choosing the linear horizontal axis size means to choose how may secotors we have in a ring, or if you whish, how many pixels we have in a single ring.

After that we have to choose how may rings we want in the MagicEye, the size of rectangular array of pixels is then completely defined.

To speed up MagicEye calculation the full projection is calculated off line, the whole projection is an array of horizontal segments that maps each pixel in the SDL_Surface to a pixel in the linear array; becose it is calculated off line it is not possible to alter the rings run time.

The MagicEye map is created by eyemake, a little utility included in the source tree (see eyemake Makefile for more information on calling eyemake).

Lisence

MagicEye is released under LGPL lisence (see COPYING and COPYING.LESSER).

Generated on Mon Apr 24 09:50:26 2017 for libmagiceye by  doxygen 1.5.6