minor improvement

This commit is contained in:
minjaesong
2019-05-25 01:11:42 +09:00
parent 2ab1443885
commit 585a20542f
2 changed files with 3 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ This time I removed the TypeProfileLevel part. It now runs slightly faster than
<<append from here>>
*/
//constructor(floatArray: FloatArray) : this(FloatVector.fromArray(SPECIES, floatArray, 0))
constructor(floatArray: FloatArray) : this(FloatVector.fromArray(SPECIES, floatArray, 0))
constructor(r: Float, g: Float, b: Float, a: Float) : this(FloatVector.scalars(SPECIES, r, g, b, a))
constructor(scalar: Float) : this(FloatVector.scalars(SPECIES, scalar, scalar, scalar, scalar))
constructor() : this(FloatVector.zero(SPECIES))

View File

@@ -777,12 +777,8 @@ object LightmapRenderer {
/** To eliminated visible edge on the gradient when 255/1023 is exceeded */
internal fun Cvec.normaliseToHDR(): Cvec {
// equation: hdr(this.coerceIn)
return Cvec(
hdr(this.vec.lane(0).coerceIn(0f, 1f)),
hdr(this.vec.lane(1).coerceIn(0f, 1f)),
hdr(this.vec.lane(2).coerceIn(0f, 1f)),
hdr(this.vec.lane(3).coerceIn(0f, 1f))
)
val arr = this.vec.toArray().map { hdr(it.coerceIn(0f, 1f)) }
return Cvec(arr.toFloatArray())
}
val histogram: Histogram