]> git.nihav.org Git - nihav.git/commitdiff
rename ColorModel to ColourModel
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 13 May 2026 16:41:40 +0000 (18:41 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 13 May 2026 16:41:40 +0000 (18:41 +0200)
27 files changed:
nihav-acorn/src/codecs/rawvideo.rs
nihav-commonfmt/src/codecs/cinepak.rs
nihav-commonfmt/src/codecs/cinepakenc.rs
nihav-commonfmt/src/codecs/gifenc.rs
nihav-commonfmt/src/codecs/jpeg.rs
nihav-commonfmt/src/codecs/rawvideoenc.rs
nihav-commonfmt/src/codecs/rawvideomsenc.rs
nihav-commonfmt/src/codecs/zmbv.rs
nihav-commonfmt/src/codecs/zmbvenc.rs
nihav-commonfmt/src/demuxers/mov/track.rs
nihav-commonfmt/src/demuxers/y4m.rs
nihav-core/src/formats.rs
nihav-core/src/scale/colorcvt.rs
nihav-core/src/scale/fill.rs
nihav-duck/src/codecs/truemotion1data.rs
nihav-duck/src/codecs/truemotion2x.rs
nihav-duck/src/codecs/vpcommon.rs
nihav-flash/src/codecs/flashsv.rs
nihav-game/src/codecs/bmv.rs
nihav-game/src/codecs/midivid.rs
nihav-hlblocks/src/imgseqdec.rs
nihav-indeo/src/demuxers/dvi.rs
nihav-misc/src/codecs/adorage.rs
nihav-qt/src/codecs/rle.rs
nihav-qt/src/codecs/rleenc.rs
nihav-rad/src/codecs/bink2.rs
nihav-rad/src/codecs/binkvid.rs

index 8f45a6657d2c83fc87fd33fb2357800cc8fdd6de..0ad407abe9d8e884efb20365f4d2b09ace9bf47a 100644 (file)
@@ -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}),
index ec6305e3f58e676801f08d0f39440755ee99a635..eeef065e422f16f5115eaebabb116d1ab34da226 100644 (file)
@@ -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,
index f2b90499d3e69e36d60e8154175a294a0f21b1d0..e8c624a39910c598ae1039e9840b0edc86c12676 100644 (file)
@@ -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,
index c67fb6b6262db2f31379285707129d59745306b9..94084eb6692dd9cd7f1d2c4a4185719826504836 100644 (file)
@@ -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,
index 0069f588e8c58965189b438b2059d1465ba81c1a..02f71cc559e5bef3631fb959f1bedb8bccaf1fbb 100644 (file)
@@ -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,
index 6789c41428e5aca2b259a092572e85fc4a46509c..2ad19adcaad992c2161a9e7738d5caba3cccd0b2 100644 (file)
@@ -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() {
index dc697e91170583b764bc3331228ec2c423b9f333..5c91d85bfa45259951297e87570bb43ed46ccafb 100644 (file)
@@ -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 }),
index 24177f6b2a5124d82b66ec2a71e8238df50e26a8..04f0c7af81c436e186fb307519aeba0d446d565e 100644 (file)
@@ -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 }),
index 47ebb89016f30c0744a022c33a595354ed226f6c..7fab6dc8b7da5dacc395896e2ffdc1c0ed0d599f 100644 (file)
@@ -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 }),
index 15a4d1c8d17c4019917d4343215f0cd4e2069529..2413864e085cf8d0872143a0401e899b41a87f68 100644 (file)
@@ -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 }),
index f341251d6e02fe1ce8a89ed95dda0f9633cc5b64..842efc2576e6862b9adbc7117a7ecb50da6d2008 100644 (file)
@@ -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);
                             }
                         }
                     }
index d0f340ad1b844eb4feffc95737918c22893b2928..c1ba215b84ee29f69443cea7bedd4fd55327677b 100644 (file)
@@ -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<NAPixelChromaton>,
                comp2: Option<NAPixelChromaton>,
                comp3: Option<NAPixelChromaton>,
@@ -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<String> {
         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<NAPixelFormaton, FormatParseError> {
             },
             _ => 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<NAPixelFormaton, FormatParseError> {
     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<NAPixelFormaton, FormatParseError> {
         },
         "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<NAPixelFormaton, FormatParseError> {
         },
         "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<NAPixelFormaton, FormatParseError> {
         },
         "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<NAPixelFormaton, FormatParseError> {
         },
         "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<NAPixelFormaton, FormatParseError> {
         },
         "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<NAPixelFormaton, FormatParseError> {
     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,
index 28532ece332b12f38f17571e0602972933c4e6b6..a5b74ad7d25297412a23564be7d1363e5b2426cb 100644 (file)
@@ -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    => {
index ffd2695ef66345751283b75a612b5ddf5be8e524..6c3df3ab23c306ac746b922c2017f64def1a9f61 100644 (file)
@@ -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 {
index 2a144c44a0329437c655be311d3910e403c9c231..9e3d0fa2c460300e3c00505444d5c715c29225ee 100644 (file)
@@ -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 }),
index b14508090ce6f3d6450867ee447f78e01366ab78..f29e500898aa54f8b6b8ec1aef9c32f1d564b441 100644 (file)
@@ -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)),
index 6d4a53a2413837a161029097870ad8b419bf069a..092dc9fc0151379d03b57e0b877286cb25aded3b 100644 (file)
@@ -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}),
index d2214878fffcf75a4c171bcb6b240cf3fa659a23..65058261b9c44821d517168d2867b208b944350e 100644 (file)
@@ -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 }),
index a9d43130ca2f7a75bea8a61f2813ea950660e472..45b0e6f2517800a34fd14bd7998d535f8f351517 100644 (file)
@@ -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)),
index 3ce4f625593bb9fd0844b6eb7f28fb004e1fd78f..509ba744417e7fb23a9cf65a3d4b5475c346c275 100644 (file)
@@ -119,7 +119,7 @@ fn decode_frame(frm: &mut NASimpleVideoFrame<u8>, 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)),
index abab728439f657a4b3f20113db8c779d9c560e73..814ec38eaf827fb3c0e44f388f3de3165bba5ab9 100644 (file)
@@ -209,7 +209,7 @@ fn read_pnm_header(file: &mut BufReader<File>, pgmyuv: bool) -> DemuxerResult<NA
     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,
index 86adc1be804bddb3e612b9949fb1568335065e7c..5244185d238856d015a6ca86bfcfbc9a8c84cf22 100644 (file)
@@ -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,
index 96af78df1e7ac475b6f1ee54ffc651432b5a4258..58d2b94fd22dd29500945d4cc7708e27fefaae2a 100644 (file)
@@ -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,
index eef8534134bb4953f25c0ec90ccbbfae3342ced6..b7ba94a140f74a8e1ee272d92f22f6dfac0cc934 100644 (file)
@@ -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 }),
index 29347d919110c73801a2ac8ae269904927fcad55..80787874f8a45ef8a27a87d5bba09e2544b17efa 100644 (file)
@@ -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 }),
index eb1c0b4eb91ccd6a4aff1e397acbfae34353d692..d8b7255cbae070545d5b9e1541141ce969a283aa 100644 (file)
@@ -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)),
index 9e0f2383903b12346db7276e35fb8b4c239fde82..eeeb517bf988898fd074ae81274b7d55511edadb 100644 (file)
@@ -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)
                 };