Question: Consider the partial class declarations below. public class Pixel { / / instance variables and / / constructors not shown public int getRed ( )
Consider the partial class declarations below.
public class Pixel
instance variables and
constructors not shown
public int getRed
public int getGreen
public int getBlue
public void setRedint value
public void getGreenint value
public void getBlueint value
other methods not shown
public class ImagePlus
private Pixel pixels;
other instance variables,
constructors, and methods not shown
to be implemented
public void darkerDarks
We want to add a method to the ImagePlus class called darkerDarks This method would change all Pixel objects with an average amount of RGB less than to a completely black Pixel. In other words, if the average of red, green, and blue in a Pixel object is less than the red, green, and blue values would be changed to zero. This would happen for all Pixel objects in the ImagePlus object.
RGB values before calling darkerDarks
RGB values after calling darkerDarks
Example #
Example #
Example #
Example #
public void darkerDarks
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
