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;