Saturday, November 13, 2004

New horizon

After taking some inspiration from the wonderful pixelart drawing program GraFX2 and having come to terms with the lackings of the drawing tools of pixelate, I've decided to develop my own graphics primives, in the following manner:

  • There will be two fundamental types of primitives, 1D and 2D I call them for technical reasons
  • 1D are for eg. the line, pencil, outlined rectangle and outlined ellipsis tools
  • 2D are filled rectangle & filled ellipsis
On the technical side, 1D tools will be completely independent of the specific surface type and such - they will only output a sequence of absolute coordinates given a set of parameters, specific for each 1D tool, ie. they are "purely" geometric. That way, I can save the underlying pixels in the caller - instead of as pixelate does it right now, save the whole underlying surface (slow!). Then, when the user releases the mouse button, the actual "pixel" he is using for the moment - be it a 1x1 color pixel or 5x5 rectangle, or even an air brush, is drawn at every coordinate given from the tool.

On the other hand, 2D tools will use 1x1 pixel outlines while the user is dragging, and fill it in upon release, a la GraFX2.

As I've been thinking about software engineer -- experiencing the last weeks' "brownout" -- I've formulated a little mantra to follow:

  • Software systems could be viewed as directed graphs (digraphs) with an arrow from one software "component" A to another B, if A depends on B
  • In pixelate, the graph would at the moment not be acycling ie. it would not be a tree structure, because of interdependence, edges, all over the place
  • Mantra: any software components complexity or engineering weight is proportional to the number of edges leaving it (the number of dependencies it has). Cycles in the system graph are evil. (Some voice in the back of my head tells me a system with a tree graph is called cybernetic..?)
/Olof

0 Comments:

Post a Comment

<< Home