use super::yuvtab::YUV2RGB;
-const YUV422_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::
-YUV(YUVSubmodel::YUVJ), components: 3,
+const YUV422_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}),
Some(NAPixelChromaton{ h_ss: 1, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 1, next_elem: 1}),
let fmt = match mode {
DecodeMode::YUV => YUV420_FORMAT,
DecodeMode::Gray => NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: 1,
comp_info: [Some(NAPixelChromaton{h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}), None, None, None, None],
elem_size: 1,
}
const GRAY_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: 1,
comp_info: [Some(NAPixelChromaton{h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}), None, None, None, None],
elem_size: 1,
use nihav_core::io::bitwriter::*;
const GRAY_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: 1,
comp_info: [Some(NAPixelChromaton{h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}), None, None, None, None],
elem_size: 1,
}
}
let formaton = NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: nf as u8,
comp_info: chromatons,
elem_size: 0,
let vinfo = vbuf.get_info();
let src = vbuf.get_data();
match vinfo.format.model {
- ColorModel::RGB(_) if vinfo.format.is_paletted() => {
+ ColourModel::RGB(_) if vinfo.format.is_paletted() => {
let (width, height) = vbuf.get_dimensions(0);
let sstride = vbuf.get_stride(0);
let dstride = width;
return Ok(());
},
- ColorModel::RGB(_) => {
+ ColourModel::RGB(_) => {
if vinfo.format.elem_size == 0 {
return Err(EncoderError::FormatError);
}
dbuf.extend_from_slice(&line[..dstride]);
}
},
- ColorModel::YUV(_) if !vinfo.format.is_unpacked() => { // packed YUV should be fine as is
+ ColourModel::YUV(_) if !vinfo.format.is_unpacked() => { // packed YUV should be fine as is
dbuf = src.clone();
},
- ColorModel::YUV(_) => {
+ ColourModel::YUV(_) => {
dbuf = Vec::with_capacity(src.len());
for (comp, cinfo) in vinfo.format.comp_info.iter().enumerate() {
if cinfo.is_none() {
use nihav_core::codecs::*;
use nihav_core::io::byteio::*;
-pub const BGR24_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+pub const BGR24_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 3 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 3 }),
None, None],
elem_size: 3, be: false, alpha: false, palette: false };
-pub const BGR32_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 4,
+pub const BGR32_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 4,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
const INTRA_FLAG: u8 = 0x01;
const DELTA_PAL: u8 = 0x02;
-const RGB24_0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+const RGB24_0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
use nihav_core::compr::deflate::{Deflate, DeflateMode, DeflateWriter};
use nihav_core::io::byteio::*;
-const RGB24_0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+const RGB24_0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
const QT_RGB555_FORMAT: NAPixelFormaton = NAPixelFormaton::make_rgb16_fmt(5, 5, 5, true, true);
pub const ARGB_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::RGB(RGBSubmodel::RGB), components: 4,
+ model: ColourModel::RGB(RGBSubmodel::RGB), components: 4,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
}
}
if format.model.is_yuv() {
- format.model = ColorModel::YUV(YUVSubmodel::YCbCr);
+ format.model = ColourModel::YUV(YUVSubmodel::YCbCr);
if fmt_str.len() > 3 {
let (_, tail) = fmt_str.split_at(3);
if tail == b"jpeg" {
- format.model = ColorModel::YUV(YUVSubmodel::YUVJ);
+ format.model = ColourModel::YUV(YUVSubmodel::YUVJ);
}
}
}
/// A list of known colour models.
#[derive(Debug, Clone,Copy,PartialEq)]
-pub enum ColorModel {
+pub enum ColourModel {
RGB(RGBSubmodel),
YUV(YUVSubmodel),
CMYK,
XYZ,
}
-impl ColorModel {
+impl ColourModel {
/// Returns the number of colour model components.
///
/// The actual image may have more components e.g. alpha component.
pub fn get_default_components(self) -> usize {
match self {
- ColorModel::CMYK => 4,
- _ => 3,
+ ColourModel::CMYK => 4,
+ _ => 3,
}
}
/// Reports whether the current colour model is RGB.
pub fn is_rgb(self) -> bool {
- matches!(self, ColorModel::RGB(_))
+ matches!(self, ColourModel::RGB(_))
}
/// Reports whether the current colour model is YUV.
pub fn is_yuv(self) -> bool {
- matches!(self, ColorModel::YUV(_))
+ matches!(self, ColourModel::YUV(_))
}
/// Returns short name for the current colour mode.
pub fn get_short_name(self) -> &'static str {
match self {
- ColorModel::RGB(_) => "rgb",
- ColorModel::YUV(_) => "yuv",
- ColorModel::CMYK => "cmyk",
- ColorModel::HSV => "hsv",
- ColorModel::LAB => "lab",
- ColorModel::XYZ => "xyz",
+ ColourModel::RGB(_) => "rgb",
+ ColourModel::YUV(_) => "yuv",
+ ColourModel::CMYK => "cmyk",
+ ColourModel::HSV => "hsv",
+ ColourModel::LAB => "lab",
+ ColourModel::XYZ => "xyz",
}
}
}
-impl fmt::Display for ColorModel {
+impl fmt::Display for ColourModel {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match *self {
- ColorModel::RGB(fmt) => format!("RGB({})", fmt),
- ColorModel::YUV(fmt) => format!("YUV({})", fmt),
- ColorModel::CMYK => "CMYK".to_string(),
- ColorModel::HSV => "HSV".to_string(),
- ColorModel::LAB => "LAB".to_string(),
- ColorModel::XYZ => "XYZ".to_string(),
+ ColourModel::RGB(fmt) => format!("RGB({})", fmt),
+ ColourModel::YUV(fmt) => format!("YUV({})", fmt),
+ ColourModel::CMYK => "CMYK".to_string(),
+ ColourModel::HSV => "HSV".to_string(),
+ ColourModel::LAB => "LAB".to_string(),
+ ColourModel::XYZ => "XYZ".to_string(),
};
write!(f, "{}", name)
}
#[derive(Debug,Clone,Copy,PartialEq)]
pub struct NAPixelFormaton {
/// Image colour model.
- pub model: ColorModel,
+ pub model: ColourModel,
/// Actual number of components present.
pub components: u8,
/// Format definition for each component.
}
/// Predefined format for planar 8-bit YUV with 4:2:0 subsampling.
-pub const YUV420_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 3,
+pub const YUV420_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
chromaton!(0, 0, false, 8, 0, 0, 1),
chromaton!(yuv8; 1, 1, 1),
elem_size: 0, be: false, alpha: false, palette: false };
/// Predefined format for planar 8-bit YUV with 4:1:0 subsampling.
-pub const YUV410_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 3,
+pub const YUV410_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
chromaton!(0, 0, false, 8, 0, 0, 1),
chromaton!(yuv8; 2, 2, 1),
None, None],
elem_size: 0, be: false, alpha: false, palette: false };
/// Predefined format for planar 8-bit YUV with 4:1:0 subsampling and alpha component.
-pub const YUVA410_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 4,
+pub const YUVA410_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 4,
comp_info: [
chromaton!(0, 0, false, 8, 0, 0, 1),
chromaton!(yuv8; 2, 2, 1),
elem_size: 0, be: false, alpha: true, palette: false };
/// Predefined format with RGB24 palette.
-pub const PAL8_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+pub const PAL8_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
chromaton!(pal8; 0),
chromaton!(pal8; 1),
pub const RGB565_FORMAT: NAPixelFormaton = NAPixelFormaton::make_rgb16_fmt(5, 6, 5, true, false);
/// Predefined format for RGB24.
-pub const RGB24_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+pub const RGB24_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
chromaton!(packrgb; 8, 0, 0, 3),
chromaton!(packrgb; 8, 0, 1, 3),
impl NAPixelFormaton {
/// Constructs a new instance of `NAPixelFormaton`.
- pub fn new(model: ColorModel,
+ pub fn new(model: ColourModel,
comp1: Option<NAPixelChromaton>,
comp2: Option<NAPixelChromaton>,
comp3: Option<NAPixelChromaton>,
}
/// Returns current colour model.
- pub fn get_model(&self) -> ColorModel { self.model }
+ pub fn get_model(&self) -> ColourModel { self.model }
/// Returns the number of components.
pub fn get_num_comp(&self) -> usize { self.components as usize }
/// Returns selected component information.
/// Returns a short string description of the format if possible.
pub fn to_short_string(&self) -> Option<String> {
match self.model {
- ColorModel::RGB(_) => {
+ ColourModel::RGB(_) => {
if self.is_paletted() {
if *self == PAL8_FORMAT {
return Some("pal8".to_string());
}
Some(name)
},
- ColorModel::YUV(_) => {
+ ColourModel::YUV(_) => {
let max_depth = self.get_max_depth();
if self.get_total_depth() != max_depth * self.components {
return None;
Some(NAPixelChromaton { h_ss: 0, v_ss: 0, packed: true, depth: bbits, shift: bshift, comp_offs: 0, next_elem: 2}),
None, None
];
- NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB),
+ NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB),
components: 3,
comp_info: chromatons,
elem_size: 2,
},
_ => return Err(FormatParseError {}),
};
- Ok(NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB),
+ Ok(NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB),
components,
comp_info: chromatons,
elem_size,
match s {
"y8" | "y400" | "grey" | "gray" => {
return Ok(NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 1,
+ model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 1,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1 }),
None, None, None, None],
},
"y8a" | "y400a" | "greya" | "graya" => {
return Ok(NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 2,
+ model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 2,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 2 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 1, next_elem: 2 }),
},
"uyvy" | "y422" => {
return Ok(NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 3,
+ model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 2 }),
Some(NAPixelChromaton{ h_ss: 1, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 0, next_elem: 4 }),
},
"yuy2" | "yuyv" | "v422" => {
return Ok(NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 3,
+ model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 0, next_elem: 2 }),
Some(NAPixelChromaton{ h_ss: 1, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
},
"yvyu" => {
return Ok(NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 3,
+ model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 0, next_elem: 2 }),
Some(NAPixelChromaton{ h_ss: 1, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 3, next_elem: 4 }),
},
"vyuy" => {
return Ok(NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ), components: 3,
+ model: ColourModel::YUV(YUVSubmodel::YUVJ), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 2 }),
Some(NAPixelChromaton{ h_ss: 1, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
for (i, (chro, ss)) in chromatons.iter_mut().take(components as usize).zip(subsamp.iter()).enumerate() {
*chro = Some(NAPixelChromaton{ h_ss: ss[0], v_ss: ss[1], packed: !is_planar, depth, shift: 0, comp_offs: if is_planar { i as u8 } else { next_elem }, next_elem });
}
- Ok(NAPixelFormaton { model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ Ok(NAPixelFormaton { model: ColourModel::YUV(YUVSubmodel::YUVJ),
components,
comp_info: chromatons,
elem_size: components,
let mut df = dest_fmt.fmt;
make_rgb2yuv(YUV_PARAMS[mode][0], YUV_PARAMS[mode][1], &mut self.matrix);
- if let ColorModel::YUV(yuvsm) = df.get_model() {
+ if let ColourModel::YUV(yuvsm) = df.get_model() {
match yuvsm {
YUVSubmodel::YCbCr => {},
YUVSubmodel::YIQ => { apply_ntsc_rgb2yiq(SMPTE_NTSC_COEFFS, &mut self.matrix); },
df.palette = false;
if !df.is_unpacked() || df.get_max_depth() != 8 || df.get_total_depth() != df.get_num_comp() as u8 * 8 {
df = NAPixelFormaton {
- model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+ model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 1, next_elem: 1 }),
}
}
make_yuv2rgb(YUV_PARAMS[mode][0], YUV_PARAMS[mode][1], &mut self.matrix);
- if let ColorModel::YUV(yuvsm) = in_fmt.fmt.get_model() {
+ if let ColourModel::YUV(yuvsm) = in_fmt.fmt.get_model() {
match yuvsm {
YUVSubmodel::YCbCr => {},
YUVSubmodel::YIQ => {
}
if num_icore < num_ocore {
let fill_val = match ofmt.model {
- ColorModel::RGB(_) => 0x00,
- ColorModel::YUV(_) => 0x80,
+ ColourModel::RGB(_) => 0x00,
+ ColourModel::YUV(_) => 0x80,
_ => unimplemented!(),
};
for plane_no in num_icore..num_ocore {
use nihav_core::formats::*;
-pub const BGR0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+pub const BGR0_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
impl NADecoder for TM2XDecoder {
fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
- let fmt = NAPixelFormaton::new(ColorModel::YUV(YUVSubmodel::YUVJ),
+ let fmt = NAPixelFormaton::new(ColourModel::YUV(YUVSubmodel::YUVJ),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 0, 1)),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 1, 1)),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 2, 1)),
use nihav_codec_support::codecs::blockdsp::*;
pub const VP_YUVA420_FORMAT: NAPixelFormaton = NAPixelFormaton{
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: 4,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}),
];
const BGR24_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::RGB(RGBSubmodel::RGB), components: 3,
+ model: ColourModel::RGB(RGBSubmodel::RGB), components: 3,
comp_info: [
Some(NAPixelChromaton{
h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 3 }),
impl NADecoder for BMVVideoDecoder {
fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Video(_vinfo) = info.get_properties() {
- let fmt = NAPixelFormaton::new(ColorModel::RGB(RGBSubmodel::RGB),
+ let fmt = NAPixelFormaton::new(ColourModel::RGB(RGBSubmodel::RGB),
Some(NAPixelChromaton::new(0, 0, true, 8, 0, 0, 3)),
Some(NAPixelChromaton::new(0, 0, true, 8, 0, 1, 3)),
Some(NAPixelChromaton::new(0, 0, true, 8, 0, 2, 3)),
impl NADecoder for MidividDecoder {
fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
- let fmt = NAPixelFormaton::new(ColorModel::YUV(YUVSubmodel::YCbCr),
+ let fmt = NAPixelFormaton::new(ColourModel::YUV(YUVSubmodel::YCbCr),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 0, 1)),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 1, 1)),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 2, 1)),
match magic[1] {
b'5' | b'2' if !pgmyuv => {
vinfo.format = NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: 1,
comp_info: [Some(NAPixelChromaton{h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}), None, None, None, None],
elem_size: 1,
use nihav_core::demuxers::*;
const GRAY_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: 1,
comp_info: [Some(NAPixelChromaton{h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}), None, None, None, None],
elem_size: 1,
}
}
let formaton = NAPixelFormaton {
- model: ColorModel::YUV(YUVSubmodel::YUVJ),
+ model: ColourModel::YUV(YUVSubmodel::YUVJ),
components: nf as u8,
comp_info: chromatons,
elem_size: 0,
use nihav_codec_support::codecs::HAMShuffler;
pub const ARGB_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::RGB(RGBSubmodel::RGB), components: 4,
+ model: ColourModel::RGB(RGBSubmodel::RGB), components: 4,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
const RGB555BE_FORMAT: NAPixelFormaton = NAPixelFormaton::make_rgb16_fmt(5, 5, 5, true, true);
const ARGB_FORMAT: NAPixelFormaton = NAPixelFormaton {
- model: ColorModel::RGB(RGBSubmodel::RGB), components: 4,
+ model: ColourModel::RGB(RGBSubmodel::RGB), components: 4,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 1, next_elem: 4 }),
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: true, depth: 8, shift: 0, comp_offs: 2, next_elem: 4 }),
self.slice_h[self.num_slices - 1] = height_a >> 5;
let aplane = if self.has_alpha { Some(NAPixelChromaton::new(0, 0, false, 8, 0, 3, 1)) } else { None };
- let fmt = NAPixelFormaton::new(ColorModel::YUV(YUVSubmodel::YUVJ),
+ let fmt = NAPixelFormaton::new(ColourModel::YUV(YUVSubmodel::YUVJ),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 0, 1)),
Some(NAPixelChromaton::new(1, 1, false, 8, 0, 1, 1)),
Some(NAPixelChromaton::new(1, 1, false, 8, 0, 2, 1)),
let aplane = if self.has_alpha { Some(NAPixelChromaton::new(0, 0, false, 8, 0, 3, 1)) } else { None };
let fmt = if !self.is_gray {
- NAPixelFormaton::new(ColorModel::YUV(YUVSubmodel::YUVJ),
+ NAPixelFormaton::new(ColourModel::YUV(YUVSubmodel::YUVJ),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 0, 1)),
Some(NAPixelChromaton::new(1, 1, false, 8, 0, 1, 1)),
Some(NAPixelChromaton::new(1, 1, false, 8, 0, 2, 1)),
aplane, None,
0, if self.has_alpha { 4 } else { 3 } )
} else {
- NAPixelFormaton::new(ColorModel::YUV(YUVSubmodel::YUVJ),
+ NAPixelFormaton::new(ColourModel::YUV(YUVSubmodel::YUVJ),
Some(NAPixelChromaton::new(0, 0, false, 8, 0, 0, 1)),
None, None, None, None, 0, 1)
};