FileDocCategorySizeDatePackage
Sampler.javaAPI DocAndroid 5.1 API10791Thu Mar 12 22:22:56 GMT 2015android.support.v8.renderscript

Sampler

public class Sampler extends BaseObj
Sampler object that defines how Allocations can be read as textures within a kernel. Samplers are used in conjunction with the {@code rsSample} runtime function to return values from normalized coordinates. Any Allocation used with a Sampler must have been created with {@link android.support.v8.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE}; using a Sampler on an {@link android.support.v8.renderscript.Allocation} that was not created with {@link android.support.v8.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} is undefined.

Fields Summary
Value
mMin
Value
mMag
Value
mWrapS
Value
mWrapT
Value
mWrapR
float
mAniso
Constructors Summary
Sampler(int id, RenderScript rs)

        super(id, rs);
    
Methods Summary
public static android.support.v8.renderscript.SamplerCLAMP_LINEAR(RenderScript rs)
Retrieve a sampler with min and mag set to linear and wrap modes set to clamp.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_CLAMP_LINEAR == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.LINEAR);
            b.setMagnification(Value.LINEAR);
            b.setWrapS(Value.CLAMP);
            b.setWrapT(Value.CLAMP);
            rs.mSampler_CLAMP_LINEAR = b.create();
        }
        return rs.mSampler_CLAMP_LINEAR;
    
public static android.support.v8.renderscript.SamplerCLAMP_LINEAR_MIP_LINEAR(RenderScript rs)
Retrieve a sampler with mag set to linear, min linear mipmap linear, and wrap modes set to clamp.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_CLAMP_LINEAR_MIP_LINEAR == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.LINEAR_MIP_LINEAR);
            b.setMagnification(Value.LINEAR);
            b.setWrapS(Value.CLAMP);
            b.setWrapT(Value.CLAMP);
            rs.mSampler_CLAMP_LINEAR_MIP_LINEAR = b.create();
        }
        return rs.mSampler_CLAMP_LINEAR_MIP_LINEAR;
    
public static android.support.v8.renderscript.SamplerCLAMP_NEAREST(RenderScript rs)
Retrieve a sampler with min and mag set to nearest and wrap modes set to clamp.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_CLAMP_NEAREST == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.NEAREST);
            b.setMagnification(Value.NEAREST);
            b.setWrapS(Value.CLAMP);
            b.setWrapT(Value.CLAMP);
            rs.mSampler_CLAMP_NEAREST = b.create();
        }
        return rs.mSampler_CLAMP_NEAREST;
    
public static android.support.v8.renderscript.SamplerMIRRORED_REPEAT_LINEAR(RenderScript rs)
Retrieve a sampler with min and mag set to linear and wrap modes set to mirrored repeat.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_MIRRORED_REPEAT_LINEAR == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.LINEAR);
            b.setMagnification(Value.LINEAR);
            b.setWrapS(Value.MIRRORED_REPEAT);
            b.setWrapT(Value.MIRRORED_REPEAT);
            rs.mSampler_MIRRORED_REPEAT_LINEAR = b.create();
        }
        return rs.mSampler_MIRRORED_REPEAT_LINEAR;
    
public static android.support.v8.renderscript.SamplerMIRRORED_REPEAT_NEAREST(RenderScript rs)
Retrieve a sampler with min and mag set to nearest and wrap modes set to mirrored repeat.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_MIRRORED_REPEAT_NEAREST == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.NEAREST);
            b.setMagnification(Value.NEAREST);
            b.setWrapS(Value.MIRRORED_REPEAT);
            b.setWrapT(Value.MIRRORED_REPEAT);
            rs.mSampler_MIRRORED_REPEAT_NEAREST = b.create();
        }
        return rs.mSampler_MIRRORED_REPEAT_NEAREST;
    
public static android.support.v8.renderscript.SamplerWRAP_LINEAR(RenderScript rs)
Retrieve a sampler with min and mag set to linear and wrap modes set to wrap.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_WRAP_LINEAR == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.LINEAR);
            b.setMagnification(Value.LINEAR);
            b.setWrapS(Value.WRAP);
            b.setWrapT(Value.WRAP);
            rs.mSampler_WRAP_LINEAR = b.create();
        }
        return rs.mSampler_WRAP_LINEAR;
    
public static android.support.v8.renderscript.SamplerWRAP_LINEAR_MIP_LINEAR(RenderScript rs)
Retrieve a sampler with mag set to linear, min linear mipmap linear, and wrap modes set to wrap.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_WRAP_LINEAR_MIP_LINEAR == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.LINEAR_MIP_LINEAR);
            b.setMagnification(Value.LINEAR);
            b.setWrapS(Value.WRAP);
            b.setWrapT(Value.WRAP);
            rs.mSampler_WRAP_LINEAR_MIP_LINEAR = b.create();
        }
        return rs.mSampler_WRAP_LINEAR_MIP_LINEAR;
    
public static android.support.v8.renderscript.SamplerWRAP_NEAREST(RenderScript rs)
Retrieve a sampler with min and mag set to nearest and wrap modes set to wrap.

param
rs Context to which the sampler will belong.
return
Sampler

        if(rs.mSampler_WRAP_NEAREST == null) {
            Builder b = new Builder(rs);
            b.setMinification(Value.NEAREST);
            b.setMagnification(Value.NEAREST);
            b.setWrapS(Value.WRAP);
            b.setWrapT(Value.WRAP);
            rs.mSampler_WRAP_NEAREST = b.create();
        }
        return rs.mSampler_WRAP_NEAREST;
    
public floatgetAnisotropy()

return
anisotropy setting for the sampler

        return mAniso;
    
public android.support.v8.renderscript.Sampler$ValuegetMagnification()

return
magnification setting for the sampler

        return mMag;
    
public android.support.v8.renderscript.Sampler$ValuegetMinification()

return
minification setting for the sampler

        return mMin;
    
public android.support.v8.renderscript.Sampler$ValuegetWrapS()

return
S wrapping mode for the sampler

        return mWrapS;
    
public android.support.v8.renderscript.Sampler$ValuegetWrapT()

return
T wrapping mode for the sampler

        return mWrapT;