140 likes | 229 Views
The CILY Programming Language. Exactly What the World Needed. Why Use CILY?. One can perform basic to advanced image manipulation operations using an iterative language (no GUI needed) Very safe, robust and easy to use It’s works cross-platform
E N D
The CILY Programming Language Exactly What the World Needed
Why Use CILY? • One can perform basic to advanced image manipulation operations using an iterative language (no GUI needed) • Very safe, robust and easy to use • It’s works cross-platform • Unlike Photoshop and Dreamweaver, CILY is FREE!
Basic CILY Features • Loading and saving images (or entire directory of images) for manipulation • Selecting rectangle or oval of pixels • Resizing, rotating, flipping, blurring, sharpening, brightening, cropping, inverting, edge detecting, and converting to grayscale
More Advanced Features • Getting and setting pixel values of an image • Magic wand selection of pixels • Creating a web album from a directory of images
CILY Example: Batch Image Sharpening • CILY source code is as follows: main(){ array Image[] imgs = OpenDir(“c:\”); foreach i in imgs { Sharpen(i); Save(i); }}
Example CILY Syntax function void ConvertToColor(Pixel p, Color c) { p->color = c; return; } main() { var Image i = Open("images_original/earth.jpg"); var Color black = Color(0,0,0); var Color darkRed = Color(130, 25, 25); ConvertToGrayScale(i); array Pixel[] pixels = MagicWand(i, Color(0, 0, 0), 10); foreach j in pixels { ConvertToColor(pixels[j], darkRed); } Paste(i, pixels); SaveAs(i, "earthgray.jpg"); }
Control Structures • Expressions var int a = foo() + 3 * (a + b); • Loops foreach i in imgs { print(imgs[i]->filename);} • Functions function void foo() { return; } • Library objects and functions Brighten(image);Color c = Color(255,255,0);
Compiling CILY Programs Lexer/Parser Tree Parser CILY Program Error Checker Code Gen Syntax Errors Semantic Errors Java program
Generated Code • Compiler takes CILY program and generates an analogous Java program. • Java program compiled and run using J2E 1.4.01 • Java runtime used to run the program.
Photo Album Creator • Create photo albums with a call to one CILY library function • Different album styles available
Testing • Automated test suite to run regression tests after every major grammar change. Syntax error checking automatically checked • Semantic error checking was done partially automatically, partially manually. • Took a few days to implement, but saved us a lot of valuable time down the stretch
Lessons Learned • Peer Programming VERY valuable • Learned how to “move on” when little errors kept us from shipping. • Diff people testing vs. coding • Learn to trust your group • Learn to like your group