سؤال

I am using GPUImage in my photo app to make some image filter options. In the app, there is an option to add multiple filters while capture an image, so to handle multiple filters, I have used GPUImageFilterPipeline. Every filter effect, those I have added, works well on pipeline except GPUImageHistogramFilter. I know that GPUImageHistogramFilter need more steps when compare to other filters(as mentioned here). But this is not working on pipeline. How to make histogram with GPUImageFilterPipeline?

هل كانت مفيدة؟

المحلول

A GPUImageHistogramFilter doesn't operate like a normal filter, and you can't use its output directly. It sends out a 3x256 texture containing the RGB channel histogram, but you need some way of parsing that for display. You won't be able to set that up in a GPUImageFilterPipeline construct.

Instead, you'll want to set up your filter pipeline manually, following the example provided in the FilterShowcase sample application (or my steps in the answer you link above). I use a histogram generator to create the overlay you see in the example there, and there's no easy way to set that up with a GPUImageFilterPipeline.

Also, I'd personally recommend not using the GPUImageFilterPipeline, since I don't maintain that class. It was contributed by a couple of other people, but I don't use it for anything myself and it has a tendency to break. I'd instead just create your filter chain yourself or place things within a GPUImageFilterGroup if you need to organize filter subunits.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top