@@ -37,6 +37,9 @@ const GUID_REMOTEFX: Guid = Guid(0x7677_2f12, 0xbd72, 0x4463, 0xaf, 0xb3, 0xb7,
3737const GUID_IMAGE_REMOTEFX : Guid = Guid ( 0x2744_ccd4 , 0x9d8a , 0x4e74 , 0x80 , 0x3c , 0x0e , 0xcb , 0xee , 0xa1 , 0x9c , 0x54 ) ;
3838#[ rustfmt:: skip]
3939const GUID_IGNORE : Guid = Guid ( 0x9c43_51a6 , 0x3535 , 0x42ae , 0x91 , 0x0c , 0xcd , 0xfc , 0xe5 , 0x76 , 0x0b , 0x58 ) ;
40+ #[ rustfmt:: skip]
41+ #[ cfg( feature="qoi" ) ]
42+ const GUID_QOI : Guid = Guid ( 0x4dae9af8 , 0xb399 , 0x4df6 , 0xb4 , 0x3a , 0x66 , 0x2f , 0xd9 , 0xc0 , 0xf5 , 0xd6 ) ;
4043
4144#[ derive( Debug , PartialEq , Eq ) ]
4245pub struct Guid ( u32 , u16 , u16 , u8 , u8 , u8 , u8 , u8 , u8 , u8 , u8 ) ;
@@ -164,6 +167,8 @@ impl Encode for Codec {
164167 CodecProperty :: RemoteFx ( _) => GUID_REMOTEFX ,
165168 CodecProperty :: ImageRemoteFx ( _) => GUID_IMAGE_REMOTEFX ,
166169 CodecProperty :: Ignore => GUID_IGNORE ,
170+ #[ cfg( feature = "qoi" ) ]
171+ CodecProperty :: QOI => GUID_QOI ,
167172 _ => return Err ( other_err ! ( "invalid codec" ) ) ,
168173 } ;
169174 guid. encode ( dst) ?;
@@ -201,6 +206,8 @@ impl Encode for Codec {
201206 }
202207 } ;
203208 }
209+ #[ cfg( feature = "qoi" ) ]
210+ CodecProperty :: QOI => dst. write_u16 ( 0 ) ,
204211 CodecProperty :: Ignore => dst. write_u16 ( 0 ) ,
205212 CodecProperty :: None => dst. write_u16 ( 0 ) ,
206213 } ;
@@ -224,6 +231,8 @@ impl Encode for Codec {
224231 RemoteFxContainer :: ClientContainer ( container) => container. size ( ) ,
225232 RemoteFxContainer :: ServerContainer ( size) => * size,
226233 } ,
234+ #[ cfg( feature = "qoi" ) ]
235+ CodecProperty :: QOI => 0 ,
227236 CodecProperty :: Ignore => 0 ,
228237 CodecProperty :: None => 0 ,
229238 }
@@ -258,6 +267,8 @@ impl<'de> Decode<'de> for Codec {
258267 _ => unreachable ! ( ) ,
259268 }
260269 }
270+ #[ cfg( feature = "qoi" ) ]
271+ GUID_QOI => CodecProperty :: QOI ,
261272 GUID_IGNORE => CodecProperty :: Ignore ,
262273 _ => CodecProperty :: None ,
263274 }
@@ -269,6 +280,8 @@ impl<'de> Decode<'de> for Codec {
269280 "invalid codec property length"
270281 ) ) ;
271282 }
283+ #[ cfg( feature = "qoi" ) ]
284+ GUID_QOI => CodecProperty :: QOI ,
272285 GUID_IGNORE => CodecProperty :: Ignore ,
273286 _ => CodecProperty :: None ,
274287 }
@@ -290,6 +303,8 @@ pub enum CodecProperty {
290303 RemoteFx ( RemoteFxContainer ) ,
291304 ImageRemoteFx ( RemoteFxContainer ) ,
292305 Ignore ,
306+ #[ cfg( feature = "qoi" ) ]
307+ QOI ,
293308 None ,
294309}
295310
0 commit comments