PageRenderTime 77ms CodeModel.GetById 71ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/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
21#ifndef CONVOLUTIONKERNELS
22#define CONVOLUTIONKERNELS
23
24#include "system.h"
25#include "../../../settings/VideoSettings.h"
26
27class CConvolutionKernel
28{
29  public:
30    CConvolutionKernel(ESCALINGMETHOD method, int size);
31    ~CConvolutionKernel();
32
33    int      GetSize()           { return m_size; }
34    float*   GetFloatPixels()    { return m_floatpixels; }
35    uint8_t* GetIntFractPixels() { return m_intfractpixels; }
36    uint8_t* GetUint8Pixels()    { return m_uint8pixels; }
37
38  private:
39    CConvolutionKernel(const CConvolutionKernel&);
40    CConvolutionKernel& operator=(const CConvolutionKernel&);
41    void Lanczos2();
42    void Lanczos3Fast();
43    void Lanczos3();
44    void Spline36Fast();
45    void Spline36();
46    void Bicubic(double B, double C);
47
48    static double LanczosWeight(double x, double radius);
49    static double Spline36Weight(double x);
50    static double BicubicWeight(double x, double B, double C);
51
52    void ToIntFract();
53    void ToUint8();
54
55    int      m_size;
56    float*   m_floatpixels;
57    uint8_t* m_intfractpixels;
58    uint8_t* m_uint8pixels;
59};
60
61#endif //CONVOLUTIONKERNELS