Open yungs2017 opened 7 years ago
我在c++代码中想使用“色彩平衡”和“CGEColorLevelFilter”这两个滤镜,尝试了都没有成功,下面是我的代码: CGE::CGEImageHandlerAndroid handler; CGE::CGEColorLevelFilter f = new CGE::CGEColorLevelFilter(); f->setGamma(2.f); f->setLevel(0.2f,0.6f); CGESharedGLContext glContext = CGESharedGLContext::create(); glContext->makecurrent(); f->init(); handler.initWithBitmap(env, emBitmap); handler.addImageFilter(f); handler.processingFilters(); //Run the filters. jobject resultBitmap = handler.getResultBitmap(env); delete glContext; return resultBitmap;
这种方法使用我自定义的滤镜可以成功,使用filter下面的滤镜是否还要其他的事项?谢谢
context放到handler之前
尝试了各种顺序,都没有执行成功😂😂😂
context创建和makecurrent放到你这几句最前面
以及两次set应该在init之后,建议写代码之前先看看例子
我在c++代码中想使用“色彩平衡”和“CGEColorLevelFilter”这两个滤镜,尝试了都没有成功,下面是我的代码: CGE::CGEImageHandlerAndroid handler; CGE::CGEColorLevelFilter f = new CGE::CGEColorLevelFilter(); f->setGamma(2.f); f->setLevel(0.2f,0.6f); CGESharedGLContext glContext = CGESharedGLContext::create(); glContext->makecurrent(); f->init(); handler.initWithBitmap(env, emBitmap); handler.addImageFilter(f); handler.processingFilters(); //Run the filters. jobject resultBitmap = handler.getResultBitmap(env); delete glContext; return resultBitmap;
这种方法使用我自定义的滤镜可以成功,使用filter下面的滤镜是否还要其他的事项?谢谢