Computer Science 215 Quiz 6 Name ______________________ 1. In the last class, procedures for reading a file of image data into a dynamically allocated area of storage were discussed. In this procedure, the proper order in which the required system calls should be made is: a. fread() should be called to b. malloc() should be called to read the data before malloc() allocate the storage before is called to allocate the fread() is called to read in storage. the data. c. the program will work correctly regardless of the order in which fread() and malloc() are called. 2. The number of bytes per pixel that must be read in for an image that is encoded as described in class is: a. 1 for both the rgb and b. 3 bytes per pixel for grayscale grayscale images in the 1 byte per pixel for rgb examples discussed in class c. 3 bytes per pixel for both d. 1 byte per pixel for grayscale grayscale and rgb and 3 bytes per pixel rgb. 3. The proper expression that should be used to access a pixel at position (row, col) in a binary encoded grayscale image is: a. *(imageloc + row * numrows + col) b. *(imageloc + col * numrows + col) c. *(imageloc + col * numrows + row) d. *(imageloc + row * numcols + col) 4. The Floyd-Steinberg algorithm is used to convert a. color images to grayscale b. grayscale images to black/white c. color images to black/white d. black/white images to color 5. The general class to which the Floyd-Steinberg algorithm belongs is: a. half-baked b. half-toning c. half-stoned d. half-fast