Guest User

Untitled

a guest
Dec 10th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment