summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibEDID/VIC.h
blob: 2ccb61ed293b8b2798e5df1d00290f004b1bd7db (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
/*
 * Copyright (c) 2022, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/FixedPoint.h>
#include <AK/Optional.h>
#include <AK/Types.h>

namespace EDID {

class VIC final {
public:
    struct Details {
        enum class ScanType : u8 {
            NonInterlaced,
            Interlaced
        };
        enum class AspectRatio : u8 {
            AR_4_3,
            AR_16_9,
            AR_64_27,
            AR_256_135,
        };

        u8 vic_id;
        u16 horizontal_pixels;
        u16 vertical_lines;
        u32 refresh_rate_millihz;
        ScanType scan_type;
        AspectRatio aspect_ratio;

        FixedPoint<16, u32> refresh_rate_hz() const;
    };

    static Details const* find_details_by_vic_id(u8);
};

}