Android-UltimateGPUImage icon indicating copy to clipboard operation
Android-UltimateGPUImage copied to clipboard

How can I use this to manipulate Image?

Open vxhviet opened this issue 7 years ago • 5 comments

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.

vxhviet avatar Apr 12 '17 09:04 vxhviet

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

Windsander avatar Apr 13 '17 06:04 Windsander

Now I'm handle this problem.

Windsander avatar Apr 22 '17 06:04 Windsander

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();
}

Windsander avatar Apr 22 '17 07:04 Windsander

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.

AuxanoWeb avatar Aug 22 '17 13:08 AuxanoWeb

Ohly, this is a problem. when I finish my work in hand, I will try to solve it. Thx for report. :)

Windsander avatar Sep 06 '17 02:09 Windsander