kodi
RenderUtils.h
1 /*
2  * Copyright (C) 2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "cores/GameSettings.h"
12 #include "utils/Geometry.h"
13 
14 #include <array>
15 
16 namespace KODI
17 {
18 namespace RETRO
19 {
21 {
22 public:
23  static void CalculateStretchMode(STRETCHMODE stretchMode,
24  unsigned int rotationDegCCW,
25  unsigned int sourceWidth,
26  unsigned int sourceHeight,
27  float screenWidth,
28  float screenHeight,
29  float& pixelRatio,
30  float& zoomAmount);
31 
32  static void CalcNormalRenderRect(const CRect& viewRect,
33  float outputFrameRatio,
34  float zoomAmount,
35  CRect& destRect);
36 
37  static void ClipRect(const CRect& viewRect, CRect& sourceRect, CRect& destRect);
38 
39  static void CropSource(CRect& sourceRect,
40  unsigned int rotationDegCCW,
41  float viewWidth,
42  float viewHeight,
43  float sourceWidth,
44  float sourceHeight,
45  float destWidth,
46  float destHeight);
47 
48  static std::array<CPoint, 4> ReorderDrawPoints(const CRect& destRect,
49  unsigned int orientationDegCCW);
50 };
51 } // namespace RETRO
52 } // namespace KODI
Definition: AudioDecoder.h:18
STRETCHMODE
Methods for stretching the game to the viewing area.
Definition: GameSettings.h:29
Definition: RenderUtils.h:20