/xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h

http://github.com/xbmc/xbmc · C++ Header · 61 lines · 33 code · 9 blank · 19 comment · 0 complexity · 7cadf95b2df933494b02eed462b8e16a MD5 · raw file

  1. /*
  2. * Copyright (C) 2005-2013 Team XBMC
  3. * http://xbmc.org
  4. *
  5. * This Program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2, or (at your option)
  8. * any later version.
  9. *
  10. * This Program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with XBMC; see the file COPYING. If not, see
  17. * <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #ifndef CONVOLUTIONKERNELS
  21. #define CONVOLUTIONKERNELS
  22. #include "system.h"
  23. #include "../../../settings/VideoSettings.h"
  24. class CConvolutionKernel
  25. {
  26. public:
  27. CConvolutionKernel(ESCALINGMETHOD method, int size);
  28. ~CConvolutionKernel();
  29. int GetSize() { return m_size; }
  30. float* GetFloatPixels() { return m_floatpixels; }
  31. uint8_t* GetIntFractPixels() { return m_intfractpixels; }
  32. uint8_t* GetUint8Pixels() { return m_uint8pixels; }
  33. private:
  34. CConvolutionKernel(const CConvolutionKernel&);
  35. CConvolutionKernel& operator=(const CConvolutionKernel&);
  36. void Lanczos2();
  37. void Lanczos3Fast();
  38. void Lanczos3();
  39. void Spline36Fast();
  40. void Spline36();
  41. void Bicubic(double B, double C);
  42. static double LanczosWeight(double x, double radius);
  43. static double Spline36Weight(double x);
  44. static double BicubicWeight(double x, double B, double C);
  45. void ToIntFract();
  46. void ToUint8();
  47. int m_size;
  48. float* m_floatpixels;
  49. uint8_t* m_intfractpixels;
  50. uint8_t* m_uint8pixels;
  51. };
  52. #endif //CONVOLUTIONKERNELS