let format = if bitcount > 8 { RGB24_FORMAT } else { PAL8_FORMAT };
let mut vhdr = NAVideoInfo::new(width as usize, if flip { -height as usize } else { height as usize}, flip, format);
vhdr.bits = (planes as u8) * (bitcount as u8);
- let cname = if find_raw_fmt(&compression, planes, bitcount, &mut vhdr) {
+ let cname = if find_raw_fmt(&compression, planes, bitcount, flip, &mut vhdr) {
"rawvideo-ms"
} else {
match register::find_codec_from_avi_fourcc(&compression) {
Ok(size)
}
-fn find_raw_fmt(compr: &[u8; 4], planes: u16, bitcount: u16, vhdr: &mut NAVideoInfo) -> bool {
+fn find_raw_fmt(compr: &[u8; 4], planes: u16, bitcount: u16, flip: bool, vhdr: &mut NAVideoInfo) -> bool {
match compr {
&[0, 0, 0, 0] | b"DIB " => {
if planes != 1 {
};
if let Ok(fmt) = NAPixelFormaton::from_str(fmt_name) {
vhdr.format = fmt;
- vhdr.flipped = true;
+ vhdr.flipped = !flip;
true
} else {
false