Fix demos, upgrade to Gradle 7.2

This commit is contained in:
Edwin Jakobs
2021-08-22 15:44:40 +02:00
parent 48987fc551
commit 701f14400a
11 changed files with 45 additions and 25 deletions

View File

@@ -1,10 +1,12 @@
@file:JvmName("HistogramJvm")
package org.openrndr.extras.color.statistics
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.ColorBuffer
import kotlin.jvm.JvmName
import kotlin.random.Random
private fun ColorRGBa.binIndex(binCount: Int): Triple<Int, Int, Int> {
internal fun ColorRGBa.binIndex(binCount: Int): Triple<Int, Int, Int> {
val rb = (r * binCount).toInt().coerceIn(0, binCount - 1)
val gb = (g * binCount).toInt().coerceIn(0, binCount - 1)
val bb = (b * binCount).toInt().coerceIn(0, binCount - 1)

View File

@@ -1,3 +1,9 @@
package org.openrndr.extras.color.statistics
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.ColorBuffer
import kotlin.random.Random
fun calculateHistogramRGB(buffer: ColorBuffer,
binCount: Int = 16,
weighting: ColorRGBa.() -> Double = { 1.0 },