PIXL. Maxwell Hu (mh3289) Justin Borczuk (jnb2135) Marco Starger (mes2312) Shiv Sakhuja (ss4757)

Similar documents
The Warhol Language Reference Manual

pixelman Pixel Manipulation Language Anthony Chan tc2665 Teresa Choe tc2716 Gabriel Lucas Kramer-Garcia glk2110 Brian Tsau bt2420

PieNum Language Reference Manual

An Introduction to MATLAB

Angela Z: A Language that facilitate the Matrix wise operations Language Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

NumNum Language Proposal 1. COMS 4115: NumNum Language Proposal. Programming Languages and Translators. COMS 4115 W Section 1. Prof.

MATLIP: MATLAB-Like Language for Image Processing

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Chapter 2: Using Data

Concepts Review. 2. A program is the implementation of an algorithm in a particular computer language, like C and C++.

Twister: Language Reference Manual

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators

Introduction to Programming Using Java (98-388)

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Getting started with Java

VARIABLES & ASSIGNMENTS

C++ Basics. Data Processing Course, I. Hrivnacova, IPN Orsay

9/10/10. Arithmetic Operators. Today. Assigning floats to ints. Arithmetic Operators & Expressions. What do you think is the output?

CS313D: ADVANCED PROGRAMMING LANGUAGE

3. Except for strings, double quotes, identifiers, and keywords, C++ ignores all white space.

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Lecture 3 Tao Wang 1

SECTION II: LANGUAGE BASICS

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

Values, Variables, Types & Arithmetic Expressions. Agenda

4. Inputting data or messages to a function is called passing data to the function.

MA 511: Computer Programming Lecture 3: Partha Sarathi Mandal

Chapter Two MIPS Arithmetic

DaMPL. Language Reference Manual. Henrique Grando

Cellular Automata Language (CAL) Language Reference Manual

Loops. CSE 114, Computer Science 1 Stony Brook University

Photogram. Programmable Photoshop Language Language Reference Manual. ( ), Group Leader. (

BASIC ELEMENTS OF A COMPUTER PROGRAM

Lecture 2 Tao Wang 1

egrapher Language Reference Manual

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Programming in C++ 5. Integral data types

StudyHub+ 1. StudyHub: AP Java. Semester One Final Review

Building Java Programs

Chapter 4: Basic C Operators

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

YOLOP Language Reference Manual

Ex: If you use a program to record sales, you will want to remember data:

FRAC: Language Reference Manual

CS4120/4121/5120/5121 Spring 2016 Xi Language Specification Cornell University Version of May 11, 2016

CS 376b Computer Vision

Building Java Programs

function [s p] = sumprod (f, g)

Operators in java Operator operands.

Onion Language Reference Manual. By: Andrew Aday, (aza2112) Amol Kapoor (ajk2227), Jonathan Zhang (jz2814)

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Declaration and Memory

Computational Expression

2/5/2018. Expressions are Used to Perform Calculations. ECE 220: Computer Systems & Programming. Our Class Focuses on Four Types of Operator in C

Computer Components. Software{ User Programs. Operating System. Hardware

Data types Expressions Variables Assignment. COMP1400 Week 2

The Lorax Programming Language

Fundamentals of Programming CS-110. Lecture 2

Sketchpad Graphics Language Reference Manual. Zhongyu Wang, zw2259 Yichen Liu, yl2904 Yan Peng, yp2321

Chapter 4. Operations on Data

Unit 3. Operators. School of Science and Technology INTRODUCTION

Introduction to Computer Programming

More on Images and Matlab

The pixelman Language Reference Manual. Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau

Operators. Java operators are classified into three categories:

C# and Java. C# and Java are both modern object-oriented languages

Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition

Crayon (.cry) Language Reference Manual. Naman Agrawal (na2603) Vaidehi Dalmia (vd2302) Ganesh Ravichandran (gr2483) David Smart (ds3361)

More Things We Can Do With It! Overview. Circle Calculations. πr 2. π = More operators and expression types More statements

Chapter 01 Arrays Prepared By: Dr. Murad Magableh 2013

Operators & Expressions

JME Language Reference Manual

Lecture 6. Assignments. Summary - Variables. Summary Program Parts 1/29/18. Reading: 3.1, 3.2, 3.3, 3.4

Data Types, Variables and Arrays. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Logical and Bitwise Expressions

Object-Oriented Programming

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s

Quick Reference Guide

Building Java Programs

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

corgi Language Reference Manual COMS W4115

Announcements. Lab Friday, 1-2:30 and 3-4:30 in Boot your laptop and start Forte, if you brought your laptop

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

Selenium Class 9 - Java Operators

EZ- ASCII: Language Reference Manual

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Practice Midterm 1. Problem Points Score TOTAL 50

Java Basic Datatypees

Java Programming: Guided Learning with Early Objects Chapter 5 Control Structures II: Repetition

Language Reference Manual

Lecture 3. More About C

Units 0 to 4 Groovy: Introduction upto Arrays Revision Guide

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

Chapter 6: Using Arrays

MR Language Reference Manual. Siyang Dai (sd2694) Jinxiong Tan (jt2649) Zhi Zhang (zz2219) Zeyang Yu (zy2156) Shuai Yuan (sy2420)

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence

Transcription:

PIXL Maxwell Hu (mh3289) Justin Borczuk (jnb2135) Marco Starger (mes2312) Shiv Sakhuja (ss4757) Description Point processing is the enhancement or modification of an image through individual pixel manipulation. PIXL is a Java-like language that utilizes the pixel as a primitive type in order to more easily process images and apply various filters to image signals. Individual pixels can be added to one another, subtracted from one another, and negated, while pixel arrays can also be added, subtracted, and negated, as well as masked, intersected, blurred, sharpened, and antialiased, among other transformations. In order to easily work with image files, PIXL has file I/O capabilities. More importantly, an image file can be easily loaded into a pixel matrix in order to process the image signal. A pixel matrix can also easily be written into a file for export. For custom transformations that are not defined in the language, PIXL includes special loops that can easily loop through all the pixels of an image in order to apply a common function to each pixel, and can do this for multiple images as well for functions that manipulate images based on another image s pixel values. Data Types Data Type Documentation Declaration int Integer value int x = 10; float Floating point value float x = 10.0; File A file File f = image.ppm ; String A string String s = hello ; pixel Length 4 tuple (r,g,b,a) pixel x = (255,255,255,0.5);

boolean True/False Value boolean x = True; array List of data that is declared in a way similar to java; primarily for pixels pixel[ ] x = new pixel[5]; matrix 2d array pixel[ ][ ] x = new pixel[5][5]; Arithmetic and Logical Operators +, -, =, *, /, %, ++, --, ==,!=, &&,, <, >, <=, >=,! Comments begin with // Multi-line comments /* */ Semicolons (;) end a statement Pixel Operators Operator Description Example + + works the same way as Java. However, when adding two pixels together you add the corresponding r,g,b values in each pixel together to create a new tuple. If the sum of two corresponding values exceeds 255, then 255 is used as the sum value. + can also be used as an operand between two matrices of the same dimensions: the + operator is applied to each corresponding pixel pair and adds them using the pixel + operator. - Works the same way as addition, except you subtract the two tuples. Absolute value is used to avoid negative integers. - can also be used as an operation on matrices. Like addition, each corresponding pixel pair is subtracted. pixel x1 = (100,100,200,0.5) pixel x2 = (50,50,100,0.5) pixel x3 = x1 + x2 // x3: (150,150,255,0.5) pixel x1 = (100,100,200,0.5); pixel x2 = (50,50,100,0.5); pixel x3 = x1 - x2; // x3: (50,50,100,0.5) = The equals assignment operator sets pixel x = (100,50,100,0.5);

the value of the left variable equal to the value of the right side. == The equality check for pixels returns True if the pixels have the same rgba values, and False if any of the rgba values differ. pixel y = x; // y: (100,50,100,0.5) pixel x = (100,100,100,0.5); pixel y = (100,100,100,0.4); boolean b = x == y; // b: False && Logical AND is applied to two pixels in the following way: 1)If the pixels are the same, return the pixel. 2) If the pixels are different, return (0,0,0,0). The Logical AND operator can also be applied to two matrices. In this case, it takes corresponding pixel pairs in two matrices of the same size and applies the two rules above to output a third matrix. pixel x = (100,100,100,0.5); pixel y = (100,100,100,0.5); pixel z = x && y; // z: (100,100,100,0.5); Keywords Keywords if else else if for() Description if (cond) else else if (cond) for(int i=0; i<4; i++) for(pixel x, int i,j : pmatrix1) Enhanced for loop that makes traversing pixel arrays/matrices easy. The documentation on the left provides a way to loop through a pixel matrix left to right (when the end of a row is reached the loop moves one row down and repeats the process). The loop provides an i and j integer as indices.

Sample Code // Sets an image to grayscale for (pixel x, int i,j : p1) int avg = (x.getred() + x.getgreen() + x.getblue())/3; p1[i][j] = (avg, avg, avg, x.getalpha()); // Keeps only the common pixels of two images (AND) at the matrix level File f2 = image2.ppm ; pixel[][] p2 = f2.load(); pixel[][] out = p1 && p2; // Keeps only the common pixels of two images (AND) at an individual pixel level File f2 = image2.ppm ; pixel[][] p2 = f2.load(); pixel[][] p3 = p2.zero(); for (pixel x,y, int i,j : p1,p2) p3[i][j] = x && y; // Negates an image

for (pixel x, int i,j : p1) p1[i][j] = (255-x.getRed(),255-x.getGreen(),255-x.getRed(), x.getalpha());