Icon Processor

by Forum_account
An easy way to generate and process icons.
ID:536314
 
I fixed a few bugs and added some more demos. Each new demo shows more uses for the IconProcessor object. There was a glitch with the icons created by the icon processors - for some reason their width and height would always be read as zero. I fixed this, which now lets you chain together icon processors to create a more complex, composite effect.

For example, there is a new animation demo which takes plain, non-animated states and generates an icon where each state is animated and just has the same original icon repeated for each frame. The resulting icon is passed to another icon processor which modifies the opacity of each icon to create a fade in animation. By changing the second step (or by adding more steps) you can easily create complex animations.

Here is the list of changes:
  • Fixed a bug with how the icon processor checked if a state/dir/frame existed. It checks by drawing on the icon and checking if the drawing succeeded, but it didn't properly undo this operation when it did succeed and it caused the bottom-left pixel of all output icons to be blank.
  • Added brightness-demo which shows how to adjust the brightness of an icon by raising each color component to a power. This works because each color component is between 0 and 1. Raising any value in this range to a positive power will also produce a number in this range.
  • Fixed a bug with the icons that were produced. They'd always return zero for their width and height which caused problems if you tried to chain icon processors together.
  • Added chaining-demo which shows how to create composite effects by using the output of one icon processor as the input to another.
  • Added the animation-demo to show how to generate animated icons from the sample input file.
I am getting the following errors when attempting to compile:
color.dm:30:error: int: undefined proc
color.dm:31:error: int: undefined proc
color.dm:32:error: int: undefined proc
color.dm:37:error: int: undefined proc
color.dm:38:error: int: undefined proc
color.dm:39:error: int: undefined proc
color.dm:40:error: int: undefined proc
icon-processor.dm:332:error: dir2txt: undefined proc

Am I missing a library it needs?