task 7
This commit is contained in:
@@ -68,4 +68,8 @@ object ImageFilters {
|
||||
(Math.sqrt(dx*dx + dy*dy)*intensityFactor).toInt
|
||||
}
|
||||
})
|
||||
|
||||
def noise(a: Array[Array[Int]], intensity: Double): Array[Array[Int]] = filter(a, (value) => {
|
||||
Math.max(0, Math.min(255, value + (Math.random()*2-1)*intensity)).toInt
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user