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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Type.Builder\n\nAdded in [API level 11](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\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/renderscript/Type.Builder \"View this page in Java\") \n\n```\nopen class Builder\n```\n\n|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.renderscript.Type.Builder](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 31.**\n|\n| Deprecated in Java.\n\nBuilder class for Type.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(android.renderscript.RenderScript,%20android.renderscript.Element))`(`rs:` `[RenderScript](/reference/kotlin/android/renderscript/RenderScript)!`, `e:` `[Element](/reference/kotlin/android/renderscript/Element)!`)` Create a new builder object. |\n\n| Public methods ||\n|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Type](/reference/kotlin/android/renderscript/Type)! | [create](#create())`()` Validate structure and create a new Type. |\n| open [Type.Builder](#)! | [setFaces](#setFaces(kotlin.Boolean))`(`value:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` \u003cbr /\u003e |\n| open [Type.Builder](#)! | [setMipmaps](#setMipmaps(kotlin.Boolean))`(`value:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` \u003cbr /\u003e |\n| open [Type.Builder](#)! | [setX](#setX(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Add a dimension to the Type. |\n| open [Type.Builder](#)! | [setY](#setY(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e |\n| open [Type.Builder](#)! | [setYuvFormat](#setYuvFormat(kotlin.Int))`(`yuvFormat:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set the YUV layout for a Type. |\n| open [Type.Builder](#)! | [setZ](#setZ(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(\n rs: RenderScript!, \n e: Element!)\n```\n\nCreate a new builder object.\n\n| Parameters ||\n|------|-----------------------------------------------------------------------------------------------------|\n| `rs` | [RenderScript](/reference/kotlin/android/renderscript/RenderScript)!: |\n| `e` | [Element](/reference/kotlin/android/renderscript/Element)!: The element for the type to be created. |\n\nPublic methods\n--------------\n\n### create\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun create(): Type!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nValidate structure and create a new Type.\n\n| Return ||\n|------------------------------------------------------|------|\n| [Type](/reference/kotlin/android/renderscript/Type)! | Type |\n\n### setFaces\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setFaces(value: Boolean): Type.Builder!\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### setMipmaps\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setMipmaps(value: Boolean): Type.Builder!\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### setX\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setX(value: Int): Type.Builder!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nAdd a dimension to the Type.\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------|\n| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): |\n\n### setY\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setY(value: Int): Type.Builder!\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### setYuvFormat\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\n```\nopen fun setYuvFormat(yuvFormat: Int): Type.Builder!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nSet the YUV layout for a Type.\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `yuvFormat` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): [android.graphics.ImageFormat#YV12](../graphics/ImageFormat.html#YV12:kotlin.Int), [android.graphics.ImageFormat#NV21](../graphics/ImageFormat.html#NV21:kotlin.Int), or [android.graphics.ImageFormat#YUV_420_888](../graphics/ImageFormat.html#YUV_420_888:kotlin.Int). |\n\n### setZ\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\n```\nopen fun setZ(value: Int): Type.Builder!\n```\n\n**Deprecated:** *Deprecated in Java.*"]]