Question: 2. Write the america method to reset each individual pixel's blue and red values to the average of that pixel's blue and red pixel values.

2. Write the america method to reset each individual pixel's blue and red values to the average of that pixel's blue and red pixel values. (IE if a pixel's red value is 200 and the blue value is 150, then the red and blue values of the pixel should be reset to 175 for both). Below, four method signatures from the Pixel class are provided, these will help you complete the task. A partial method has also been started below. Pixel int getBlue(): access the blue value (between 0-255) of the pixel int getRed(): access the red value(between 0-255) of the pixel void setBlue(int value) : reset the blue value to the parameter provided void setRed(int value): reset the red value to the parameter provided public void america() { Pixel[][] pix = this.getPixels2D; // write code below that will reset all blue and red values found in the 2D array of //pixels to the average of the blue and red values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!