Question: Please, I need help. Create a new project. Add a package imageloop, and a class pictures to that package. Method name: safeColor Parameter(s): A single

Please, I need help.

Create a new project. Add a package imageloop, and a class pictures to that package.

  1. Method name: safeColor Parameter(s): A single int value representing one of a red, green, or blue value. Return value: An int that is the same as the parameter, except that it is 0 if the original value is less than zero and it is 255 if the original value is greater than 255. Example: If the parameter is 100, then the return value should be 100. If the parameter is 300, then the return value should be 255.
  2. Method name: makeBrighter Parameter(s): A Picture object. This is the source image. Return value: A new Picture object with the color values doubled. Each pixel in the returned Picture should have a color that has each red, green, and blue component twice that of the corresponding pixel (the pixel with the same x and y coordinate) in the source image. Unthinkingly applied, this doubling will yield color values outside the allowed 0-255 range, which crashes the program. Clamp each calculated red, green, and blue value to a safe range by applying the safeColor method written above to the colors you calculate. Example: A single pixel image with a color (100, 200, 50) would make a new image with a single pixel with color (200, 255, 100). An example of what a result might look like is the following (please don't treat this as a reference image as I am unsure of what compression or changes might be applied by Canvas).

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!