hyperion.ng
ImageResampler.h
1 #pragma once
2 
3 #include <utils/VideoMode.h>
4 #include <utils/PixelFormat.h>
5 #include <utils/Image.h>
6 #include <utils/ColorRgb.h>
7 
9 {
10 public:
12  ~ImageResampler();
13 
14  void setHorizontalPixelDecimation(int decimator);
15 
16  void setVerticalPixelDecimation(int decimator);
17 
18  void setCropping(int cropLeft,
19  int cropRight,
20  int cropTop,
21  int cropBottom);
22 
23  void setVideoMode(VideoMode mode);
24 
25  void processImage(const uint8_t * data, int width, int height, int lineLength, PixelFormat pixelFormat, Image<ColorRgb> & outputImage) const;
26 
27 private:
28  static inline uint8_t clamp(int x);
29  static void yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t & r, uint8_t & g, uint8_t & b);
30 
31 private:
32  int _horizontalDecimation;
33  int _verticalDecimation;
34  int _cropLeft;
35  int _cropRight;
36  int _cropTop;
37  int _cropBottom;
38  VideoMode _videoMode;
39 };
Definition: ImageResampler.h:8