use of android.filterfw.core.ShaderProgram in project android_frameworks_base by ParanoidAndroid.
the class TintFilter method initProgram.
public void initProgram(FilterContext context, int target) {
switch(target) {
case FrameFormat.TARGET_GPU:
ShaderProgram shaderProgram = new ShaderProgram(context, mTintShader);
shaderProgram.setMaximumTileSize(mTileSize);
mProgram = shaderProgram;
break;
default:
throw new RuntimeException("Filter Sharpen does not support frames of " + "target " + target + "!");
}
mTarget = target;
}
use of android.filterfw.core.ShaderProgram in project android_frameworks_base by ParanoidAndroid.
the class ToGrayFilter method getShaderProgram.
@Override
protected Program getShaderProgram(FilterContext context) {
int inputChannels = getInputFormat("image").getBytesPerSample();
if (inputChannels != 4) {
throw new RuntimeException("Unsupported GL input channels: " + inputChannels + "! Channels must be 4!");
}
ShaderProgram program = new ShaderProgram(context, mColorToGray4Shader);
program.setMaximumTileSize(mTileSize);
if (mInvertSource)
program.setSourceRect(0.0f, 1.0f, 1.0f, -1.0f);
return program;
}
use of android.filterfw.core.ShaderProgram in project android_frameworks_base by ParanoidAndroid.
the class PosterizeFilter method initProgram.
public void initProgram(FilterContext context, int target) {
switch(target) {
case FrameFormat.TARGET_GPU:
ShaderProgram shaderProgram = new ShaderProgram(context, mPosterizeShader);
shaderProgram.setMaximumTileSize(mTileSize);
mProgram = shaderProgram;
break;
default:
throw new RuntimeException("Filter Sharpen does not support frames of " + "target " + target + "!");
}
mTarget = target;
}
use of android.filterfw.core.ShaderProgram in project android_frameworks_base by ParanoidAndroid.
the class RedEyeFilter method initProgram.
public void initProgram(FilterContext context, int target) {
switch(target) {
case FrameFormat.TARGET_GPU:
ShaderProgram shaderProgram = new ShaderProgram(context, mRedEyeShader);
shaderProgram.setMaximumTileSize(mTileSize);
mProgram = shaderProgram;
mProgram.setHostValue("intensity", DEFAULT_RED_INTENSITY);
break;
default:
throw new RuntimeException("Filter RedEye does not support frames of " + "target " + target + "!");
}
mTarget = target;
}
use of android.filterfw.core.ShaderProgram in project android_frameworks_base by ParanoidAndroid.
the class RotateFilter method initProgram.
public void initProgram(FilterContext context, int target) {
switch(target) {
case FrameFormat.TARGET_GPU:
ShaderProgram shaderProgram = ShaderProgram.createIdentity(context);
shaderProgram.setMaximumTileSize(mTileSize);
shaderProgram.setClearsOutput(true);
mProgram = shaderProgram;
break;
default:
throw new RuntimeException("Filter Sharpen does not support frames of " + "target " + target + "!");
}
mTarget = target;
}
Aggregations