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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started