Most visited

Recently visited

Texture.TextureBuilder

public static class Texture.TextureBuilder
extends Object

java.lang.Object
   ↳ com.viro.core.Texture.TextureBuilder


Builder for creating Texture objects.

Summary

Public constructors

Texture.TextureBuilder()

Public methods

Texture build()

Build the Texture object.

Texture.TextureBuilder data(ByteBuffer data)

Set the raw image data to turn into a Texture.

Texture.TextureBuilder generateMipmaps(boolean generateMipmaps)

Set to true if Viro should generate mipmaps for the image and store them in the Texture.

Texture.TextureBuilder height(int height)

The height of the image stored in data.

Texture.TextureBuilder image(Bitmap image)

Set the Bitmap to turn into a Texture.

Texture.TextureBuilder inputFormat(Texture.Format inputFormat)

The format of the data stored in data.

Texture.TextureBuilder magnificationFilter(Texture.FilterMode magnificationFilter)

Refer to setMagnificationFilter(FilterMode).

Texture.TextureBuilder minificationFilter(Texture.FilterMode minificationFilter)

Refer to setMinificationFilter(FilterMode).

Texture.TextureBuilder mipFilter(Texture.FilterMode mipFilter)

Refer to setMipFilter(FilterMode).

Texture.TextureBuilder nx(Bitmap nx)

Set the Bitmap to use for the left side of the cube.

Texture.TextureBuilder ny(Bitmap ny)

Set the Bitmap to use for the bottom side of the cube.

Texture.TextureBuilder nz(Bitmap nz)

Set the Bitmap to use for the far side of the cube.

Texture.TextureBuilder px(Bitmap px)

Set the Bitmap to use for the right side of the cube.

Texture.TextureBuilder py(Bitmap py)

Set the Bitmap to use for the left side of the cube.

Texture.TextureBuilder pz(Bitmap pz)

Set the Bitmap to use for the far side of the cube.

Texture.TextureBuilder sRGB(boolean sRGB)

Set to true if the image is in a gamma-corrected (sRGB) format.

Texture.TextureBuilder stereoMode(Texture.StereoMode stereoMode)

Set the Texture.StereoMode indicating which half of the image to render to the left eye, and which to render to the right eye.

Texture.TextureBuilder storageFormat(Texture.Format storageFormat)

Set the format in which to store the texture in memory.

Texture.TextureBuilder width(int width)

The width of the image stored in data.

Texture.TextureBuilder wrapS(Texture.WrapMode wrapS)

Refer to setWrapS(WrapMode).

Texture.TextureBuilder wrapT(Texture.WrapMode wrapT)

Refer to setWrapT(WrapMode).

Public constructors

Texture.TextureBuilder

Texture.TextureBuilder ()

Public methods

build

Texture build ()

Build the Texture object.

Returns
Texture The built Texture.

data

Texture.TextureBuilder data (ByteBuffer data)

Set the raw image data to turn into a Texture. This must be a direct ByteBuffer. The image data must start at position 0 in the buffer and end at the buffer's capacity.

Parameters
data ByteBuffer

Returns
Texture.TextureBuilder This builder.

generateMipmaps

Texture.TextureBuilder generateMipmaps (boolean generateMipmaps)

Set to true if Viro should generate mipmaps for the image and store them in the Texture. Mipmapping dramatically improves the visual quality and performance of Textures when they are rendered onto small surfaces.

Parameters
generateMipmaps boolean

Returns
Texture.TextureBuilder This builder.

height

Texture.TextureBuilder height (int height)

The height of the image stored in data.

Parameters
height int

Returns
Texture.TextureBuilder This builder.

image

Texture.TextureBuilder image (Bitmap image)

Set the Bitmap to turn into a Texture.

Parameters
image Bitmap

Returns
Texture.TextureBuilder This builder.

inputFormat

Texture.TextureBuilder inputFormat (Texture.Format inputFormat)

The format of the data stored in data.

Parameters
inputFormat Texture.Format

Returns
Texture.TextureBuilder This builder.

magnificationFilter

Texture.TextureBuilder magnificationFilter (Texture.FilterMode magnificationFilter)

Refer to setMagnificationFilter(FilterMode).

Parameters
magnificationFilter Texture.FilterMode

Returns
Texture.TextureBuilder This builder.

minificationFilter

Texture.TextureBuilder minificationFilter (Texture.FilterMode minificationFilter)

Refer to setMinificationFilter(FilterMode).

Parameters
minificationFilter Texture.FilterMode

Returns
Texture.TextureBuilder This builder.

mipFilter

Texture.TextureBuilder mipFilter (Texture.FilterMode mipFilter)

Refer to setMipFilter(FilterMode).

Parameters
mipFilter Texture.FilterMode

Returns
Texture.TextureBuilder This builder.

nx

Texture.TextureBuilder nx (Bitmap nx)

Set the Bitmap to use for the left side of the cube.

Parameters
nx Bitmap

Returns
Texture.TextureBuilder This builder.

ny

Texture.TextureBuilder ny (Bitmap ny)

Set the Bitmap to use for the bottom side of the cube.

Parameters
ny Bitmap

Returns
Texture.TextureBuilder This builder.

nz

Texture.TextureBuilder nz (Bitmap nz)

Set the Bitmap to use for the far side of the cube.

Parameters
nz Bitmap

Returns
Texture.TextureBuilder This builder.

px

Texture.TextureBuilder px (Bitmap px)

Set the Bitmap to use for the right side of the cube.

Parameters
px Bitmap

Returns
Texture.TextureBuilder This builder.

py

Texture.TextureBuilder py (Bitmap py)

Set the Bitmap to use for the left side of the cube.

Parameters
py Bitmap

Returns
Texture.TextureBuilder This builder.

pz

Texture.TextureBuilder pz (Bitmap pz)

Set the Bitmap to use for the far side of the cube.

Parameters
pz Bitmap

Returns
Texture.TextureBuilder This builder.

sRGB

Texture.TextureBuilder sRGB (boolean sRGB)

Set to true if the image is in a gamma-corrected (sRGB) format. If true, Viro will linearize the texture during shading computations. This option should generally be set to true for diffuse and specular images, and false for non-visual images like normal maps.

Parameters
sRGB boolean

Returns
Texture.TextureBuilder This builder.

stereoMode

Texture.TextureBuilder stereoMode (Texture.StereoMode stereoMode)

Set the Texture.StereoMode indicating which half of the image to render to the left eye, and which to render to the right eye. Null if the image is not stereo.

Parameters
stereoMode Texture.StereoMode

Returns
Texture.TextureBuilder This builder.

storageFormat

Texture.TextureBuilder storageFormat (Texture.Format storageFormat)

Set the format in which to store the texture in memory.

Parameters
storageFormat Texture.Format

Returns
Texture.TextureBuilder This builder.

width

Texture.TextureBuilder width (int width)

The width of the image stored in data.

Parameters
width int

Returns
Texture.TextureBuilder This builder.

wrapS

Texture.TextureBuilder wrapS (Texture.WrapMode wrapS)

Refer to setWrapS(WrapMode).

Parameters
wrapS Texture.WrapMode

Returns
Texture.TextureBuilder This builder.

wrapT

Texture.TextureBuilder wrapT (Texture.WrapMode wrapT)

Refer to setWrapT(WrapMode).

Parameters
wrapT Texture.WrapMode

Returns
Texture.TextureBuilder This builder.

Hooray!