Iat455

Assignments

Home Assignments

Assignment 1

This assignment is broken into 3 seperate parts. Each part should be completed as an "Effect" that is loadable and runnable using the example code presented in your workshops.

Part 1: HSV -> RGB Scanlines

Create a scanline effect like the one shown in labs, but allow the user to control the color of the scanline using HSV controls. You will have to take the HSV values, and translate them to RGB values before you can draw the scanlines.

Use the following scales for your HSV ranges:

Do not copy and paste HSV to RGB or vice versa algorithms, write your own code!

Please read the HSV/RGB document if you need help

Part 2: HSV Controls for Image

Create an effect that will allow the user to control the Hue, Saturation, and Brightness of their image.

Convert each pixel in the webcam image to HSV, scale the values based on the normalized slider value, convert back to RGB, and output the result to the canvas.

NOTE: you're going to be shifting the Hue value by the value of the slider. Example: the RGB you conver to HSV for a pixel has a Hue value of 30. Your slider has a Hue value of 100. The output Hue value should be 30 + 100 = 130. You will have to deal with cases where: (slider value + input hue value) > 360. Wrap the result around to 0 (you can use the % operator).

Use the same controls and ranges from the previous effect.

Part 3: Gaussian Blur

Create an effect that will apply a gaussian blur to an image and allow the user choose between a 5x5, 7x7, or 9x9 (use a slider with range 1-3 and a switch statement in your draw function).

Take a look at this sample 7x7 gaussian matrix.

Note that the result of adding up all matrix (or kernel) elements is 1 and this kernel can be generated programmatically in the constructor of your effect.