Ch. 5 Test Flashcards Preview

Foundations > Ch. 5 Test > Flashcards

Flashcards in Ch. 5 Test Deck (72)
Loading flashcards...
0

Objects give programmers...

Access to complex behavior

1

Objects can manipulate...

Digitally encoded images and sounds

2

Until 20 years ago, computers mostly...

Processed numbers and text

3

Digital image processing includes:

-capturing images with scanners and cameras
-representation and storage of images in efficient file formats
-construction of algorithms used in image-manipulation programs (like photoshop)

4

(The essential properties of images) When an image is loaded in a program...

The bits map into a rectangle of colored dots (pixels)

5

(The essential properties of images)
The coordinates of the grid range from:

-(0,0) at the upper right corner to (width-1, height-1) at the lower right corner
-width and height are the dimensions in pixels
-x-coordinates increase positively to the right, y-coordinates increase positively to the bottom.

6

An image consists of...

A width, height, and a set of pixels

7

Each pixel is accessible by...

It's (x,y) coordinates

8

A pixel contains...

Integer values that represent color in terms of RGB

9

The pixel at the upper left corner is at...

(0,0)

10

Image manipulation operations:

Transfer images to and from files and storage in RAM
After loading into RAM, can retrieve or modify a pixel at any grid position

11

Image manipulation operators allow the program to

Rotate an image
Convert color to gray scale or add filters
Highlight blur or sharpen all or part of an image
Control brightness and perform edge detection
Enlarge or reduce size and apply color inversion
Morph an image into another image

12

The images package defines classes that allow the programmer to

-load an image from a file
-view the image in a window
-examine and manipulate an image's pixels
-update the window with changes
-save the image back to a file

13

APImage and Pixel classes:

The two most important classes in the images package

14

APImage method includes

Creating an image from a file or a blank image
Returning images height and width
Saving the image

15

The pixel class...

Represents a pixel
-an object of this class contains three integer values to represent the pixels RGB components

16

Simple image processing program

A program that loads an image from its file and draws it in a window

17

The first statement of a simple image processing program

Imports the relevant class, APImage, from the images package

18

The second statement of a simple image processing program

Uses object instantiation to make a new object available to the program and instantiates the class

19

The third statement of a simple image processing program

Runs the draw method on the object to display it in a window

20

Java might raise an error if...

There is not enough ram to hold an image

21

Heap space

The area of ram reserved for Java objects

22

To prevent a crash...

Adjust the heap space for data memory using the Xmx command-line option

23

Object based programming uses..

Existing classes objects and methods to solve problems

24

To use an object the programmer must know...

It's interface (the set of methods it recognizes)

25

An interface contains:

The headers of methods and supporting comments about their use (including methods' names, types of parameters they expect, and types of values they return, if any)
No info about how methods work is provided

26

Application programming interface

The set of interfaces in a package or language

27

Mutators

Methods that do not return a value
-used to modify the internal contents of an object
-setPixel and setRed

28

Accessors

Methods that return values
-allows users to examine part of an objects contents
-toString() returns a strong representation of the data combined in an object

29

Constructors don't have a..

Return type