-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring so that the imageprinter knows about the color palette
- Loading branch information
1 parent
d677469
commit 1d92d43
Showing
11 changed files
with
108 additions
and
62 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
lib/src/main/kotlin/dev/patbeagan/consolevision/BufferedImageExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package dev.patbeagan.consolevision | ||
|
||
import dev.patbeagan.consolevision.imagefilter.ImageFilter | ||
import java.awt.image.BufferedImage | ||
|
||
inline fun BufferedImage.withLine( | ||
onLineEnd: () -> Unit = {}, | ||
action: (Int, Int) -> Unit, | ||
) { | ||
(minY until height).forEach { y -> | ||
(minX until width).forEach { x -> action(y, x) } | ||
onLineEnd() | ||
} | ||
} | ||
|
||
fun BufferedImage.applyFilter(imageFilter: ImageFilter) { | ||
imageFilter(this) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
lib/src/main/kotlin/dev/patbeagan/consolevision/imagefilter/ColorMutation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
lib/src/main/kotlin/dev/patbeagan/consolevision/imagefilter/ColorNormalization.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters