Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the method lightenImage that modifies the image by changing the values in the instance variable pixels according to the following conditions: The value at
Write the method lightenImage that modifies the image by changing the values in the instance variable pixels according to the following conditions: The value at position row col is increased by the value at row col if the position is valid. If the new value is greater than the value WHITE, the pixel is assigned the value WHITE. If there is no pixel at position row col the value is unchanged. The following shows the contents of the instance variable pixels before and after a call to lightenImage. The bolded values represent the values that could be modified in the image. Before lightenImage After lightenImage Complete the method lightenImage below. Increases the value of each pixel at row col by the value of the pixel at row col if the position is valid. If the value is greater than WHITE, the pixel value is set to WHITE. If there is no pixel at row col the value is unchanged. public void lightenImage The method must do the following: Accesses all necessary elements in at least one row or one column of pixels Accesses all necessary elements of pixels no bounds errors Increases the value at index rowcol by the value found at index rowcol Modifies all appropriate elements of pixels Assigns WHITE or to elements of pixels that would otherwise have a value greater than WHITE
Write the method lightenImage that modifies the image by changing the values in the instance variable pixels according to the following conditions:
The value at position row col is increased by the value at row col if the position is valid.
If the new value is greater than the value WHITE, the pixel is assigned the value WHITE.
If there is no pixel at position row col the value is unchanged.
The following shows the contents of the instance variable pixels before and after a call to lightenImage. The bolded values represent the values that could be modified in the image.
Before lightenImage
After lightenImage
Complete the method lightenImage below.
Increases the value of each pixel at row col
by the value of the pixel at row col if
the position is valid. If the value is greater
than WHITE, the pixel value is set to WHITE.
If there is no pixel at row col the
value is unchanged.
public void lightenImage The method must do the following: Accesses all necessary elements in at least one row or one column of pixels
Accesses all necessary elements of pixels no bounds errors
Increases the value at index rowcol by the value found at index rowcol
Modifies all appropriate elements of pixels
Assigns WHITE or to elements of pixels that would otherwise have a value greater than WHITE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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