How to draw a UIIMage histogram programmatically?

How to draw UIImage image histogram on iPhone programmatically? eg:.

alt text

Thank!

+5
source share
4 answers

Actually there is, I will answer your answer to Brad Larson: fooobar.com/questions/440991 / ...

You can find the GPUImageHistogramFilter class in your library: https://github.com/BradLarson/GPUImage

The demo version of "Filter Showcase" in lib already has a working version of the live histogram analysis. Live histogram analysis

+1
source

There is no api for this.

Edit: The API was introduced with iOS5. See kelin's answer.

, .

: UIImage (Cocoa Touch) CGImage (Core Graphics)?

CoreGraphics UIView.

+2

. vImageHistogramCalculation_ARGB8888(). , vImage_Buffer UIImage. vImageBuffer_InitWithCGImage().

:

Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h

+2

You may be interested in DSBarChart . Give it a try.

0
source

All Articles