- Find the project name in the Package Explorer window. It should be named by your last name, a hyphen, and your student ID number.
- Right click on that.
- Go down to Team
- Choose Update
double
parameters and returns their sum.
double sum(double a, double b) { return a + b; }Recall that each pixel of an image has three color components (red, green, and blue), and that each of these components is an
int
value in the range 0 to 255, where 0 is no intensity and 255 is full intensity.
In this part of the lab, you will write methods whose parameter(s) and return values are int
s, representing the three
color components of a pixel. When you execute these methods in NIP, the ProcessorTool will apply them to every
component of every pixel of the image to produce a new image. Within NIP, use the browse button to load in
image files.
In the file ImageProcessor.java, complete the provided stub methods as described below. In the method bodies, use mathematical expression. Do not use a conditional (if) statement.
Note that each pixel
of an image is represented as a
Color object.
Create and test methods (whose parameters and return values are Color
s) with the following specifications.
brighter()
that returns a brighter color.)
Color.BLACK
or
Color.WHITE
. It's up to you how to decide when a color's components, taken as a whole, should be considered black or white.
To earn the grade of your choosing, you need to complete certain number of extensions. Using the navigation bar at the top of this page, you can take a look at the extensions you might undertake for this particular module.