class Lut(val dimension: Int = 16)
// initialize lut
val lut = Lut()
for (r in 0..15) {
for (g in 0..15) {
for (b in 0..15) {
// set a mapping color for each RGB value in the (0-15)^3 range
lut.setMapping(r, g, b, r * 4 + r / 4, g * 4 + g / 4, b * 4 + b / 4)
}
}
}
// alternatively, for a simple scaling, you can use `Lut.fromScale(Vector3)`
val lut = Lut.fromScale(Vector3(0.25f))
// loading from a bitmap is possible too
val lut = Lut.fromBitmap(BitmapFactory.decodeFile("lut.png"))
// finally, apply it to the passthrough
scene.setPassthroughLUT(lut)
| Name | Summary |
|---|---|
Lut | constructor(dimension: Int = 16) |
| Name | Summary |
|---|---|
Companion | object Companion |
| Name | Summary |
|---|---|
dimension | val dimension: Int = 16 The dimension of the LUT (16 or 32), defaults to 16. |
| Name | Summary |
|---|---|
getTable | fun getTable(): IntArray Returns a 1D array representation of the 3D color lookup table. |
setMapping | fun setMapping(srcR: Int, srcG: Int, srcB: Int, toR: Int, toG: Int, toB: Int) Sets a specific RGB to be set to a different RGB value in the LUT. |
object Companion
| Name | Summary |
|---|---|
fromBitmap | fun fromBitmap(bitmap: <Error class: unknown class>): Lut? Creates a LUT object from a Bitmap loaded from disk. |
fromScale | fun fromScale(scale: Vector3): Lut Creates a LUT where RGB are scaled component-wise by the given XYZ scale. |