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

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

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

The Warhol Language Reference Manual

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

Language Reference Manual

PieNum Language Reference Manual


Full file at C How to Program, 6/e Multiple Choice Test Bank

Twister: Language Reference Manual

YOLOP Language Reference Manual

Simple Java Reference

BASIC ELEMENTS OF A COMPUTER PROGRAM

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

JME Language Reference Manual

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

Language Reference Manual simplicity

Typescript on LLVM Language Reference Manual

MATLIP: MATLAB-Like Language for Image Processing

SECTION II: LANGUAGE BASICS

Language Reference Manual

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

Lecture 2. Examples of Software. Programming and Data Structure. Programming Languages. Operating Systems. Sudeshna Sarkar

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

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

The SPL Programming Language Reference Manual

9/5/2018. Overview. The C Programming Language. Transitioning to C from Python. Why C? Hello, world! Programming in C

CSC Web Programming. Introduction to JavaScript

The C Programming Language. (with material from Dr. Bin Ren, William & Mary Computer Science)

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

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Introduction to Programming Using Java (98-388)

Chapter 2: Using Data

Standard File Pointers

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Chapter 2. Lexical Elements & Operators

VLC : Language Reference Manual

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University

GridLang: Grid Based Game Development Language Language Reference Manual. Programming Language and Translators - Spring 2017 Prof.

Functions. Arash Rafiey. September 26, 2017

C++ basics Getting started with, and Data Types.

COMS W4115 Programming Languages & Translators GIRAPHE. Language Reference Manual

La Mesa Language Reference Manual COMS 4115: Programming Languages and Translators Professor Stephen Edwards

AN OVERVIEW OF C. CSE 130: Introduction to Programming in C Stony Brook University

Introduction to C Language

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

Overview of C, Part 2. CSE 130: Introduction to Programming in C Stony Brook University

C: How to Program. Week /Mar/05

Operators. Java operators are classified into three categories:

Reserved Words and Identifiers

DATA STRUCTURES USING C

H192 Midterm 1 Review. Tom Zajdel

CS113: Lecture 3. Topics: Variables. Data types. Arithmetic and Bitwise Operators. Order of Evaluation

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

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

Should you know scanf and printf?

ASML Language Reference Manual

GOLD Language Reference Manual

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

Key Differences Between Python and Java

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

The Arithmetic Operators

gcc hello.c a.out Hello, world gcc -o hello hello.c hello Hello, world

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

easel Manager Danielle Crosswell dac2182 Language Guru Tyrus Cukavac thc2125 System Architect Yuan-Chao Chou yc3211 Tester Xiaofei Chen xc2364

VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals

Chapter 2 - Introduction to C Programming

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

SIPL: Simple Image Processing Language

Course Outline. Introduction to java

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

Decaf Language Reference

Chapter 2: Introduction to C++

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

SSOL Language Reference Manual

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

These are reserved words of the C language. For example int, float, if, else, for, while etc.

easel LANGUAGE REFERENCE MANUAL

Stream Model of I/O. Basic I/O in C

Variables. Store information needed by the program

DEPARTMENT OF MATHS, MJ COLLEGE

CS112 Lecture: Primitive Types, Operators, Strings

