Intrinsic for converting RGB to RGBA by using a 3D lookup table. The incoming r,g,b values are use as normalized x,y,z coordinates into a 3D allocation. The 8 nearest values are sampled and linearly interpolated. The result is placed in the output.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ScriptIntrinsic3DLUT\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nScriptIntrinsic3DLUT\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/renderscript/ScriptIntrinsic3DLUT \"View this page in Java\") \n\n```\nclass ScriptIntrinsic3DLUT : ScriptIntrinsic\n```\n\n|---|---|---|---|------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||||\n| ↳ | [android.renderscript.BaseObj](/reference/kotlin/android/renderscript/BaseObj) ||||\n| | ↳ | [android.renderscript.Script](/reference/kotlin/android/renderscript/Script) |||\n| | | ↳ | [android.renderscript.ScriptIntrinsic](/reference/kotlin/android/renderscript/ScriptIntrinsic) ||\n| | | | ↳ | [android.renderscript.ScriptIntrinsic3DLUT](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 31.**\n|\n| Renderscript has been deprecated in API level 31. Please refer to the [migration guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.\n\nIntrinsic for converting RGB to RGBA by using a 3D lookup table. The incoming r,g,b values are use as normalized x,y,z coordinates into a 3D allocation. The 8 nearest values are sampled and linearly interpolated. The result is placed in the output.\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [ScriptIntrinsic3DLUT](#)! | [create](#create(android.renderscript.RenderScript,%20android.renderscript.Element))`(`rs:` `[RenderScript](/reference/kotlin/android/renderscript/RenderScript)!`, `e:` `[Element](/reference/kotlin/android/renderscript/Element)!`)` Supported elements types are [Element.U8_4](/reference/kotlin/android/renderscript/Element#U8_4(android.renderscript.RenderScript)) The defaults tables are identity. |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [forEach](#forEach(android.renderscript.Allocation,%20android.renderscript.Allocation))`(`ain:` `[Allocation](/reference/kotlin/android/renderscript/Allocation)!`, `aout:` `[Allocation](/reference/kotlin/android/renderscript/Allocation)!`)` Invoke the kernel and apply the lookup to each cell of ain and copy to aout. |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [forEach](#forEach(android.renderscript.Allocation,%20android.renderscript.Allocation,%20android.renderscript.Script.LaunchOptions))`(`ain:` `[Allocation](/reference/kotlin/android/renderscript/Allocation)!`, `aout:` `[Allocation](/reference/kotlin/android/renderscript/Allocation)!`, `opt:` `[Script.LaunchOptions](/reference/kotlin/android/renderscript/Script.LaunchOptions)!`)` Invoke the kernel and apply the lookup to each cell of ain and copy to aout. |\n| [Script.KernelID](/reference/kotlin/android/renderscript/Script.KernelID)! | [getKernelID](#getKernelID())`()` Get a KernelID for this intrinsic kernel. |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setLUT](#setLUT(android.renderscript.Allocation))`(`lut:` `[Allocation](/reference/kotlin/android/renderscript/Allocation)!`)` Sets the [android.renderscript.Allocation](/reference/kotlin/android/renderscript/Allocation) to be used as the lookup table. |\n\nPublic methods\n--------------\n\n### create\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun create(\n rs: RenderScript!, \n e: Element!\n): ScriptIntrinsic3DLUT!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nSupported elements types are [Element.U8_4](/reference/kotlin/android/renderscript/Element#U8_4(android.renderscript.RenderScript)) The defaults tables are identity.\n\n| Parameters ||\n|------|--------------------------------------------------------------------------------------------------|\n| `rs` | [RenderScript](/reference/kotlin/android/renderscript/RenderScript)!: The RenderScript context |\n| `e` | [Element](/reference/kotlin/android/renderscript/Element)!: Element type for intputs and outputs |\n\n| Return ||\n|----------------------------|----------------------|\n| [ScriptIntrinsic3DLUT](#)! | ScriptIntrinsic3DLUT |\n\n### forEach\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun forEach(\n ain: Allocation!, \n aout: Allocation!\n): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nInvoke the kernel and apply the lookup to each cell of ain and copy to aout.\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------|\n| `ain` | [Allocation](/reference/kotlin/android/renderscript/Allocation)!: Input allocation |\n| `aout` | [Allocation](/reference/kotlin/android/renderscript/Allocation)!: Output allocation |\n\n### forEach\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun forEach(\n ain: Allocation!, \n aout: Allocation!, \n opt: Script.LaunchOptions!\n): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nInvoke the kernel and apply the lookup to each cell of ain and copy to aout.\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------|\n| `ain` | [Allocation](/reference/kotlin/android/renderscript/Allocation)!: Input allocation |\n| `aout` | [Allocation](/reference/kotlin/android/renderscript/Allocation)!: Output allocation |\n| `opt` | [Script.LaunchOptions](/reference/kotlin/android/renderscript/Script.LaunchOptions)!: Launch options for kernel |\n\n### getKernelID\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getKernelID(): Script.KernelID!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nGet a KernelID for this intrinsic kernel.\n\n| Return ||\n|----------------------------------------------------------------------------|--------------------------------------|\n| [Script.KernelID](/reference/kotlin/android/renderscript/Script.KernelID)! | Script.KernelID The KernelID object. |\n\n### setLUT\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setLUT(lut: Allocation!): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nSets the [android.renderscript.Allocation](/reference/kotlin/android/renderscript/Allocation) to be used as the lookup table. The lookup table must use the same [android.renderscript.Element](/reference/kotlin/android/renderscript/Element) as the intrinsic."]]