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
use framing::{Bgra, Bgr, Rgb};
use std::os::raw::c_int;
use x264;
pub unsafe trait Format {
fn colorspace() -> c_int;
fn plane_count() -> c_int;
}
unsafe impl Format for Bgra {
fn colorspace() -> c_int { x264::X264_CSP_BGRA as _ }
fn plane_count() -> c_int { 1 }
}
unsafe impl Format for Rgb {
fn colorspace() -> c_int { x264::X264_CSP_RGB as _ }
fn plane_count() -> c_int { 1 }
}
unsafe impl Format for Bgr {
fn colorspace() -> c_int { x264::X264_CSP_BGR as _ }
fn plane_count() -> c_int { 1 }
}