From: Kostya Shishkov Date: Wed, 13 May 2026 16:41:40 +0000 (+0200) Subject: rename ColorModel to ColourModel X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=ccc088bfa6b907e911ce920ad4b3f1bf10447595;p=nihav.git rename ColorModel to ColourModel --- diff --git a/nihav-acorn/src/codecs/rawvideo.rs b/nihav-acorn/src/codecs/rawvideo.rs index 8f45a66..0ad407a 100644 --- a/nihav-acorn/src/codecs/rawvideo.rs +++ b/nihav-acorn/src/codecs/rawvideo.rs @@ -4,8 +4,7 @@ use nihav_core::io::bitreader::*; 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}), diff --git a/nihav-commonfmt/src/codecs/cinepak.rs b/nihav-commonfmt/src/codecs/cinepak.rs index ec6305e..eeef065 100644 --- a/nihav-commonfmt/src/codecs/cinepak.rs +++ b/nihav-commonfmt/src/codecs/cinepak.rs @@ -305,7 +305,7 @@ impl NADecoder for CinepakDecoder { 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, diff --git a/nihav-commonfmt/src/codecs/cinepakenc.rs b/nihav-commonfmt/src/codecs/cinepakenc.rs index f2b9049..e8c624a 100644 --- a/nihav-commonfmt/src/codecs/cinepakenc.rs +++ b/nihav-commonfmt/src/codecs/cinepakenc.rs @@ -145,7 +145,7 @@ impl RNG { } 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, diff --git a/nihav-commonfmt/src/codecs/gifenc.rs b/nihav-commonfmt/src/codecs/gifenc.rs index c67fb6b..94084eb 100644 --- a/nihav-commonfmt/src/codecs/gifenc.rs +++ b/nihav-commonfmt/src/codecs/gifenc.rs @@ -3,7 +3,7 @@ use nihav_core::io::byteio::*; 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, diff --git a/nihav-commonfmt/src/codecs/jpeg.rs b/nihav-commonfmt/src/codecs/jpeg.rs index 0069f58..02f71cc 100644 --- a/nihav-commonfmt/src/codecs/jpeg.rs +++ b/nihav-commonfmt/src/codecs/jpeg.rs @@ -97,7 +97,7 @@ impl DecoderWrapper { } } let formaton = NAPixelFormaton { - model: ColorModel::YUV(YUVSubmodel::YUVJ), + model: ColourModel::YUV(YUVSubmodel::YUVJ), components: nf as u8, comp_info: chromatons, elem_size: 0, diff --git a/nihav-commonfmt/src/codecs/rawvideoenc.rs b/nihav-commonfmt/src/codecs/rawvideoenc.rs index 6789c41..2ad19ad 100644 --- a/nihav-commonfmt/src/codecs/rawvideoenc.rs +++ b/nihav-commonfmt/src/codecs/rawvideoenc.rs @@ -64,7 +64,7 @@ impl NAEncoder for RawEncoder { 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; @@ -160,7 +160,7 @@ impl NAEncoder for RawEncoder { return Ok(()); }, - ColorModel::RGB(_) => { + ColourModel::RGB(_) => { if vinfo.format.elem_size == 0 { return Err(EncoderError::FormatError); } @@ -172,10 +172,10 @@ impl NAEncoder for RawEncoder { 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() { diff --git a/nihav-commonfmt/src/codecs/rawvideomsenc.rs b/nihav-commonfmt/src/codecs/rawvideomsenc.rs index dc697e9..5c91d85 100644 --- a/nihav-commonfmt/src/codecs/rawvideomsenc.rs +++ b/nihav-commonfmt/src/codecs/rawvideomsenc.rs @@ -1,7 +1,7 @@ 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 }), @@ -9,7 +9,7 @@ pub const BGR24_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel::R 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 }), diff --git a/nihav-commonfmt/src/codecs/zmbv.rs b/nihav-commonfmt/src/codecs/zmbv.rs index 24177f6..04f0c7a 100644 --- a/nihav-commonfmt/src/codecs/zmbv.rs +++ b/nihav-commonfmt/src/codecs/zmbv.rs @@ -151,7 +151,7 @@ fn decode_inter(frm: &mut [u8], prev: &[u8], dpal: bool, pal: &mut [u8; 768], pp 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 }), diff --git a/nihav-commonfmt/src/codecs/zmbvenc.rs b/nihav-commonfmt/src/codecs/zmbvenc.rs index 47ebb89..7fab6dc 100644 --- a/nihav-commonfmt/src/codecs/zmbvenc.rs +++ b/nihav-commonfmt/src/codecs/zmbvenc.rs @@ -2,7 +2,7 @@ use nihav_core::codecs::*; 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 }), diff --git a/nihav-commonfmt/src/demuxers/mov/track.rs b/nihav-commonfmt/src/demuxers/mov/track.rs index 15a4d1c..2413864 100644 --- a/nihav-commonfmt/src/demuxers/mov/track.rs +++ b/nihav-commonfmt/src/demuxers/mov/track.rs @@ -17,7 +17,7 @@ macro_rules! mktag { 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 }), diff --git a/nihav-commonfmt/src/demuxers/y4m.rs b/nihav-commonfmt/src/demuxers/y4m.rs index f341251..842efc2 100644 --- a/nihav-commonfmt/src/demuxers/y4m.rs +++ b/nihav-commonfmt/src/demuxers/y4m.rs @@ -133,11 +133,11 @@ impl<'a> Y4MDemuxer<'a> { } } 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); } } } diff --git a/nihav-core/src/formats.rs b/nihav-core/src/formats.rs index d0f340a..c1ba215 100644 --- a/nihav-core/src/formats.rs +++ b/nihav-core/src/formats.rs @@ -383,7 +383,7 @@ impl fmt::Display for YUVSubmodel { /// A list of known colour models. #[derive(Debug, Clone,Copy,PartialEq)] -pub enum ColorModel { +pub enum ColourModel { RGB(RGBSubmodel), YUV(YUVSubmodel), CMYK, @@ -392,46 +392,46 @@ pub enum ColorModel { 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) } @@ -484,7 +484,7 @@ pub const MAX_CHROMATONS: usize = 5; #[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. @@ -517,7 +517,7 @@ macro_rules! chromaton { } /// 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), @@ -526,7 +526,7 @@ pub const YUV420_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel:: 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), @@ -534,7 +534,7 @@ pub const YUV410_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel:: 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), @@ -544,7 +544,7 @@ pub const YUVA410_FORMAT: NAPixelFormaton = NAPixelFormaton { model: ColorModel: 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), @@ -559,7 +559,7 @@ pub const RGB555_FORMAT: NAPixelFormaton = NAPixelFormaton::make_rgb16_fmt(5, 5, 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), @@ -623,7 +623,7 @@ impl fmt::Display for NAPixelChromaton { impl NAPixelFormaton { /// Constructs a new instance of `NAPixelFormaton`. - pub fn new(model: ColorModel, + pub fn new(model: ColourModel, comp1: Option, comp2: Option, comp3: Option, @@ -648,7 +648,7 @@ impl NAPixelFormaton { } /// 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. @@ -701,7 +701,7 @@ impl NAPixelFormaton { /// Returns a short string description of the format if possible. pub fn to_short_string(&self) -> Option { match self.model { - ColorModel::RGB(_) => { + ColourModel::RGB(_) => { if self.is_paletted() { if *self == PAL8_FORMAT { return Some("pal8".to_string()); @@ -760,7 +760,7 @@ impl NAPixelFormaton { } Some(name) }, - ColorModel::YUV(_) => { + ColourModel::YUV(_) => { let max_depth = self.get_max_depth(); if self.get_total_depth() != max_depth * self.components { return None; @@ -813,7 +813,7 @@ impl NAPixelFormaton { 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, @@ -944,7 +944,7 @@ fn parse_rgb_format(s: &str) -> Result { }, _ => return Err(FormatParseError {}), }; - Ok(NAPixelFormaton { model: ColorModel::RGB(RGBSubmodel::RGB), + Ok(NAPixelFormaton { model: ColourModel::RGB(RGBSubmodel::RGB), components, comp_info: chromatons, elem_size, @@ -955,7 +955,7 @@ fn parse_yuv_format(s: &str) -> Result { 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], @@ -963,7 +963,7 @@ fn parse_yuv_format(s: &str) -> Result { }, "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 }), @@ -972,7 +972,7 @@ fn parse_yuv_format(s: &str) -> Result { }, "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 }), @@ -982,7 +982,7 @@ fn parse_yuv_format(s: &str) -> Result { }, "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 }), @@ -992,7 +992,7 @@ fn parse_yuv_format(s: &str) -> Result { }, "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 }), @@ -1002,7 +1002,7 @@ fn parse_yuv_format(s: &str) -> Result { }, "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 }), @@ -1061,7 +1061,7 @@ fn parse_yuv_format(s: &str) -> Result { 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, diff --git a/nihav-core/src/scale/colorcvt.rs b/nihav-core/src/scale/colorcvt.rs index 28532ec..a5b74ad 100644 --- a/nihav-core/src/scale/colorcvt.rs +++ b/nihav-core/src/scale/colorcvt.rs @@ -216,7 +216,7 @@ impl Kernel for RgbToYuv { 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); }, @@ -417,7 +417,7 @@ impl Kernel for YuvToRgb { 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 }), @@ -431,7 +431,7 @@ impl Kernel for YuvToRgb { } } 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 => { diff --git a/nihav-core/src/scale/fill.rs b/nihav-core/src/scale/fill.rs index ffd2695..6c3df3a 100644 --- a/nihav-core/src/scale/fill.rs +++ b/nihav-core/src/scale/fill.rs @@ -45,8 +45,8 @@ impl Kernel for FillKernel { } 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 { diff --git a/nihav-duck/src/codecs/truemotion1data.rs b/nihav-duck/src/codecs/truemotion1data.rs index 2a144c4..9e3d0fa 100644 --- a/nihav-duck/src/codecs/truemotion1data.rs +++ b/nihav-duck/src/codecs/truemotion1data.rs @@ -1,6 +1,6 @@ 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 }), diff --git a/nihav-duck/src/codecs/truemotion2x.rs b/nihav-duck/src/codecs/truemotion2x.rs index b145080..f29e500 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -553,7 +553,7 @@ impl TM2XDecoder { 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)), diff --git a/nihav-duck/src/codecs/vpcommon.rs b/nihav-duck/src/codecs/vpcommon.rs index 6d4a53a..092dc9f 100644 --- a/nihav-duck/src/codecs/vpcommon.rs +++ b/nihav-duck/src/codecs/vpcommon.rs @@ -3,7 +3,7 @@ use nihav_codec_support::codecs::blockdsp; 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}), diff --git a/nihav-flash/src/codecs/flashsv.rs b/nihav-flash/src/codecs/flashsv.rs index d221487..6505826 100644 --- a/nihav-flash/src/codecs/flashsv.rs +++ b/nihav-flash/src/codecs/flashsv.rs @@ -416,7 +416,7 @@ const DEFAULT_PAL: [u8; 128 * 3] = [ ]; 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 }), diff --git a/nihav-game/src/codecs/bmv.rs b/nihav-game/src/codecs/bmv.rs index a9d4313..45b0e6f 100644 --- a/nihav-game/src/codecs/bmv.rs +++ b/nihav-game/src/codecs/bmv.rs @@ -169,7 +169,7 @@ impl BMVVideoDecoder { 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)), diff --git a/nihav-game/src/codecs/midivid.rs b/nihav-game/src/codecs/midivid.rs index 3ce4f62..509ba74 100644 --- a/nihav-game/src/codecs/midivid.rs +++ b/nihav-game/src/codecs/midivid.rs @@ -119,7 +119,7 @@ fn decode_frame(frm: &mut NASimpleVideoFrame, src: &[u8], width: usize, heig 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)), diff --git a/nihav-hlblocks/src/imgseqdec.rs b/nihav-hlblocks/src/imgseqdec.rs index abab728..814ec38 100644 --- a/nihav-hlblocks/src/imgseqdec.rs +++ b/nihav-hlblocks/src/imgseqdec.rs @@ -209,7 +209,7 @@ fn read_pnm_header(file: &mut BufReader, pgmyuv: bool) -> DemuxerResult { 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, diff --git a/nihav-indeo/src/demuxers/dvi.rs b/nihav-indeo/src/demuxers/dvi.rs index 86adc1b..5244185 100644 --- a/nihav-indeo/src/demuxers/dvi.rs +++ b/nihav-indeo/src/demuxers/dvi.rs @@ -2,7 +2,7 @@ use std::collections::VecDeque; 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, diff --git a/nihav-misc/src/codecs/adorage.rs b/nihav-misc/src/codecs/adorage.rs index 96af78d..58d2b94 100644 --- a/nihav-misc/src/codecs/adorage.rs +++ b/nihav-misc/src/codecs/adorage.rs @@ -97,7 +97,7 @@ impl DecoderWrapper { } } let formaton = NAPixelFormaton { - model: ColorModel::YUV(YUVSubmodel::YUVJ), + model: ColourModel::YUV(YUVSubmodel::YUVJ), components: nf as u8, comp_info: chromatons, elem_size: 0, diff --git a/nihav-qt/src/codecs/rle.rs b/nihav-qt/src/codecs/rle.rs index eef8534..b7ba94a 100644 --- a/nihav-qt/src/codecs/rle.rs +++ b/nihav-qt/src/codecs/rle.rs @@ -3,7 +3,7 @@ use nihav_core::io::byteio::*; 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 }), diff --git a/nihav-qt/src/codecs/rleenc.rs b/nihav-qt/src/codecs/rleenc.rs index 29347d9..8078787 100644 --- a/nihav-qt/src/codecs/rleenc.rs +++ b/nihav-qt/src/codecs/rleenc.rs @@ -3,7 +3,7 @@ use nihav_core::io::byteio::*; 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 }), diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index eb1c0b4..d8b7255 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -1925,7 +1925,7 @@ impl NADecoder for Bink2Decoder { 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)), diff --git a/nihav-rad/src/codecs/binkvid.rs b/nihav-rad/src/codecs/binkvid.rs index 9e0f238..eeeb517 100644 --- a/nihav-rad/src/codecs/binkvid.rs +++ b/nihav-rad/src/codecs/binkvid.rs @@ -1132,14 +1132,14 @@ impl NADecoder for BinkDecoder { 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) };