Skip to content

Commit 2b33e63

Browse files
committed
fix vertical space
1 parent c02ec38 commit 2b33e63

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/scala/introprog/Image.scala

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ object Image:
88
Image(BufferedImage(width, height, BufferedImage.TYPE_INT_RGB))
99

1010

11-
1211
class Image (val underlying: java.awt.image.BufferedImage):
1312
import java.awt.Color
1413
import java.awt.image.BufferedImage
15-
1614

1715
/** Get color of pixel at `(x, y)`.*/
1816
def apply(x: Int, y: Int): Color = Color(underlying.getRGB(x, y))
@@ -31,7 +29,6 @@ class Image (val underlying: java.awt.image.BufferedImage):
3129
update(x, y, f(x, y))
3230
this
3331

34-
3532
/** Extract and return image pixels. */
3633
def toMatrix: Array[Array[Color]] =
3734
val xs: Array[Array[Color]] = Array.ofDim(width, height)
@@ -63,8 +60,9 @@ class Image (val underlying: java.awt.image.BufferedImage):
6360
bi.createGraphics().drawImage(underlying, 0, 0, width, height, null)
6461
Image(bi)
6562

66-
6763
val hasAlpha = underlying.getColorModel.hasAlpha
64+
6865
val height = underlying.getHeight
66+
6967
val width = underlying.getWidth
7068

0 commit comments

Comments
 (0)