19 #ifndef PAGESPEED_KERNEL_IMAGE_IMAGE_ANALYSIS_H_
20 #define PAGESPEED_KERNEL_IMAGE_IMAGE_ANALYSIS_H_
26 namespace net_instaweb {
32 namespace image_compression {
34 class ScanlineReaderInterface;
37 const int kNumColorHistogramBins = 256;
49 bool SobelGradient(
const uint8_t* image,
int width,
int height,
50 int bytes_per_line, PixelFormat pixel_format,
51 MessageHandler* handler, uint8_t* gradient);
58 void Histogram(
const uint8_t* image,
int width,
int height,
int bytes_per_line,
59 int x0,
int y0,
float* hist);
69 float PhotoMetric(
const uint8_t* image,
int width,
int height,
70 int bytes_per_line, PixelFormat pixel_format,
float threshold,
71 MessageHandler* handler);
76 float WidestPeakWidth(
const float* hist,
float threshold);
81 bool IsPhoto(ScanlineReaderInterface* reader, MessageHandler* handler);
89 bool AnalyzeImage(ImageFormat image_type,
90 const void* image_buffer,
96 bool* has_transparency,
99 ScanlineReaderInterface** reader,
100 MessageHandler* handler);
Definition: message_handler.h:39