daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Ujian Akhir Semester
  3.  * Kelas PBO B
  4.  * @author Hendra Ramadani (05111740000055)
  5.  * 10 December 2018
  6.  */
  7. public class DarkerFilter extends Filter
  8. {
  9.     /**
  10.      * Constructor for objects of class DarkerFilter.
  11.      * @param name The name of the filter.
  12.      */
  13.     public DarkerFilter(String name)
  14.     {
  15.         super(name);
  16.     }
  17.  
  18.     /**
  19.      * Apply this filter to an image.
  20.      *
  21.      * @param  image  The image to be changed by this filter.
  22.      */
  23.     public void apply(OFImage image)
  24.     {
  25.         int height = image.getHeight();
  26.         int width = image.getWidth();
  27.         for(int y = 0; y < height; y++) {
  28.             for(int x = 0; x < width; x++) {
  29.                 image.setPixel(x, y, image.getPixel(x, y).darker());
  30.             }
  31.         }
  32.     }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top