CpSc 101, Fall 2015 Lab7: Image File Creation

Size: px
Start display at page:

Download "CpSc 101, Fall 2015 Lab7: Image File Creation"

Transcription

1 CpSc 101, Fall 2015 Lab7: Image File Creation Goals Construct a C language program that will produce images of the flags of Poland, Netherland, and Italy. Image files Images (e.g. digital photos) consist of a rectangular array of discrete picture elements called pixels. An image consisting of 200 rows of 300 columns (or pixels per row) contains 300 x 200 = 60,000 individual pixels. The height of the image in pixels is the number of pixel rows, and the width is the number of columns, or pixels in each row. A color image requires 3 bytes per pixel or 180,000 total bytes! The Portable PixMap (.ppm) format is a particularly simple way used to encode a rectangular image (picture) as uncompressed data file. Other well known formats include JPEG (.jpg), TIFF (.tif), GIF (.gif), bitmap (.bmp), and PNG (.png) The.ppm file can viewed with a number of tools including display and gimp. MS Windows systems have no built-in.ppm viewer. Several freeware viewers are available on the web though. See ( for downloading gimp onto your own laptop. You ll see a link for use on a Mac at the top of that page. For Windows, click on Show Other Downloads, which is about 1/3 of the way down (right below Fink ). Another image viewer/editor is irfanview, though there is no version for Macs. See ( for more information.

2 PPM file format ppm files: ppm is a very simple image file format. A ppm image consists of two components: 1. The header: the header contains 1) a label to identify the file format as a color ppm file ("P6"), 2) the width of the image in pixels, 3) the height of the image in pixels and 4) the maximum pixel value (always 255). 5) the header ends with a single \n newline character 2. Binary image data: the data consists of unsigned char (eight-bits == one-byte) binary values defining the color of each pixel. Example ppm header: The header of a color image of 800 pixels wide and 600 pixels high has the following format: P Then the very next line after the 255 is where the pixel data begins. You can open the.ppm file using vim or some other editor, and you ll be able to see and makes sense of the header; but since the pixel data is binary, the rest of the file after the header will look like a bunch of weird, unreadable characters. Pixel data format: each pixel consists of 3 one-byte values of type unsigned char the first three bytes of image data in the.ppm file define the color of the pixel in the upper left corner of the image the last three bytes in the file define the color of the pixel in the lower right pixel values defining each horizontal row of the image are adjacent NO spaces, tabs, newlines may be embedded in the file.

3 red/green/blue image encoding this format is called RGB. The three bytes of each pixel represent the color intensities of the: red component green component blue component (255, 0, 0) is bright red (0, 255, 0) is bright green (0, 0, 255) is bright blue Colors are additive (255, 255, 0) = red + green = bright yellow (255, 0, 255) = red + blue = magenta (purple) (0, 255, 255) = blue + green = cyan (turquoise) (255, 255, 255) = red + green + blue = white when red == green == blue (lower than 255), a gray color is produced; for example, (25, 25, 25) would be a light shade of gray, and (200, 200, 200) would be a darker shade of gray Writing a pixel value The %c format code tells fprintf() NOT to convert the value being printed to ASCII format. Since pixel values are binary, the %c code must be used. The following statement can be used to write a red pixel: fprintf(stdout, "%c%c%c", 255, 0, 0); NO spaces or newlines are permitted in the format string!!

4 Assignment Write a program called lab7.c that is capable of creating an image of the flags of Poland, Netherland, and Italy. Two integer values should be read from the standard input: country_code: 0 - Poland 1 - Netherland 2 - Italy width: The width of the flag in pixels. You should use the proper colors as defined in Wikipedia based upon a google search for "Flag of Poland", etc. Google rgb colors to find the r, g, & b values for each color that you will need for the above flags. You should use the proper ratio of height to width as specified by proportion in Wikipedia to compute the height of the image you produce. Poland: (RGB: white (255, 255, 255), red (255, 0, 0)) Netherland: Italy: Use the make_pixel() function provided below: void make_pixel ( int r, // red intensity int g, // green intensity int b ) // blue intensity { fprintf(stdout, "%c%c%c", r, g, b); } Use the make_ppm_header() function provided below: void make_ppm_header (int width, int height) { fprintf(stdout, "P6\n"); fprintf(stdout, "%d %d %d\n", width, height, 255); }

5 Use the following main() function. #include <stdio.h> int main() { int width; int country_code; // prompt user to enter width and country_code of chosen flag /* Read image dimensions and pixel color */ fscanf(stdin, "%d %d", &country_code, &width); fprintf(stderr, "Making country %d with width %d \n", country_code, width); /* Write the image data */ make_ppm_image(country_code, width); } return(0); You will need to write the function make_ppm_image(country_code, width) to create the chosen flag. You can do this one of two ways: 1. use an if-else, or switch, statement based on the country code and put the code to create the flags within each part of the if-else (or switch) 2. use an if-else, or switch, statement to call one of 3 other functions depending on which country code was sent in (this is preferable because this keeps the make_ppm_image() function smaller by breaking each task up and putting the code for each flag into other separate, smaller functions) Whichever way you choose to do it, work on the Poland one first (because it is the easier one of the three); make sure it works before continuing on to Netherland s flag; make sure that one works, then do the last one. You should always break up your programs into small parts, doing each one incrementally, compiling in between each step before continuing on to the next step.

6 Producing and viewing the image 1. Write the C program to produce the image. In your program, you will have statements to write the header information. You are provided with the function HINTS: called make_ppm_header() which will write the header information to stdout. 2. Then your program will include statements to write the r, g, b pixel data to the file. You are provided with the function called make_pixel() to which you will send the r, g, b values. This function will be called from another function that you will be writing. 3. Don t forget to put all your prototypes at the top of your lab7.c file underneath the #include statement(s). 4. You will compile your program as you normally compile C programs: gcc -Wall -g lab7.c 5. When you run the program, you will redirect the output to a specified ppm filename. For example, if you are going to test the Poland flag, you would type the following:./a.out > poland.ppm 6. You will be prompted to enter the width and the country code for the flag, and then the.ppm file will be created. 7. To view the image, you can use one of the methods mentioned above on page 1. You will probably end up using nested for loops. You may utilize whatever lecture notes were provided to you. There are different ways of producing the images. For example: some lecture notes show examples of the nested for loops to control the rows and columns (the outer for loop is for each row; and the inner for loop(s) produce the pixels along the row). Other notes may show examples of using the modulus operator with an if statement to determine the row/column that you are currently looking at. Either approach is fine. Your program should compile WITHOUT warnings with gcc -Wall -g lab7.c Turn In Work Show your TA that you completed the assignment. Then turn in your lab7.c program using the handin page at

Representation of image data

Representation of image data Representation of image data Images (e.g. digital photos) consist of a rectanglular array of discrete picture elements called pixels. An image consisting of 200 pixels rows of 300 pixels per row contains

More information

CpSc 1111 Lab 4 Formatting and Flow Control

CpSc 1111 Lab 4 Formatting and Flow Control CpSc 1111 Lab 4 Formatting and Flow Control Overview By the end of the lab, you will be able to: use fscanf() to accept a character input from the user and print out the ASCII decimal, octal, and hexadecimal

More information

CpSc 1111 Lab 5 Formatting and Flow Control

CpSc 1111 Lab 5 Formatting and Flow Control CpSc 1111 Lab 5 Formatting and Flow Control Overview By the end of the lab, you will be able to: use fscanf() to accept a character input from the user execute a basic block iteratively using loops to

More information

CpSc 111 Lab 3 Integer Variables, Mathematical Operations, & Redirection

CpSc 111 Lab 3 Integer Variables, Mathematical Operations, & Redirection CpSc 111 Lab 3 Integer Variables, Mathematical Operations, & Redirection Overview By the end of the lab, you will be able to: declare variables perform basic arithmetic operations on integer variables

More information

CpSc 1010, Fall 2014 Lab 10: Command-Line Parameters (Week of 10/27/2014)

CpSc 1010, Fall 2014 Lab 10: Command-Line Parameters (Week of 10/27/2014) CpSc 1010, Fall 2014 Lab 10: Command-Line Parameters (Week of 10/27/2014) Goals Demonstrate proficiency in the use of the switch construct and in processing parameter data passed to a program via the command

More information

CpSc 1011 Lab 3 Integer Variables, Mathematical Operations, & Redirection

CpSc 1011 Lab 3 Integer Variables, Mathematical Operations, & Redirection CpSc 1011 Lab 3 Integer Variables, Mathematical Operations, & Redirection Overview By the end of the lab, you will be able to: declare variables perform basic arithmetic operations on integer variables

More information

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting Your factors.c and multtable.c files are due by Wednesday, 11:59 pm, to be submitted on the SoC handin page at http://handin.cs.clemson.edu.

More information

Graphics Overview ECE2893. Lecture 19. ECE2893 Graphics Overview Spring / 15

Graphics Overview ECE2893. Lecture 19. ECE2893 Graphics Overview Spring / 15 Graphics Overview ECE2893 Lecture 19 ECE2893 Graphics Overview Spring 2011 1 / 15 Graphical Displays 1 Virtually all modern computers use a full color Graphical Display device. 2 It displays images, text,

More information

CpSc 1111 Lab 9 2-D Arrays

CpSc 1111 Lab 9 2-D Arrays CpSc 1111 Lab 9 2-D Arrays Overview This week, you will gain some experience with 2-dimensional arrays, using loops to do the following: initialize a 2-D array with data from an input file print out the

More information

Color Customer Display

Color Customer Display Utiliy Color Customer Display Color Customer Display Utility Manual CONTENT GENERAL MANUAL... 2 SEARCH COM PORT... 2 UTILITY GENERAL INTERFACE... 2 BASIC CONNECTION WITH CUSTOMER DISPLAY... 3 BASIC SETTING...

More information

CpSc 1011 Lab 4 Formatting and Flow Control Windchill Temps

CpSc 1011 Lab 4 Formatting and Flow Control Windchill Temps CpSc 1011 Lab 4 Formatting and Flow Control Windchill Temps Overview By the end of the lab, you will be able to: use fscanf() to accept inputs from the user and use fprint() for print statements to the

More information

Week 5: Files and Streams

Week 5: Files and Streams CS319: Scientific Computing (with C++) Week 5: and Streams 9am, Tuesday, 12 February 2019 1 Labs and stuff 2 ifstream and ofstream close a file open a file Reading from the file 3 Portable Bitmap Format

More information

CpSc 1011 Lab 5 Conditional Statements, Loops, ASCII code, and Redirecting Input Characters and Hurricanes

CpSc 1011 Lab 5 Conditional Statements, Loops, ASCII code, and Redirecting Input Characters and Hurricanes CpSc 1011 Lab 5 Conditional Statements, Loops, ASCII code, and Redirecting Input Characters and Hurricanes Overview For this lab, you will use: one or more of the conditional statements explained below

More information

Programming Project 1

Programming Project 1 Programming Project 1 Handout 6 CSCI 134: Fall, 2016 Guidelines A programming project is a laboratory that you complete on your own, without the help of others. It is a form of take-home exam. You may

More information

CpSc 111 Lab 5 Conditional Statements, Loops, the Math Library, and Redirecting Input

CpSc 111 Lab 5 Conditional Statements, Loops, the Math Library, and Redirecting Input CpSc Lab 5 Conditional Statements, Loops, the Math Library, and Redirecting Input Overview For this lab, you will use: one or more of the conditional statements explained below scanf() or fscanf() to read

More information

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm 15-123 Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm The Assignment Summary: In this assignment we are planning to manipulate

More information

An Introduction to Video Compression in C/C++ Fore June

An Introduction to Video Compression in C/C++ Fore June 1 An Introduction to Video Compression in C/C++ Fore June 1 Chapter 1 Image and Video Storage Formats There are a lot of proprietary image and video file formats, each with clear strengths and weaknesses.

More information

Setting Up the Fotosizer Software

Setting Up the Fotosizer Software Setting Up the Fotosizer Software N.B. Fotosizer does not change your original files it just makes copies of them that have been resized and renamed. It is these copies you need to use on your website.

More information

255, 255, 0 0, 255, 255 XHTML:

255, 255, 0 0, 255, 255 XHTML: Colour Concepts How Colours are Displayed FIG-5.1 Have you looked closely at your television screen recently? It's in full colour, showing every colour and shade that your eye is capable of seeing. And

More information

CP SC 4040/6040 Computer Graphics Images. Joshua Levine

CP SC 4040/6040 Computer Graphics Images. Joshua Levine CP SC 4040/6040 Computer Graphics Images Joshua Levine levinej@clemson.edu Lecture 03 File Formats Aug. 27, 2015 Agenda pa01 - Due Tues. 9/8 at 11:59pm More info: http://people.cs.clemson.edu/ ~levinej/courses/6040

More information

ECE 3331, Dr. Hebert, Summer-3, 2016 HW 11 Hardcopy HW due Tues 07/19 Program due Sunday 07/17. Problem 1. Section 10.6, Exercise 3.

ECE 3331, Dr. Hebert, Summer-3, 2016 HW 11 Hardcopy HW due Tues 07/19 Program due Sunday 07/17. Problem 1. Section 10.6, Exercise 3. ECE 3331, Dr. Hebert, Summer-3, 2016 HW 11 Hardcopy HW due Tues 07/19 Program due Sunday 07/17 Problem 1. Section 10.6, Exercise 3. Problem 2. Section 10.6, Exercise 5. Problem 3. Section 10.6, Exercise

More information

Lab 2.2. Out: 9 February 2005

Lab 2.2. Out: 9 February 2005 CS034 Intro to Systems Programming Doeppner & Van Hentenryck Lab 2.2 Out: 9 February 2005 What you ll learn. In this lab, you will practice much of what you did in Lab 2.1, but for a slightly more challenging

More information

Project #1 Seam Carving

Project #1 Seam Carving Project #1 Seam Carving Out: Fri, Jan 19 In: 1 Installing, Handing In, Demos, and Location of Documentation 1. To install, type cs016 install seamcarve into a shell in the directory in which you want the

More information

Introduction to Computer Science (I1100) Data Storage

Introduction to Computer Science (I1100) Data Storage Data Storage 145 Data types Data comes in different forms Data Numbers Text Audio Images Video 146 Data inside the computer All data types are transformed into a uniform representation when they are stored

More information

MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm.

MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm. MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm. This project is called Image Processing which will shrink an input image, convert a color

More information

COS 116 The Computational Universe Laboratory 10: Computer Graphics

COS 116 The Computational Universe Laboratory 10: Computer Graphics COS 116 The Computational Universe Laboratory 10: Computer Graphics As mentioned in lecture, computer graphics has four major parts: imaging, rendering, modeling, and animation. In this lab you will learn

More information

C introduction: part 1

C introduction: part 1 What is C? C is a compiled language that gives the programmer maximum control and efficiency 1. 1 https://computer.howstuffworks.com/c1.htm 2 / 26 3 / 26 Outline Basic file structure Main function Compilation

More information

CPSC 217 Assignment 3

CPSC 217 Assignment 3 CPSC 217 Assignment 3 Due: Monday November 26, 2018 at 12:00 noon Weight: 7% Sample Solution Length: Approximately 120 lines, including blank lines, lots of comments and the provided code Individual Work:

More information

BMP file format. Contents. Pixel storage. The BMP file format, sometimes called bitmap. or DIB file format (for device-independent

BMP file format. Contents. Pixel storage. The BMP file format, sometimes called bitmap. or DIB file format (for device-independent 1 of 7 BMP file format From Wikipedia, the free encyclopedia Windows Bitmap The BMP file format, sometimes called bitmap File extension:.bmp or.dib or DIB file format (for device-independent MIME type:

More information

This is not yellow. Image Files - Center for Graphics and Geometric Computing, Technion 2

This is not yellow. Image Files - Center for Graphics and Geometric Computing, Technion 2 1 Image Files This is not yellow Image Files - Center for Graphics and Geometric Computing, Technion 2 Common File Formats Need a standard to store images Raster data Photos Synthetic renderings Vector

More information

Day 1: Introduction to MATLAB and Colorizing Images CURIE Academy 2015: Computational Photography Sign-Off Sheet

Day 1: Introduction to MATLAB and Colorizing Images CURIE Academy 2015: Computational Photography Sign-Off Sheet Day 1: Introduction to MATLAB and Colorizing Images CURIE Academy 2015: Computational Photography Sign-Off Sheet NAME: NAME: Part 1.1 Part 1.2 Part 1.3 Part 2.1 Part 2.2 Part 3.1 Part 3.2 Sign-Off Milestone

More information

Bridging Graphics. Lori Scarlatos, January 2007

Bridging Graphics. Lori Scarlatos, January 2007 Bridging Graphics Lori Scarlatos January 2007 Introduction Computer graphics have one clear advantage over other types of programs: with computer graphics you can literally see whether your program is

More information

Chapter 3. Texture mapping. Learning Goals: Assignment Lab 3: Implement a single program, which fulfills the requirements:

Chapter 3. Texture mapping. Learning Goals: Assignment Lab 3: Implement a single program, which fulfills the requirements: Chapter 3 Texture mapping Learning Goals: 1. To understand texture mapping mechanisms in VRT 2. To import external textures and to create new textures 3. To manipulate and interact with textures 4. To

More information

Data Representation From 0s and 1s to images CPSC 101

Data Representation From 0s and 1s to images CPSC 101 Data Representation From 0s and 1s to images CPSC 101 Learning Goals After the Data Representation: Images unit, you will be able to: Recognize and translate between binary and decimal numbers Define bit,

More information

Manual Bitmap Fixture v

Manual Bitmap Fixture v Manual Bitmap Fixture v3.2.2.3 Paderborn, 25/05/2016 Contact: tech.support@malighting.com 1 Bitmap Fixture The MA Lighting Bitmap fixture replaces the previous bitmap effects. The bitmap fixture is a virtual

More information

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points Files to submit: 1. HW7.py THIS IS AN INDIVIDUAL ASSIGNMENT! You should work individually on this assignment.

More information

Common File Formats. Need a standard to store images Raster data Photos Synthetic renderings. Vector Graphic Illustrations Fonts

Common File Formats. Need a standard to store images Raster data Photos Synthetic renderings. Vector Graphic Illustrations Fonts 1 Image Files Common File Formats Need a standard to store images Raster data Photos Synthetic renderings Vector Graphic Illustrations Fonts Bitmap Format - Center for Graphics and Geometric Computing,

More information

Standard File Formats

Standard File Formats Standard File Formats Introduction:... 2 Text: TXT and RTF... 4 Grapics: BMP, GIF, JPG and PNG... 5 Audio: WAV and MP3... 8 Video: AVI and MPG... 11 Page 1 Introduction You can store many different types

More information

Slide Set 8. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng

Slide Set 8. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng Slide Set 8 for ENCM 339 Fall 2017 Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary October 2017 ENCM 339 Fall 2017 Section 01 Slide

More information

CS 315 Data Structures Fall Figure 1

CS 315 Data Structures Fall Figure 1 CS 315 Data Structures Fall 2012 Lab # 3 Image synthesis with EasyBMP Due: Sept 18, 2012 (by 23:55 PM) EasyBMP is a simple c++ package created with the following goals: easy inclusion in C++ projects,

More information

CSC 101: Lab Manual#11 Programming Turtle Graphics in Python Lab due date: 5:00pm, day after lab session

CSC 101: Lab Manual#11 Programming Turtle Graphics in Python Lab due date: 5:00pm, day after lab session CSC 101: Lab Manual#11 Programming Turtle Graphics in Python Lab due date: 5:00pm, day after lab session Purpose: The purpose of this lab is to get a little introduction to the process of computer programming

More information

SlickEdit Gadgets. SlickEdit Gadgets

SlickEdit Gadgets. SlickEdit Gadgets SlickEdit Gadgets As a programmer, one of the best feelings in the world is writing something that makes you want to call your programming buddies over and say, This is cool! Check this out. Sometimes

More information

Digital Signage Content Creation Guidelines

Digital Signage Content Creation Guidelines A NEW era of Digital Advertising 2017 Digital Signage Content Creation Guidelines DIGITAL BILLBOARD CONTENTS GUIDELINES & TIPS Introdution 01 Intro Maximize the Potential Text, graphics and backgrounds

More information

Lecture 8: Structs & File I/O

Lecture 8: Structs & File I/O ....... \ \ \ / / / / \ \ \ \ / \ / \ \ \ V /,----' / ^ \ \.--..--. / ^ \ `--- ----` / ^ \. ` > < / /_\ \. ` / /_\ \ / /_\ \ `--' \ /. \ `----. / \ \ '--' '--' / \ / \ \ / \ / / \ \ (_ ) \ (_ ) / / \ \

More information

ClipArt and Image Files

ClipArt and Image Files ClipArt and Image Files Chapter 4 Adding pictures and graphics to our document not only breaks the monotony of text it can help convey the message quickly. Objectives In this section you will learn how

More information

The following is a table that shows the storage requirements of each data type and format:

The following is a table that shows the storage requirements of each data type and format: Name: Sayed Mehdi Sajjadi Mohammadabadi CS5320 A1 1. I worked with imshow in MATLAB. It can be used with many parameters. It can handle many file types automatically. So, I don t need to be worried about

More information

CMPT 165 Graphics Part 2. Nov 3 rd, 2015

CMPT 165 Graphics Part 2. Nov 3 rd, 2015 CMPT 165 Graphics Part 2 Nov 3 rd, 2015 Key concepts of Unit 5-Part 1 Image resolution Pixel, bits and bytes Colour info (intensity) vs. coordinates Colour-depth Color Dithering Compression Transparency

More information

SFPL Reference Manual

SFPL Reference Manual 1 SFPL Reference Manual By: Huang-Hsu Chen (hc2237) Xiao Song Lu(xl2144) Natasha Nezhdanova(nin2001) Ling Zhu(lz2153) 2 1. Lexical Conventions 1.1 Tokens There are six classes of tokes: identifiers, keywords,

More information

CS 112 Project Assignment: Visual Password

CS 112 Project Assignment: Visual Password CS 112 Project Assignment: Visual Password Instructor: Dan Fleck Overview In this project you will use Python to implement a visual password system. In the industry today there is ongoing research about

More information

Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types Lecture 03 Bits, Bytes and Data Types Computer Languages A computer language is a language that is used to communicate with a machine. Like all languages, computer languages have syntax (form) and semantics

More information

1/25/2018. ECE 220: Computer Systems & Programming. Write Output Using printf. Use Backslash to Include Special ASCII Characters

1/25/2018. ECE 220: Computer Systems & Programming. Write Output Using printf. Use Backslash to Include Special ASCII Characters University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Review: Basic I/O in C Allowing Input from the Keyboard, Output to the Monitor

More information

Customisation and production of Badges. Getting started with I-Color System Basic Light

Customisation and production of Badges. Getting started with I-Color System Basic Light Customisation and production of Badges Getting started with I-Color System Basic Light Table of contents 1 Creating a Badge Model 1.1 Configuration of Badge Format 1.2 Designing your Badge Model 1.2.1

More information

To start, open or build a simple solid model. The bracket from a previous exercise will be used for demonstration purposes.

To start, open or build a simple solid model. The bracket from a previous exercise will be used for demonstration purposes. Render, Lights, and Shadows The Render programs are techniques using surface shading, surface tones, and surface materials that are then presented in a scene with options for lights and shadows. Modifications

More information

Binghamton University. CS-211 Fall Input and Output. Streams and Stream IO

Binghamton University. CS-211 Fall Input and Output. Streams and Stream IO Input and Output Streams and Stream IO 1 Standard Input and Output Need: #include Large list of input and output functions to: Read and write from a stream Open a file and make a stream Close

More information

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point?

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point? CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point? Overview For this lab, you will use: one or more of the conditional statements explained below scanf()

More information

Graphics File Formats

Graphics File Formats 1 Graphics File Formats Why have graphics file formats? What to look for when choosing a file format A sample tour of different file formats, including bitmap-based formats vector-based formats metafiles

More information

Binghamton University. CS-211 Fall Input and Output. Streams and Stream IO

Binghamton University. CS-211 Fall Input and Output. Streams and Stream IO Input and Output Streams and Stream IO 1 Standard Input and Output Need: #include Large list of input and output functions to: Read and write from a stream Open a file and make a stream Close

More information

Lesson 3 Creating and Using Graphics

Lesson 3 Creating and Using Graphics Lesson What you will learn: how to delete a sprite and import a new sprite how to draw using the pen feature of Scratch how to use the pen up and pen down feature how to change the colour of the pen how

More information

1. Introduction to the OpenCV library

1. Introduction to the OpenCV library Image Processing - Laboratory 1: Introduction to the OpenCV library 1 1. Introduction to the OpenCV library 1.1. Introduction The purpose of this laboratory is to acquaint the students with the framework

More information

BMP file format - Wikipedia

BMP file format - Wikipedia Page 1 of 3 Bitmap file header This block of bytes is at the start of the file and is used to identify the file. A typical application reads this block first to ensure that the file is actually a BMP file

More information

Digital Image Fundamentals. Prof. George Wolberg Dept. of Computer Science City College of New York

Digital Image Fundamentals. Prof. George Wolberg Dept. of Computer Science City College of New York Digital Image Fundamentals Prof. George Wolberg Dept. of Computer Science City College of New York Objectives In this lecture we discuss: - Image acquisition - Sampling and quantization - Spatial and graylevel

More information

PIXEL SPREADSHEET USER MANUAL April 2011

PIXEL SPREADSHEET USER MANUAL April 2011 PIXEL SPREADSHEET USER MANUAL April 2011 Greetings! Thank you for using Pixel Spreadsheet. In order to get started using Pixel Spreadsheet, there are a few things you must know: RUNNING PROGRAM FOR MAC

More information

CS 160: Lecture 10. Professor John Canny Spring 2004 Feb 25 2/25/2004 1

CS 160: Lecture 10. Professor John Canny Spring 2004 Feb 25 2/25/2004 1 CS 160: Lecture 10 Professor John Canny Spring 2004 Feb 25 2/25/2004 1 Administrivia In-class midterm on Friday * Closed book (no calcs or laptops) * Material up to last Friday Lo-Fi Prototype assignment

More information

Warping & Blending AP

Warping & Blending AP Warping & Blending AP Operation about AP This AP provides three major functions including Warp, Edge Blending and Black Level. If the AP is already installed, please remove previous version before installing

More information

C-Programming. CSC209: Software Tools and Systems Programming. Paul Vrbik. University of Toronto Mississauga

C-Programming. CSC209: Software Tools and Systems Programming. Paul Vrbik. University of Toronto Mississauga C-Programming CSC209: Software Tools and Systems Programming Paul Vrbik University of Toronto Mississauga https://mcs.utm.utoronto.ca/~209/ Adapted from Dan Zingaro s 2015 slides. Week 2.0 1 / 19 What

More information

Lecture 3. More About C

Lecture 3. More About C Copyright 1996 David R. Hanson Computer Science 126, Fall 1996 3-1 Lecture 3. More About C Programming languages have their lingo Programming language Types are categories of values int, float, char Constants

More information

Software Requirements Specification BRIC. for. Requirements for Version Prepared by Panagiotis Vasileiadis

Software Requirements Specification BRIC. for. Requirements for Version Prepared by Panagiotis Vasileiadis Software Requirements Specification for BRIC Requirements for Version 0.8.0 Prepared by Panagiotis Vasileiadis Introduction to Software Engineering, Aristotle University 01/04/2014 Software Requirements

More information

Parallel Image Processing

Parallel Image Processing Parallel Image Processing Course Level: CS1 PDC Concepts Covered: PDC Concept Concurrency Data parallel Bloom Level C A Programming Skill Covered: Loading images into arrays Manipulating images Programming

More information

CS103L PA4. March 25, 2018

CS103L PA4. March 25, 2018 CS103L PA4 March 25, 2018 1 Introduction In this assignment you will implement a program to read an image and identify different objects in the image and label them using a method called Connected-component

More information

Problem Solving: Storyboards for User Interaction

Problem Solving: Storyboards for User Interaction Topic 6 1. The while loop 2. Problem solving: hand-tracing 3. The for loop 4. The do loop 5. Processing input 6. Problem solving: storyboards 7. Common loop algorithms 8. Nested loops 9. Problem solving:

More information

Introduction: The Unix shell and C programming

Introduction: The Unix shell and C programming Introduction: The Unix shell and C programming 1DT048: Programming for Beginners Uppsala University June 11, 2014 You ll be working with the assignments in the Unix labs. If you are new to Unix or working

More information

CISC 1115 (Science Section) Brooklyn College Professor Langsam. Assignment #5

CISC 1115 (Science Section) Brooklyn College Professor Langsam. Assignment #5 CISC 1115 (Science Section) Brooklyn College Professor Langsam Assignment #5 An image is made up of individual points, known as pixels. Thus if we have an image with a resolution of 100 x 100, each pixel

More information

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C Welcome! Welcome to your CpSc 111 lab! For each lab this semester, you will be provided a document like this to guide you. This material, as

More information

PRINCIPLES OF OPERATING SYSTEMS

PRINCIPLES OF OPERATING SYSTEMS PRINCIPLES OF OPERATING SYSTEMS Tutorial-1&2: C Review CPSC 457, Spring 2015 May 20-21, 2015 Department of Computer Science, University of Calgary Connecting to your VM Open a terminal (in your linux machine)

More information

CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015

CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015 CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015 These pages will NOT BE INCLUDED IN THE MIDTERM. print - Displays a value in the command area - Examples: - print

More information

3Picture Fundamentals

3Picture Fundamentals 3Picture Fundamentals The Steps Creating Picture Boxes 91 Running Text Around Items 95 Importing Pictures 97 Creating Visual Effects with Pictures 99 Applying Styles to Pictures 103 Copying a Picture Box

More information

Format Type Support Thru. vector (with embedded bitmaps)

Format Type Support Thru. vector (with embedded bitmaps) 1. Overview of Graphics Support The table below summarizes the theoretical support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats

More information

OptimiData. JPEG2000 Software Development Kit for C/C++ Reference Manual. Version 1.6. from

OptimiData. JPEG2000 Software Development Kit for C/C++  Reference Manual. Version 1.6. from OptimiData for optimized data handling JPEG2000 Software Development Kit for C/C++ Reference Manual Version 1.6 from 2004-07-29 (Windows and Linux Versions) www.optimidata.com OptimiData JPEG2000 C-SDK

More information

Title and Modify Page Properties

Title and Modify Page Properties Dreamweaver After cropping out all of the pieces from Photoshop we are ready to begin putting the pieces back together in Dreamweaver. If we were to layout all of the pieces on a table we would have graphics

More information

Input / Output Functions

Input / Output Functions CSE 2421: Systems I Low-Level Programming and Computer Organization Input / Output Functions Presentation G Read/Study: Reek Chapter 15 Gojko Babić 10-03-2018 Input and Output Functions The stdio.h contain

More information

CSE 351: The Hardware/Software Interface. Section 2 Integer representations, two s complement, and bitwise operators

CSE 351: The Hardware/Software Interface. Section 2 Integer representations, two s complement, and bitwise operators CSE 351: The Hardware/Software Interface Section 2 Integer representations, two s complement, and bitwise operators Integer representations In addition to decimal notation, it s important to be able to

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

SU 2017 May 11/16 LAB 2: Character and integer literals, number systems, character arrays manipulation, relational operator

SU 2017 May 11/16 LAB 2: Character and integer literals, number systems, character arrays manipulation, relational operator SU 2017 May 11/16 LAB 2: Character and integer literals, number systems, character arrays manipulation, relational operator 0 Problem 0 number bases Visit the website www.cleavebooks.co.uk/scol/calnumba.htm

More information

EEN118 LAB TWO. 1. A Five-Pointed Star.

EEN118 LAB TWO. 1. A Five-Pointed Star. EEN118 LAB TWO The purpose of this lab is to get practice with defining and using your own functions. The essence of good structured programming is to split large problems into smaller and smaller sub-problems.

More information

How to Prepare Your Cards for Press Using Scribus

How to Prepare Your Cards for Press Using Scribus How to Prepare Your Cards for Press Using Scribus This Tutorial is Divided into Sections: 1. What is Scribus? 2. What Do I Need to Get Started? 3. Setting Up Your Scribus Document 4. Creating Master Pages

More information

Press-Ready Cookbook Page Guidelines

Press-Ready Cookbook Page Guidelines Press-Ready Cookbook Page Guidelines table of contents These instructions are for all pages of your cookbook: Title Page, Special Pages, Table of Contents, Dividers, Recipe Pages, etc. WHAT IS PRESS-READY?

More information

Lesson 11: Visualization

Lesson 11: Visualization 11 Lesson 11: Visualization Goals of This Lesson Students create an image with PhotoWorks and an animation using SolidWorks MotionManager. Before Beginning This Lesson This lesson requires copies of Tutor1,

More information

Cropping an Image for the Web

Cropping an Image for the Web Cropping an Image for the Web This guide covers how to use the Paint software included with Microsoft Windows to crop images for use on a web page. Opening Microsoft Paint (In Windows Accessories) On your

More information

Introduction to C. CS2023 Winter 2004

Introduction to C. CS2023 Winter 2004 Introduction to C CS2023 Winter 2004 Outcomes: Introduction to C After the conclusion of this section you should be able to Recognize the sections of a C program Describe the compile and link process Compile

More information

CP SC 4040/6040 Computer Graphics Images. Joshua Levine

CP SC 4040/6040 Computer Graphics Images. Joshua Levine CP SC 4040/6040 Computer Graphics Images Joshua Levine levinej@clemson.edu Lecture 02 OpenImageIO and OpenGL Aug. 25, 2015 Agenda Reminder, course webpage: http://people.cs.clemson.edu/~levinej/courses/6040

More information

CMPT 102 Introduction to Scientific Computer Programming. Input and Output. Your first program

CMPT 102 Introduction to Scientific Computer Programming. Input and Output. Your first program CMPT 102 Introduction to Scientific Computer Programming Input and Output Janice Regan, CMPT 102, Sept. 2006 0 Your first program /* My first C program */ /* make the computer print the string Hello world

More information

Objectives. Learn how to read and write from memory using C-pointers Implement the very first TOS functions

Objectives. Learn how to read and write from memory using C-pointers Implement the very first TOS functions TOS Arno Puder 1 Objectives Learn how to read and write from memory using C-pointers Implement the very first TOS functions 2 Memory Access Memory often needs to be manipulated manually. Two operations:

More information

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program Syntax What the Compiler needs to understand your program 1 Pre-Processing Any line that starts with # is a pre-processor directive Pre-processor consumes that entire line Possibly replacing it with other

More information

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2 CS 220: Introduction to Parallel Computing Beginning C Lecture 2 Today s Schedule More C Background Differences: C vs Java/Python The C Compiler HW0 8/25/17 CS 220: Parallel Computing 2 Today s Schedule

More information

CS16 Exam #1 7/17/ Minutes 100 Points total

CS16 Exam #1 7/17/ Minutes 100 Points total CS16 Exam #1 7/17/2012 75 Minutes 100 Points total Name: 1. (10 pts) Write the definition of a C function that takes two integers `a` and `b` as input parameters. The function returns an integer holding

More information

Creating a PDF/X-1a from InDesign

Creating a PDF/X-1a from InDesign Creating a PDF/X-1a from InDesign Recommendations for Application Settings, General Design Guidelines, and Exporting to a PDF/X-1a (Screen shots for this manual were created from a Mac. If you are using

More information

Lab 09 - Virtual Memory

Lab 09 - Virtual Memory Lab 09 - Virtual Memory Due: November 19, 2017 at 4:00pm 1 mmapcopy 1 1.1 Introduction 1 1.1.1 A door predicament 1 1.1.2 Concepts and Functions 2 1.2 Assignment 3 1.2.1 mmap copy 3 1.2.2 Tips 3 1.2.3

More information

Fall Harris & Harris

Fall Harris & Harris E11: Autonomous Vehicles Fall 2011 Harris & Harris PS 1: Welcome to Arduino This is the first of five programming problem sets. In this assignment you will learn to program the Arduino board that you recently

More information

Introduction to the MODx Manager

Introduction to the MODx Manager Introduction to the MODx Manager To login to your site's Manager: Go to your school s website, then add /manager/ ex. http://alamosa.k12.co.us/school/manager/ Enter your username and password, then click

More information

An Introduction to Digital Video Data Compression in Java. Fore June

An Introduction to Digital Video Data Compression in Java. Fore June An Introduction to Digital Video Data Compression in Java 1 Fore June Chapter 4 Image and Video Storage Formats There are a lot of proprietary image and video file formats, each with clear strengths and

More information