CMPS 160 Introduction to Computer Graphics
Lab 1: Painterly Rendering
Fall 2010

This lab will serve as an introduction to opening windows in Qt, working with pixels and their colors, reacting to mouse events, and rendering simple shapes.
You can use the code provided in Lab 0 as your starter code, or write your own. The program should load an image (either through the command line or dialog box) when started, but initially display a blank canvas. When the user drags the mouse over the canvas, convert the mouse movements into paint strokes and paint the original image onto the canvas. Check the 'Grading / Requirements' section below for the specifics that you'll be graded on.

Use a QImage object (as in Lab 0) or a QPixMap object for drawing on & storing the image. Use either a conditional copy or a filter to move RGB pixels over to the foreground image.

Example screenshot after painting
lab1 screenshot
Requirements/Grading

 

  • Functionality (100 points possible)
  • Load image file from command line / dialog (10)
  • Display a help message to the user from image canvas window regarding what the mouse and keyboard do. Should be accessible from either a menu / button (15)
  • Present a window/the blank canvas (5)
  • Turn mouse-dragging motions into paint strokes (40)
  • Strokes must be oriented to motion (i.e. Use the angle of mouse movement and/or amount of mouse movement between mouseMove events to change a brush aspect)
  • User must be able to paint something recognizable as the source image
  • Change some aspect of the painting technique - such as brush size or coloring - in response to keyboard / menu commands (20)
  • Clear the canvas in response to a keyboard / menu command (10)
Submit Instructions
  • Copy the project source files (*.pro, *.ui, *.cpp. *.h) to your home folder on unix.ic.ucsc.edu (Mapped to the Z:(?) drive on the lab machines)
  • Open an SSH window and connect to unix.ic.ucsc.edu (a shortcut should exist on lab machines), cd to the folder where you have the project files
  • To submit your files, type: (please submit the .pro, .ui, .cpp and .h files only for this lab)
  • submit cmps160-jed.f10 lab1 files