Advertisement
Guest User

joo

a guest
Nov 6th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.09 KB | None | 0 0
  1.  
  2. package kierros3
  3.  
  4. object Filter {
  5.  
  6.   private def createColor(alpha: Int, red: Int, green: Int, blue:Int): Int = {
  7.     if ((Math.min(alpha, 255) == alpha && Math.max(alpha, 0) == alpha)
  8.         && (Math.min(red, 255) == red && Math.max(red, 0) == red)
  9.         && (Math.min(green, 255) == green && Math.max(green, 0) == green)
  10.         && (Math.min(blue, 255) == blue && Math.max(blue, 0) == blue))
  11.     {
  12.       val movedAlpha = alpha
  13.       val movedRed = red << 8
  14.       val movedGreen = green << 16
  15.       val movedBlue = blue << 24
  16.       val result = movedAlpha & movedRed & movedGreen & movedBlue
  17.       return result
  18.     }
  19.     else return -1
  20.   }
  21.   def lightness(factor: Float, image: Image) : Unit = {}
  22.  
  23.   def invert(image: Image) : Unit = {}
  24.  
  25.   def grayscale(image: Image) : Unit = {}
  26.  
  27.   def adjustRed(amount: Int, image: Image) : Unit = {}
  28.  
  29.   def adjustGreen(amount: Int, image: Image) : Unit = {}
  30.  
  31.   def adjustBlue(amount: Int, image: Image) : Unit = {}
  32.  
  33.   def blur(amount: Int, image: Image) : Unit = {}
  34.  
  35.   def sharpen(amount: Int, image: Image) : Unit = {}
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement