1 / 6

CSC 160 Computer Programming for Non-Majors Images: Another Form of Symbolic Data

CSC 160 Computer Programming for Non-Majors Images: Another Form of Symbolic Data. Prof. Adam M. Wittenstein Wittenstein@adelphi.edu http://www.adelphi.edu/~wittensa/csc160/. Data Type: Image (Shapes or Pictures). A third type of symbolic data. Fun to process images.

rodneya
Download Presentation

CSC 160 Computer Programming for Non-Majors Images: Another Form of Symbolic Data

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 160Computer Programmingfor Non-MajorsImages: Another Form of Symbolic Data Prof. Adam M. Wittenstein Wittenstein@adelphi.edu http://www.adelphi.edu/~wittensa/csc160/

  2. Data Type: Image (Shapes or Pictures) • A third type of symbolic data. Fun to process images. • Images are values like numbers, symbols, or strings – they can be used inside expressions. • Usually given names, since the same image can be used with several different functions. • Like symbols, images don't have any specific meaning, but we tend to connect them easily with the intended information.

  3. Inserting Images • To insert an image into a program, move the blinking caret to the place in your program where you want the image, and select the Insert Image item from the Special menu. • DrScheme will then provide a dialog for selecting an image file. • After you have selected a file, the image will be inserted at the blinking caret.

  4. Another teachpack: “world.ss” This teachpack has some functions to create shapes. --Wherever a function takes in a "mode", you may use either the string “solid” or the symbol “outline”. --Wherever a function takes in an “image-color”, enter the color as a string. For example, “blue” or “Blue” or “red”. • rectangle : num num mode image-color -> image • circle : num mode image-color -> image • triangle : num mode image-color -> image (NOTE: The triangle function is only for equilateral triangles.)

  5. Other “world.ss” functions • image-width : image -> number --to obtain an image's width in pixels • image-height : image -> number --to obtain an image's height in pixels • overlay : image image image ... -> image --to add the pixels of the second image onto the first image, lining up the pinholes (centers)

  6. Next time… • The “tiles.ss” teachpack --Download it from the website: http://www.adelphi.edu/sbloch/class/171/tiles.plt --In DrScheme, Language->Add Teachpack-> Right-click on “tiles”. This extracts another “tiles” file. Install this file. • Writing our own image functions

More Related