scoop:scoop.window:0.1.0
src/menu/image.scoop
Selected production source · src/menu/image.scoop
1
package scoop.window3
/** One immutable, tightly packed straight-alpha RGBA8 image. */4
public class DesktopImageRepresentation public constructor(5
public val size: PhysicalSize,6
public val pixels: Array<UInt8>7
) {8
init {9
requireWindow(size.width > 0 && size.height > 0, "empty desktop image")10
val area = size.width.toLong() * size.height.toLong()11
requireWindow(area <= 2305843009213693951L, "desktop image size overflow")12
requireWindow(pixels.size == area * 4L, "desktop image byte count")13
}14
}16
/** CPU image data shared by menus and the optional tray Cone. */17
public class DesktopImage public constructor(18
public val size: LogicalSize,19
public val representations: Array<DesktopImageRepresentation>,20
public val template: Boolean = false21
) {22
init {23
checkSize(size)24
requireWindow(size.width > 0.0 && size.height > 0.0, "empty desktop image size")25
requireWindow(representations.size > 0L, "desktop image has no representations")26
}27
}