@@ -42,6 +42,9 @@ const GUID_IGNORE: Guid = Guid(0x9c43_51a6, 0x3535, 0x42ae, 0x91, 0x0c, 0xcd, 0x
4242#[ rustfmt:: skip]
4343#[ cfg( feature="qoi" ) ]
4444const GUID_QOI : Guid = Guid ( 0x4dae_9af8 , 0xb399 , 0x4df6 , 0xb4 , 0x3a , 0x66 , 0x2f , 0xd9 , 0xc0 , 0xf5 , 0xd6 ) ;
45+ #[ rustfmt:: skip]
46+ #[ cfg( feature="qoiz" ) ]
47+ const GUID_QOIZ : Guid = Guid ( 0x229c_c6dc , 0xa860 , 0x4b52 , 0xb4 , 0xd8 , 0x05 , 0x3a , 0x22 , 0xb3 , 0x89 , 0x2b ) ;
4548
4649#[ derive( Debug , PartialEq , Eq ) ]
4750pub struct Guid ( u32 , u16 , u16 , u8 , u8 , u8 , u8 , u8 , u8 , u8 , u8 ) ;
@@ -171,6 +174,8 @@ impl Encode for Codec {
171174 CodecProperty :: Ignore => GUID_IGNORE ,
172175 #[ cfg( feature = "qoi" ) ]
173176 CodecProperty :: Qoi => GUID_QOI ,
177+ #[ cfg( feature = "qoiz" ) ]
178+ CodecProperty :: QoiZ => GUID_QOIZ ,
174179 _ => return Err ( other_err ! ( "invalid codec" ) ) ,
175180 } ;
176181 guid. encode ( dst) ?;
@@ -210,6 +215,8 @@ impl Encode for Codec {
210215 }
211216 #[ cfg( feature = "qoi" ) ]
212217 CodecProperty :: Qoi => dst. write_u16 ( 0 ) ,
218+ #[ cfg( feature = "qoiz" ) ]
219+ CodecProperty :: QoiZ => dst. write_u16 ( 0 ) ,
213220 CodecProperty :: Ignore => dst. write_u16 ( 0 ) ,
214221 CodecProperty :: None => dst. write_u16 ( 0 ) ,
215222 } ;
@@ -235,6 +242,8 @@ impl Encode for Codec {
235242 } ,
236243 #[ cfg( feature = "qoi" ) ]
237244 CodecProperty :: Qoi => 0 ,
245+ #[ cfg( feature = "qoiz" ) ]
246+ CodecProperty :: QoiZ => 0 ,
238247 CodecProperty :: Ignore => 0 ,
239248 CodecProperty :: None => 0 ,
240249 }
@@ -271,6 +280,8 @@ impl<'de> Decode<'de> for Codec {
271280 }
272281 #[ cfg( feature = "qoi" ) ]
273282 GUID_QOI => CodecProperty :: Qoi ,
283+ #[ cfg( feature = "qoiz" ) ]
284+ GUID_QOIZ => CodecProperty :: QoiZ ,
274285 GUID_IGNORE => CodecProperty :: Ignore ,
275286 _ => CodecProperty :: None ,
276287 }
@@ -284,6 +295,8 @@ impl<'de> Decode<'de> for Codec {
284295 }
285296 #[ cfg( feature = "qoi" ) ]
286297 GUID_QOI => CodecProperty :: Qoi ,
298+ #[ cfg( feature = "qoiz" ) ]
299+ GUID_QOIZ => CodecProperty :: QoiZ ,
287300 GUID_IGNORE => CodecProperty :: Ignore ,
288301 _ => CodecProperty :: None ,
289302 }
@@ -307,6 +320,8 @@ pub enum CodecProperty {
307320 Ignore ,
308321 #[ cfg( feature = "qoi" ) ]
309322 Qoi ,
323+ #[ cfg( feature = "qoiz" ) ]
324+ QoiZ ,
310325 None ,
311326}
312327
@@ -644,6 +659,8 @@ pub enum CodecId {
644659 RemoteFx = 0x03 ,
645660 #[ cfg( feature = "qoi" ) ]
646661 Qoi = 0x0A ,
662+ #[ cfg( feature = "qoiz" ) ]
663+ QoiZ = 0x0B ,
647664}
648665
649666impl CodecId {
@@ -653,6 +670,8 @@ impl CodecId {
653670 0x03 => Some ( Self :: RemoteFx ) ,
654671 #[ cfg( feature = "qoi" ) ]
655672 0x0A => Some ( Self :: Qoi ) ,
673+ #[ cfg( feature = "qoiz" ) ]
674+ 0x0B => Some ( Self :: QoiZ ) ,
656675 _ => None ,
657676 }
658677 }
@@ -723,6 +742,14 @@ pub fn client_codecs_capabilities(config: &[&str]) -> Result<BitmapCodecs, Strin
723742 } ) ;
724743 }
725744
745+ #[ cfg( feature = "qoiz" ) ]
746+ if config. remove ( "qoiz" ) . unwrap_or ( true ) {
747+ codecs. push ( Codec {
748+ id : CodecId :: QoiZ as u8 ,
749+ property : CodecProperty :: QoiZ ,
750+ } ) ;
751+ }
752+
726753 let codec_names = config. keys ( ) . copied ( ) . collect :: < Vec < _ > > ( ) . join ( ", " ) ;
727754 if !codec_names. is_empty ( ) {
728755 return Err ( format ! ( "Unknown codecs: {}" , codec_names) ) ;
@@ -772,6 +799,14 @@ pub fn server_codecs_capabilities(config: &[&str]) -> Result<BitmapCodecs, Strin
772799 } ) ;
773800 }
774801
802+ #[ cfg( feature = "qoiz" ) ]
803+ if config. remove ( "qoiz" ) . unwrap_or ( true ) {
804+ codecs. push ( Codec {
805+ id : 0 ,
806+ property : CodecProperty :: QoiZ ,
807+ } ) ;
808+ }
809+
775810 let codec_names = config. keys ( ) . copied ( ) . collect :: < Vec < _ > > ( ) . join ( ", " ) ;
776811 if !codec_names. is_empty ( ) {
777812 return Err ( format ! ( "Unknown codecs: {}" , codec_names) ) ;
0 commit comments