lunduniversity / introprog-scalalib

Scala library with simple-to-use utilites for students of introductory programming. http://cs.lth.se/pgk/api
BSD 2-Clause "Simplified" License
60 stars 14 forks source link

Add ColorMatrix.scala, ImageFilter.scala #13 #24

Closed theolundqvist closed 3 years ago

theolundqvist commented 3 years ago

ColorMatrix:

PixelWindow:

ImageFilter translated from java to scala

Added a fun test.

13

theolundqvist commented 3 years ago

image

bjornregnell commented 3 years ago

Nice! According to our discussion: rename ColorMatrix to Image and simplify the API to not directly use java...BufferedImage as discussed in https://github.com/lunduniversity/introprog-scalalib/issues/13#issuecomment-889797910

theolundqvist commented 3 years ago

@bjornregnell Im satisfied with how it turned out. Fast and powerful methods and ease of use

bjornregnell commented 3 years ago

@bjornregnell Im satisfied with how it turned out. Fast and powerful methods and ease of use

Yeah this will be great! I have some change proposals in the review comments attached to the code. Let me know if you don't agree and we can discuss options.

Also, the ImageFilter class is perhaps not exactly Scala-idomatic; it feels more like Java in Scala :) but let's leave like that for now, and we can discuss options when after the lab solution as been re-implemented with the new api.

theolundqvist commented 3 years ago

@bjornregnell Im satisfied with how it turned out. Fast and powerful methods and ease of use

Yeah this will be great! I have some change proposals in the review comments attached to the code. Let me know if you don't agree and we can discuss options.

Also, the ImageFilter class is perhaps not exactly Scala-idomatic; it feels more like Java in Scala :) but let's leave like that for now, and we can discuss options when after the lab solution as been re-implemented with the new api.

I'm not sure how the methods in ImageFilter works so it was hard to do anything but straight translation of the code.

theolundqvist commented 3 years ago

Requested changes should now be done. @bjornregnell

bjornregnell commented 3 years ago

I have just