for (i=1; i<=100000; i++) { x = sqrt (y); // square root function cout << x+i << endl; }

1. What type of error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d.

Arithmetic Expressions in C

Array. Prepared By - Rifat Shahriyar

Java+- Language Reference Manual

Cellular Automata Language (CAL) Language Reference Manual

Introduction to AEL. Introduction to AEL. General AEL Structure. Language Specifics

Computer System and programming in C

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

Floating-point lab deadline moved until Wednesday Today: characters, strings, scanf Characters, strings, scanf questions clicker questions

SEAMScript Language Reference Manual. Sean Inouye (si2281) Edmund Qiu (ejq2106) Akira Baruah (akb2158) Maclyn Brandwein (mgb2163)

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

IT441. Network Services Administration. Perl: File Handles

Chapter 2: Basic Elements of C++

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

Transcription:

pixelman Pixel Manipulation Language Anthony Chan tc2665 Teresa Choe tc2716 Gabriel Lucas Kramer-Garcia glk2110 Brian Tsau bt2420 1. Introduction/Rationale pixelman is a programming language that can be used to manipulate pixels to edit files. When brainstorming for our programming language, we thought about specific problems our language could be used to solve. In the case of processing, we thought about how to manipulate pixels through functions; for example, by applying a convolution matrix to pixels, we could sharpen or blur an. By allowing users to include their own tools to perform these operations, we allow them to create powerful processing programs. 2. Project Description pixelman will provide tools to load/write s to/from a filesystem, I/O operations with stdin and stdout, and manipulation functions. Compiled code will be translated into LLVM. Our most powerful feature will be the pixel transformation tool, which will take in a function that takes in a pixel and outputs a pixel, and can be used to perform a variety of manipulations. 3. Language Features A. Data Types Primitive data type int float string Description 32-bit signed integer 32-bit floating point List of characters enclosed in double quotes 1

null true/false null B. Conditionals Conditional Syntax Description if, else, else if if(expr) { else if { else { Executes block of code if condition is met. for for(int i = 0;i < 8;i=i+1) { Loops until condition (i < 8) is met. while while(expr) { Loops while expression evaluates to true. C. Operations Operator Syntax Description Return Type = a = b Assigns variable to expression of same type (or ints to floats) + a + b Addition, if an argument is a float will return float - a - b Subtraction, if an argument is a float will return float * a * b Multiplication, if an argument is a float will return float / a / b If both arguments are Type of a 2

integers, will perform integer division; else floating point division % a % b Modulus Operator. Returns remainder of a/b. a and b must both be ints. == a == b Checks to see if variables are equal to each other!= a!= b Checks to see if variables are not equal to each other >= a >= b Checks to see if argument on the left side is greater than or equal to argument on right <= a <= b Checks to see if argument on the left side is greater than or equal to argument on right int!!a Boolean NOT && a && b Boolean AND a b Boolean OR 3

<< a << b Left bit shift, b must be an integer >> a >> b Right bit shift, b must be an integer type of a type of a D. Syntax pixelman will have a similar syntax and aesthetic to Java, and functions will be treated the same way as variables (as in Python). pixelman is strongly typed, and in function declarations, argument and return types must match up at compilation time. 1. Complete statements Semicolons will be used to declare the end of a statement 2. Comments There will only be single line comments, // 3. Blocks of code Blocks of code will begin with a { and end with a 4. Function declaration Functions will be declared def type functionname(arguments) {code. A main function is necessary for execution of code. 5. Whitespace All whitespace and newlines will be processed out and used to separate tokens 6. Reserved Keywords return, def, main, all data types 7. Code Example def int greyscale(string file_name) { if( im = load(filename) == null) { perror( original did not load ); printf( original : ); display(im); 4

for(int i = 0; i < size(im); i++) { for(int j = 0; j < size (im[i]); j++) { int[] rgb = im[i][j].rgb; // Calculates grayscale by calculating the average int grey = (rgb[0] + rgb[1] + rgb[2])/3; im[i][j].rgb = int[3]{grey, grey, grey; printf( grayscale : ); display(im); def int main(args, argv) { string file_name = admin/.jpg ; greyscale(file_name); E. Data Structures Data Structure Syntax Description List int[3] arr = {1, 2, 3; arr[0] = 0; Mutable data structure holding multiple blocks of information of the same type Pixel pixel pix = pixel(r, g, b) Data structure with list of three integer values (RGB) capped in the range of 0-255, and two integers (x, y) coordinates 5

Image im = load(file_path) im. Contains a height width list of pixels F. Built in Library Function Arguments Description Return Type printf string format,... Prints to stdout, using a similar model to C On success: # characters written scanf string buffer Scan from stdin On success: # characters scanned size list arr Gets length of list On success: int load string file_path Loads from file On success: On failure: null write string file_path, Will write to file On success: 0 display im Shows without saving On success: 0 resize im, int w, int h Resize to new size w h On success: On failure: null transform im, function process Performs an operation defined by the user in function on each pixel in, and creates a new On success: On failure: null 6

7