Title: The CILY Programming Language
1The CILY Programming Language
- Exactly What the World Needed
2Why 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
- Its works cross-platform
- Unlike Photoshop and Dreamweaver, CILY is FREE!
3Basic 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
4More Advanced Features
- Getting and setting pixel values of an image
- Magic wand selection of pixels
- Creating a web album from a directory of images
5CILY Example Batch Image Sharpening
- CILY source code is as follows
- main() array Image imgs
OpenDir(c\) foreach i in imgs
Sharpen(i) Save(i)
6Example CILY Syntax
- function void ConvertToColor(Pixel p, Color c)
- p-gtcolor 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(pixelsj, darkRed)
-
- Paste(i, pixels)
- SaveAs(i, "earthgray.jpg")
7Output of Previous Example
8Control Structures
- Expressions
- var int a foo() 3 (a b)
- Loops
- foreach i in imgs print(imgsi-gtfilename)
- Functions
- function void foo() return
- Library objects and functions
- Brighten(image)Color c Color(255,255,0)
9Compiling CILY Programs
main() var Image i Open(blah.jpg)
Blur(i)
Syntax error at line 1 token unexpected .
import java.io. public class test2 public
static void main(String args) try
CILYImage i CILYLibrary.Open("blah.jpg")
CILYLibrary.Blur(i) catch
(ArrayIndexOutOfBoundsException aioobe)
System.err.println("RUNTIME ERROR Array index
out of bounds") catch (Exception e)
System.err.println("RUNTIME ERROR Unable
to read or write to file")
Error at line 2 a not declared
10Compiling CILY Programs
Lexer/Parser
Tree Parser
CILY Program
Error Checker
Code Gen
Syntax Errors
Semantic Errors
Java program
11Generated 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.
12Some examples of what CILY can do
13Photo Album Creator
- Create photo albums with a call to one CILY
library function - Different album styles available
14Testing
- 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
15Lessons 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