From 35ddb2166ca92e2738c915e246a38792233768ef Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Sun, 1 Dec 2024 12:16:58 +0100 Subject: [PATCH] Opt in for ExperimentalUnsignedTypes --- src/main/kotlin/Bitmap.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/Bitmap.kt b/src/main/kotlin/Bitmap.kt index fd9e2bd..9781fb6 100644 --- a/src/main/kotlin/Bitmap.kt +++ b/src/main/kotlin/Bitmap.kt @@ -5,6 +5,7 @@ const val BYTES_PER_PIXEL = 4 data class Color(val r: UByte, val g: UByte, val b: UByte, val alpha: UByte = UByte.MAX_VALUE) +@OptIn(ExperimentalUnsignedTypes::class) class Bitmap(val width: Int, val height: Int) { val data = UByteArray(width * height * BYTES_PER_PIXEL) @@ -27,6 +28,7 @@ class Bitmap(val width: Int, val height: Int) { } } +@OptIn(ExperimentalUnsignedTypes::class) fun File.writeBitmap(bitmap: Bitmap) { outputStream().use { stream -> stream.write(0) // ID length