Question: aTest void testBlur ( ) { / / Create two Picture image objects using the same image file Picture p = new Picture ( PictureExplorer

aTest
void testBlur()
{
// Create two Picture image objects using the same image file
Picture p= new Picture(PictureExplorer.imageFolderName + "bees.PNG");
Picture p2= new Picture(PictureExplorer.imageFolderName + "bees.PNG"); // original
// Apply the student code and solution code
Logic.blur(p);
// obtain the 2D Pixel array representation for both objects
Pixel[][] pixels = p.getPixels2D();
Pixel[][] pixels2= p2.getPixels2D(); // original
// check that the formula was applied to a couple of pixels
int avgRed00=(int)((pixels2[0][0].getRed()+ pixels2[1][0].getRed()+ pixels2[0][1].getRed()
pixels2[1][1].getRed())/4.0);
assert (avgRed00== pixels[0][0].getRed());
int avgRed01=(int)((pixels2[0][1].getRed()+ pixels2[1][1].getRed()+ pixels2[0][2].getRed()
pixels2[1][2].getRed())/4.0);
assert (avgRed01== pixels[0][1].getRed());
}Hello, I am trying to write code that will blur the image bees, here is the code I must test. any help would be appreciated
 aTest void testBlur() { // Create two Picture image objects using

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!