Skip to content

Commit 9419136

Browse files
committed
improve doc comments on Image
1 parent 2b33e63 commit 9419136

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/scala/introprog/Image.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package introprog
22

3-
3+
/** Companion object to create Image instances */
44
object Image:
55
import java.awt.image.BufferedImage
66
/** Create new empty Image with specified dimensions `(width, height)`*/
77
def ofDim(width: Int, height: Int) =
88
Image(BufferedImage(width, height, BufferedImage.TYPE_INT_RGB))
99

10-
10+
/** Image represents pixel arrays backed by underlying java.awtimage.BufferedImage */
1111
class Image (val underlying: java.awt.image.BufferedImage):
1212
import java.awt.Color
1313
import java.awt.image.BufferedImage
@@ -59,10 +59,13 @@ class Image (val underlying: java.awt.image.BufferedImage):
5959
val bi = BufferedImage(width, height, imageType)
6060
bi.createGraphics().drawImage(underlying, 0, 0, width, height, null)
6161
Image(bi)
62-
62+
63+
/** Test if alpha channel is supperted. */
6364
val hasAlpha = underlying.getColorModel.hasAlpha
6465

66+
/** The height of this image. */
6567
val height = underlying.getHeight
6668

69+
/** The width of this image. */
6770
val width = underlying.getWidth
6871

0 commit comments

Comments
 (0)