Android-UltimateGPUImage
Android-UltimateGPUImage copied to clipboard
How can I use this to manipulate Image?
Hi,
I would like to ask how can I use this lib to manipulate image (brightness, contrast, etc..) as in the original android-gpuimage
project. For example, I used to do this:
mGPUImage = new GPUImage(mContext);
mGPUImage.setGLSurfaceView(mSurface);
mGPUImage.setScaleType(GPUImage.ScaleType.CENTER_INSIDE);
mGPUImage.setImage(mUri);
final GPUImageContrastFilter contrastFilter = new GPUImageContrastFilter(1.0f);
mGPUImage.setFilter(contrastFilter);
.....
contrastFilter.setContrast(contrastValue);
mGPUImage.requestRender();
However, after digging around the lib, I can't find GPUImage
anywhere.
Another question, I'm looking for another lib mostly because of this unresolved bug. I would like to ask is this fixed with this current release?
Thank you so much for your time.
oops, i haven't notice it. ;p thx for you bug report. sure there is a bug here. I think I just reconstruct the original project but seem forgot to forge the pure image operate. This problem will fix in next release. So, if u want to use this lib to render a single image, i suggest u use original project, or wait my next release. For now, this project can only handle condition with using camera state. ;p ;p
Now I'm handle this problem.
done, now u can use this like:
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
// prepare surface.
mRecorderViews = (FilterRecoderView) findViewById(R.id.vp_video_recorder_gl);
// prepare the filter you want to use
final GPUImageContrastFilter contrastFilter = new GPUImageContrastFilter(1.0f);
contrastFilter.setContrast(contrastValue);
// bind to PureImageManager and render
PureImageManager.init(context)
.setGLSurfaceView(mRecorderViews)
.setScaleType(GPUImage.ScaleType.CENTER_INSIDE)
.setImage(mUri)
.setFilter(contrastFilter)
.requestRender();
}
Hi @Windsander appreciate your above code help I used your code but shows the BLACK SCREEN. Can you please help me to solve this problem? or Can you give any demo project link for the same? Waiting for your reply.
Ohly, this is a problem. when I finish my work in hand, I will try to solve it. Thx for report. :)