to top
Android APIs
public class

ProgramStore

extends BaseObj
java.lang.Object
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.ProgramStore

Class Overview

ProgramStore contains a set of parameters that control how the graphics hardware handles writes to the framebuffer. It could be used to:

  • enable/disable depth testing
  • specify wheather depth writes are performed
  • setup various blending modes for use in effects like transparency
  • define write masks for color components written into the framebuffer

Summary

Nested Classes
enum ProgramStore.BlendDstFunc Specifies the functions used to combine incoming pixels with those already in the frame buffer. 
enum ProgramStore.BlendSrcFunc Specifies the functions used to combine incoming pixels with those already in the frame buffer. 
class ProgramStore.Builder Builder class for ProgramStore object. 
enum ProgramStore.DepthFunc Specifies the function used to determine whether a fragment will be drawn during the depth testing stage in the rendering pipeline by comparing its value with that already in the depth buffer. 
Public Methods
static ProgramStore BLEND_ALPHA_DEPTH_NONE(RenderScript rs)
Returns a pre-defined program store object with the following characteristics: - incoming pixels always pass the depth test and their value is not stored in the depth buffer - incoming pixel's value is combined with the stored color (Dest) using the following formula Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A)
static ProgramStore BLEND_ALPHA_DEPTH_TEST(RenderScript rs)
Returns a pre-defined program store object with the following characteristics: - incoming pixels are drawn if their depth value is less than the stored value in the depth buffer.
static ProgramStore BLEND_NONE_DEPTH_NONE(RenderScript rs)
Returns a pre-defined program store object with the following characteristics: - incoming pixels always pass the depth test and their value is not stored in the depth buffer - incoming pixels override the value stored in the color buffer
static ProgramStore BLEND_NONE_DEPTH_TEST(RenderScript rs)
Returns a pre-defined program store object with the following characteristics: - incoming pixels are drawn if their depth value is less than the stored value in the depth buffer.
ProgramStore.BlendDstFunc getBlendDstFunc()
Specifies how the destination blending factor is computed
ProgramStore.BlendSrcFunc getBlendSrcFunc()
Specifies how the source blending factor is computed
ProgramStore.DepthFunc getDepthFunc()
Returns the function used to test writing into the depth buffer
boolean isColorMaskAlphaEnabled()
Queries whether alpha channel is written
boolean isColorMaskBlueEnabled()
Queries whether blue channel is written
boolean isColorMaskGreenEnabled()
Queries whether green channel is written
boolean isColorMaskRedEnabled()
Queries whether red channel is written
boolean isDepthMaskEnabled()
Queries whether writes are enabled into the depth buffer
boolean isDitherEnabled()
Specifies whether colors are dithered before writing into the framebuffer
[Expand]
Inherited Methods
From class android.renderscript.BaseObj
From class java.lang.Object

Public Methods

public static ProgramStore BLEND_ALPHA_DEPTH_NONE (RenderScript rs)

Since: API Level 11

Returns a pre-defined program store object with the following characteristics: - incoming pixels always pass the depth test and their value is not stored in the depth buffer - incoming pixel's value is combined with the stored color (Dest) using the following formula Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A)

Parameters
rs Context to which the program will belong.

public static ProgramStore BLEND_ALPHA_DEPTH_TEST (RenderScript rs)

Since: API Level 11

Returns a pre-defined program store object with the following characteristics: - incoming pixels are drawn if their depth value is less than the stored value in the depth buffer. If the pixel is drawn, its value is also stored in the depth buffer - if the incoming (Source) pixel passes depth test, its value is combined with the stored color (Dest) using the following formula Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A)

Parameters
rs Context to which the program will belong.

public static ProgramStore BLEND_NONE_DEPTH_NONE (RenderScript rs)

Since: API Level 11

Returns a pre-defined program store object with the following characteristics: - incoming pixels always pass the depth test and their value is not stored in the depth buffer - incoming pixels override the value stored in the color buffer

Parameters
rs Context to which the program will belong.

public static ProgramStore BLEND_NONE_DEPTH_TEST (RenderScript rs)

Since: API Level 11

Returns a pre-defined program store object with the following characteristics: - incoming pixels are drawn if their depth value is less than the stored value in the depth buffer. If the pixel is drawn, its value is also stored in the depth buffer - incoming pixels override the value stored in the color buffer if it passes the depth test

Parameters
rs Context to which the program will belong.

public ProgramStore.BlendDstFunc getBlendDstFunc ()

Since: API Level 16

Specifies how the destination blending factor is computed

Returns
  • destination blend function

public ProgramStore.BlendSrcFunc getBlendSrcFunc ()

Since: API Level 16

Specifies how the source blending factor is computed

Returns
  • source blend function

public ProgramStore.DepthFunc getDepthFunc ()

Since: API Level 16

Returns the function used to test writing into the depth buffer

Returns
  • depth function

public boolean isColorMaskAlphaEnabled ()

Since: API Level 16

Queries whether alpha channel is written

Returns
  • alpha channel mask

public boolean isColorMaskBlueEnabled ()

Since: API Level 16

Queries whether blue channel is written

Returns
  • blue color channel mask

public boolean isColorMaskGreenEnabled ()

Since: API Level 16

Queries whether green channel is written

Returns
  • green color channel mask

public boolean isColorMaskRedEnabled ()

Since: API Level 16

Queries whether red channel is written

Returns
  • red color channel mask

public boolean isDepthMaskEnabled ()

Since: API Level 16

Queries whether writes are enabled into the depth buffer

Returns
  • depth mask

public boolean isDitherEnabled ()

Since: API Level 16

Specifies whether colors are dithered before writing into the framebuffer

Returns
  • whether dither is enabled