summaryrefslogtreecommitdiffhomepage
path: root/src/modules/CoreGfx/CoreAccess.h
blob: b5928d8fb211a79c2d8a198719b7d0620ce9ed0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* ========================================

  Copyright Amlal El Mahrouss.

======================================== */

#ifndef CORE_GFX_ACCESSIBILITY_H
#define CORE_GFX_ACCESSIBILITY_H

#include <ArchKit/ArchKit.h>
#include <KernelKit/KPC.h>
#include <NeKit/NeKit.h>
#include <modules/CoreGfx/CoreGfx.h>
#include <modules/CoreGfx/MathGfx.h>

namespace FB {
using namespace Kernel;

template <SizeT N, typename NType>
struct CGVec;
class CGAccessibility;

/// @brief Video Accessbility Helper.
/// Use this when dealing with video diemensions.
class CGAccessibilty final {
  explicit CGAccessibilty() = default;
  ~CGAccessibilty()         = default;

 public:
  NE_COPY_DELETE(CGAccessibilty)

  static UInt64 Width() { return kHandoverHeader->f_GOP.f_Width; }

  static UInt64 Height() { return kHandoverHeader->f_GOP.f_Height; }
};

template <SizeT N, typename NType>
struct CGVec final {
  NType fVec[N]    = {};
  explicit CGVec() = default;
  ~CGVec()         = default;
  NE_COPY_DEFAULT(CGVec)

  NType& operator[](const SizeT& i) {
    MUST_PASS(i < N);
    return fVec[i];
  }
};

using CGVec3U64 = CGVec<3, UInt64>;
}  // namespace FB

#endif  // !CORE_GFX_ACCESSIBILITY_H_