Upgrade to Kotlin 1.4, Gradle 6.6
This commit is contained in:
@@ -70,9 +70,9 @@ fun ColorBuffer.toPlanarU8() : Planar<GrayU8> {
|
||||
for (y in 0 until height) {
|
||||
for (x in 0 until width) {
|
||||
val c = shadow.read(x, y)
|
||||
bands[0].data[offset] = (c.r * 255).toByte()
|
||||
bands[1].data[offset] = (c.g * 255).toByte()
|
||||
bands[2].data[offset] = (c.b * 255).toByte()
|
||||
bands[0].data[offset] = (c.r * 255).toInt().toByte()
|
||||
bands[1].data[offset] = (c.g * 255).toInt().toByte()
|
||||
bands[2].data[offset] = (c.b * 255).toInt().toByte()
|
||||
offset++
|
||||
}
|
||||
}
|
||||
|
||||
19
orx-boofcv/src/main/kotlin/MatrixConversion.kt
Normal file
19
orx-boofcv/src/main/kotlin/MatrixConversion.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package org.openrndr.boofcv.binding
|
||||
|
||||
import georegression.struct.affine.Affine2D_F32
|
||||
import georegression.struct.affine.Affine2D_F64
|
||||
import org.openrndr.math.Matrix44
|
||||
|
||||
fun Affine2D_F32.toMatrix44() = Matrix44(
|
||||
c0r0 = a11.toDouble(), c1r0 = a12.toDouble(), c3r0 = tx.toDouble(),
|
||||
c0r1 = a21.toDouble(), c1r1 = a22.toDouble(), c3r1 = ty.toDouble(),
|
||||
c2r2 = 1.0,
|
||||
c3r3 = 1.0
|
||||
)
|
||||
|
||||
fun Affine2D_F64.toMatrix44() = Matrix44(
|
||||
c0r0 = a11, c1r0 = a12, c3r0 = tx,
|
||||
c0r1 = a21, c1r1 = a22, c3r1 = ty,
|
||||
c2r2 = 1.0,
|
||||
c3r3 = 1.0
|
||||
)
|
||||
Reference in New Issue
Block a user