#parser #edid #data #data-source #io #monitor #methods

无std edid-rs

一个具有无std支持的EDID解析crate

1个不稳定版本

0.1.0 2019年7月25日

#2605Rust模式

Download history 876/week @ 2024-03-14 1143/week @ 2024-03-21 1296/week @ 2024-03-28 1021/week @ 2024-04-04 858/week @ 2024-04-11 1487/week @ 2024-04-18 929/week @ 2024-04-25 1029/week @ 2024-05-02 1109/week @ 2024-05-09 948/week @ 2024-05-16 843/week @ 2024-05-23 892/week @ 2024-05-30 700/week @ 2024-06-06 740/week @ 2024-06-13 818/week @ 2024-06-20 850/week @ 2024-06-27

3,295 每月下载量
用于 2 crates

Apache-2.0/MIT

38KB
763 代码行

edid-rs

edid-rs edid-rs

一个支持无std的纯Rust库,用于解析EDID数据。此crate不包含从显示器获取数据的方法。

要启用无std支持,请确保alloc crate可用,使用功能无std,然后实现edid_rs::Read而不是std::io::Read来为数据源提供数据。

MIT和Apache-2.0双许可。

示例

基本用法

extern crate edid_rs;

use std::io::Cursor;

fn main() {
    let bytes = vec![...];
    println!("{:?}",
        edid_rs::parse(&mut Cursor::new(bytes))
    );
}

在OSX上读取当前显示器的EDID

$ ioreg -l -w0 -d0 -r -c AppleBacklightDisplay | grep IODisplayEDID - | tail -c 258 | head -c 256 | xxd -r -p | cargo run --example stdin
   Compiling edid-rs v0.1.0 (../edid)
    Finished dev [unoptimized + debuginfo] target(s) in 0.39s
     Running `target/debug/examples/stdin`
Ok(EDID { product: ProductInformation { manufacturer_id: ManufacturerID('\u{4}', '\u{0}', '\u{6}'), product_code: 40994, serial_number: 0, manufacture_date: ManufactureDate { week: 4, year: 2013 } }, version: Version { version: 1, revision: 4 }, display: DisplayParameters { input: Digital { dfp_compatible: true }, max_size: Some(ImageSize { width: 33.0, height: 21.0 }), gamma: Some(2.2), dpms: DPMSFeatures { standby_supported: false, suspend_supported: false, low_power_supported: false, display_type: Monochrome, default_srgb: false, preferred_timing_mode: true, default_gtf_supported: false } }, color: ColorCharacteristics { red: (0.6533203, 0.33398438), green: (0.2998047, 0.6201172), blue: (0.14648438, 0.049804688), white: (0.3125, 0.32910156), white_points: [] }, timings: Timings { established_timings: [], standard_timings: [], detailed_timings: [DetailedTiming { pixel_clock: 337750000, active: (2880, 1800), front_porch: (48, 3), sync_length: (32, 6), back_porch: (80, 43), image_size: ImageSize { width: 33.1, height: 20.7 }, border: (0, 0), interlaced: false, stereo: None, sync_type: Seperate { horizontal: Positive, vertical: Negative } }] }, descriptors: MonitorDescriptors([MonitorName("Color LCD"), ManufacturerDefined(0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0])]), extensions: 0 })

无运行时依赖

功能