public class AdvancedManipulations
extends java.lang.Object
Constructor | Description |
---|---|
AdvancedManipulations() |
Modifier and Type | Method | Description |
---|---|---|
static PixelPicture |
adjustContrast(PixelPicture pic,
double multiplier) |
Change the contrast of a picture.
|
static PixelPicture |
blur(PixelPicture pic,
int radius) |
Blur an image.
|
static PixelPicture |
flood(PixelPicture pic,
Pixel c,
int row,
int col) |
Challenge Problem (this problem is worth 0 points):
Flood pixels of the same color with a different color.
|
static PixelPicture |
reducePalette(PixelPicture pic,
int numColors) |
Reduce a picture to its most common colors.
|
public static PixelPicture adjustContrast(PixelPicture pic, double multiplier)
pic
- the original picturemultiplier
- the factor by which each color component of each pixel should be scaledpublic static PixelPicture reducePalette(PixelPicture pic, int numColors)
pic
- the original picturenumColors
- the maximum number of colors that can be used in reduced picturepublic static PixelPicture blur(PixelPicture pic, int radius)
pic
- The picture to be blurred.radius
- The radius of the blurring box.public static PixelPicture flood(PixelPicture pic, Pixel c, int row, int col)
pic
- The original picture to be flooded.c
- The pixel the user "clicked" (representing the color that should be flooded).row
- The row of the point on which the user "clicked."col
- The column of the point on which the user "clicked."