let is_pl = (flags & SONITON_FLAG_PLANAR) != 0;
let is_fl = (flags & SONITON_FLAG_FLOAT) != 0;
let is_sg = (flags & SONITON_FLAG_SIGNED) != 0;
let is_pl = (flags & SONITON_FLAG_PLANAR) != 0;
let is_fl = (flags & SONITON_FLAG_FLOAT) != 0;
let is_sg = (flags & SONITON_FLAG_SIGNED) != 0;
- NASoniton { bits: bits, be: is_be, packed: is_pk, planar: is_pl, float: is_fl, signed: is_sg }
+ NASoniton { bits, be: is_be, packed: is_pk, planar: is_pl, float: is_fl, signed: is_sg }
- pub fn get_bits(&self) -> u8 { self.bits }
- pub fn is_be(&self) -> bool { self.be }
- pub fn is_packed(&self) -> bool { self.packed }
- pub fn is_planar(&self) -> bool { self.planar }
- pub fn is_float(&self) -> bool { self.float }
- pub fn is_signed(&self) -> bool { self.signed }
+ pub fn get_bits(self) -> u8 { self.bits }
+ pub fn is_be(self) -> bool { self.be }
+ pub fn is_packed(self) -> bool { self.packed }
+ pub fn is_planar(self) -> bool { self.planar }
+ pub fn is_float(self) -> bool { self.float }
+ pub fn is_signed(self) -> bool { self.signed }
NAChannelType::C => true, NAChannelType::Ch => true,
NAChannelType::Cl => true, NAChannelType::Ov => true,
NAChannelType::LFE => true, NAChannelType::LFE2 => true,
NAChannelType::C => true, NAChannelType::Ch => true,
NAChannelType::Cl => true, NAChannelType::Ov => true,
NAChannelType::LFE => true, NAChannelType::LFE2 => true,
NAChannelType::L => true, NAChannelType::Ls => true,
NAChannelType::Lss => true, NAChannelType::Lc => true,
NAChannelType::Lh => true, NAChannelType::Lw => true,
NAChannelType::L => true, NAChannelType::Ls => true,
NAChannelType::Lss => true, NAChannelType::Lc => true,
NAChannelType::Lh => true, NAChannelType::Lw => true,
NAChannelType::R => true, NAChannelType::Rs => true,
NAChannelType::Rss => true, NAChannelType::Rc => true,
NAChannelType::Rh => true, NAChannelType::Rw => true,
NAChannelType::R => true, NAChannelType::Rs => true,
NAChannelType::Rss => true, NAChannelType::Rc => true,
NAChannelType::Rh => true, NAChannelType::Rw => true,
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut map = String::new();
for el in self.ids.iter() {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut map = String::new();
for el in self.ids.iter() {
ColorModel::RGB(_) => "rgb",
ColorModel::YUV(_) => "yuv",
ColorModel::CMYK => "cmyk",
ColorModel::RGB(_) => "rgb",
ColorModel::YUV(_) => "yuv",
ColorModel::CMYK => "cmyk",
pub fn new(h_ss: u8, v_ss: u8, packed: bool, depth: u8, shift: u8, comp_offs: u8, next_elem: u8) -> Self {
Self { h_ss, v_ss, packed, depth, shift, comp_offs, next_elem }
}
pub fn new(h_ss: u8, v_ss: u8, packed: bool, depth: u8, shift: u8, comp_offs: u8, next_elem: u8) -> Self {
Self { h_ss, v_ss, packed, depth, shift, comp_offs, next_elem }
}
- pub fn get_subsampling(&self) -> (u8, u8) { (self.h_ss, self.v_ss) }
- pub fn is_packed(&self) -> bool { self.packed }
- pub fn get_depth(&self) -> u8 { self.depth }
- pub fn get_shift(&self) -> u8 { self.shift }
- pub fn get_offset(&self) -> u8 { self.comp_offs }
- pub fn get_step(&self) -> u8 { self.next_elem }
+ pub fn get_subsampling(self) -> (u8, u8) { (self.h_ss, self.v_ss) }
+ pub fn is_packed(self) -> bool { self.packed }
+ pub fn get_depth(self) -> u8 { self.depth }
+ pub fn get_shift(self) -> u8 { self.shift }
+ pub fn get_offset(self) -> u8 { self.comp_offs }
+ pub fn get_step(self) -> u8 { self.next_elem }
if let Some(c) = comp3 { chromatons[2] = Some(c); ncomp += 1; }
if let Some(c) = comp4 { chromatons[3] = Some(c); ncomp += 1; }
if let Some(c) = comp5 { chromatons[4] = Some(c); ncomp += 1; }
if let Some(c) = comp3 { chromatons[2] = Some(c); ncomp += 1; }
if let Some(c) = comp4 { chromatons[3] = Some(c); ncomp += 1; }
if let Some(c) = comp5 { chromatons[4] = Some(c); ncomp += 1; }
- pub fn is_be(&self) -> bool { self.be }
- pub fn has_alpha(&self) -> bool { self.alpha }
- pub fn is_paletted(&self) -> bool { self.palette }
- pub fn get_elem_size(&self) -> u8 { self.elem_size }
+ pub fn is_be(self) -> bool { self.be }
+ pub fn has_alpha(self) -> bool { self.alpha }
+ pub fn is_paletted(self) -> bool { self.palette }
+ pub fn get_elem_size(self) -> u8 { self.elem_size }
for chr in self.comp_info.iter() {
if let Some(ref chromaton) = chr {
if chromaton.is_packed() { return false; }
for chr in self.comp_info.iter() {
if let Some(ref chromaton) = chr {
if chromaton.is_packed() { return false; }