@@ -169,6 +169,7 @@ impl std::fmt::Debug for __WebPDecBufferUnion {
169
169
170
170
/// Enumeration of the status codes
171
171
#[ allow( non_camel_case_types) ]
172
+ // #[cfg_attr(feature = "must-use", must_use)] // meaningless for type aliases
172
173
pub type VP8StatusCode = u32 ;
173
174
174
175
pub const VP8_STATUS_OK : VP8StatusCode = 0 ;
@@ -322,6 +323,7 @@ extern "C" {
322
323
/// RIFF + VP8X + (optional chunks) + VP8(L)
323
324
/// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose.
324
325
/// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose.
326
+ #[ cfg_attr( feature = "must-use" , must_use) ]
325
327
pub fn WebPGetInfo (
326
328
data : * const u8 ,
327
329
data_size : usize ,
@@ -333,20 +335,23 @@ extern "C" {
333
335
/// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).
334
336
/// The returned pointer should be deleted calling WebPFree().
335
337
/// Returns NULL in case of error.
338
+ #[ cfg_attr( feature = "must-use" , must_use) ]
336
339
pub fn WebPDecodeRGBA (
337
340
data : * const u8 ,
338
341
data_size : usize ,
339
342
width : * mut c_int ,
340
343
height : * mut c_int ,
341
344
) -> * mut u8 ;
342
345
/// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.
346
+ #[ cfg_attr( feature = "must-use" , must_use) ]
343
347
pub fn WebPDecodeARGB (
344
348
data : * const u8 ,
345
349
data_size : usize ,
346
350
width : * mut c_int ,
347
351
height : * mut c_int ,
348
352
) -> * mut u8 ;
349
353
/// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.
354
+ #[ cfg_attr( feature = "must-use" , must_use) ]
350
355
pub fn WebPDecodeBGRA (
351
356
data : * const u8 ,
352
357
data_size : usize ,
@@ -355,13 +360,15 @@ extern "C" {
355
360
) -> * mut u8 ;
356
361
/// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.
357
362
/// If the bitstream contains transparency, it is ignored.
363
+ #[ cfg_attr( feature = "must-use" , must_use) ]
358
364
pub fn WebPDecodeRGB (
359
365
data : * const u8 ,
360
366
data_size : usize ,
361
367
width : * mut c_int ,
362
368
height : * mut c_int ,
363
369
) -> * mut u8 ;
364
370
/// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.
371
+ #[ cfg_attr( feature = "must-use" , must_use) ]
365
372
pub fn WebPDecodeBGR (
366
373
data : * const u8 ,
367
374
data_size : usize ,
@@ -378,6 +385,7 @@ extern "C" {
378
385
/// 'width' and 'height' may be NULL, the other pointers must not be.
379
386
/// Returns NULL in case of error.
380
387
/// (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr
388
+ #[ cfg_attr( feature = "must-use" , must_use) ]
381
389
pub fn WebPDecodeYUV (
382
390
data : * const u8 ,
383
391
data_size : usize ,
@@ -396,20 +404,23 @@ extern "C" {
396
404
// The parameter 'output_stride' specifies the distance (in bytes)
397
405
// between scanlines. Hence, output_buffer_size is expected to be at least
398
406
// output_stride x picture-height.
407
+ #[ cfg_attr( feature = "must-use" , must_use) ]
399
408
pub fn WebPDecodeRGBAInto (
400
409
data : * const u8 ,
401
410
data_size : usize ,
402
411
output_buffer : * mut u8 ,
403
412
output_buffer_size : usize ,
404
413
output_stride : c_int ,
405
414
) -> * mut u8 ;
415
+ #[ cfg_attr( feature = "must-use" , must_use) ]
406
416
pub fn WebPDecodeARGBInto (
407
417
data : * const u8 ,
408
418
data_size : usize ,
409
419
output_buffer : * mut u8 ,
410
420
output_buffer_size : usize ,
411
421
output_stride : c_int ,
412
422
) -> * mut u8 ;
423
+ #[ cfg_attr( feature = "must-use" , must_use) ]
413
424
pub fn WebPDecodeBGRAInto (
414
425
data : * const u8 ,
415
426
data_size : usize ,
@@ -419,13 +430,15 @@ extern "C" {
419
430
) -> * mut u8 ;
420
431
// RGB and BGR variants. Here too the transparency information, if present,
421
432
// will be dropped and ignored.
433
+ #[ cfg_attr( feature = "must-use" , must_use) ]
422
434
pub fn WebPDecodeRGBInto (
423
435
data : * const u8 ,
424
436
data_size : usize ,
425
437
output_buffer : * mut u8 ,
426
438
output_buffer_size : usize ,
427
439
output_stride : c_int ,
428
440
) -> * mut u8 ;
441
+ #[ cfg_attr( feature = "must-use" , must_use) ]
429
442
pub fn WebPDecodeBGRInto (
430
443
data : * const u8 ,
431
444
data_size : usize ,
@@ -440,6 +453,7 @@ extern "C" {
440
453
/// 'u_size' and 'v_size' respectively.
441
454
/// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred
442
455
/// during decoding (or because some buffers were found to be too small).
456
+ #[ cfg_attr( feature = "must-use" , must_use) ]
443
457
pub fn WebPDecodeYUVInto (
444
458
data : * const u8 ,
445
459
data_size : usize ,
@@ -455,6 +469,7 @@ extern "C" {
455
469
) -> * mut u8 ;
456
470
/// Internal, version-checked, entry point
457
471
#[ doc( hidden) ]
472
+ #[ cfg_attr( feature = "must-use" , must_use) ]
458
473
pub fn WebPInitDecBufferInternal ( _: * mut WebPDecBuffer , _: c_int ) -> c_int ;
459
474
/// Free any memory associated with the buffer. Must always be called last.
460
475
/// Note: doesn't free the 'buffer' structure itself.
@@ -471,6 +486,7 @@ extern "C" {
471
486
/// within valid bounds.
472
487
/// All other fields of WebPDecBuffer MUST remain constant between calls.
473
488
/// Returns NULL if the allocation failed.
489
+ #[ cfg_attr( feature = "must-use" , must_use) ]
474
490
pub fn WebPINewDecoder ( output_buffer : * mut WebPDecBuffer ) -> * mut WebPIDecoder ;
475
491
/// This function allocates and initializes an incremental-decoder object, which
476
492
/// will output the RGB/A samples specified by 'csp' into a preallocated
@@ -482,6 +498,7 @@ extern "C" {
482
498
/// colorspace 'csp' is taken into account for allocating this buffer. All other
483
499
/// parameters are ignored.
484
500
/// Returns NULL if the allocation failed, or if some parameters are invalid.
501
+ #[ cfg_attr( feature = "must-use" , must_use) ]
485
502
pub fn WebPINewRGB (
486
503
csp : WEBP_CSP_MODE ,
487
504
output_buffer : * mut u8 ,
@@ -499,6 +516,7 @@ extern "C" {
499
516
/// In this case, the output buffer will be automatically allocated (using
500
517
/// MODE_YUVA) when decoding starts. All parameters are then ignored.
501
518
/// Returns NULL if the allocation failed or if a parameter is invalid.
519
+ #[ cfg_attr( feature = "must-use" , must_use) ]
502
520
pub fn WebPINewYUVA (
503
521
luma : * mut u8 ,
504
522
luma_size : usize ,
@@ -515,6 +533,7 @@ extern "C" {
515
533
) -> * mut WebPIDecoder ;
516
534
/// Deprecated version of the above, without the alpha plane.
517
535
/// Kept for backward compatibility.
536
+ #[ cfg_attr( feature = "must-use" , must_use) ]
518
537
pub fn WebPINewYUV (
519
538
luma : * mut u8 ,
520
539
luma_size : usize ,
@@ -548,6 +567,7 @@ extern "C" {
548
567
/// (*last_y, *width etc.) can be NULL if corresponding information is not
549
568
/// needed. The values in these pointers are only valid on successful (non-NULL)
550
569
/// return.
570
+ #[ cfg_attr( feature = "must-use" , must_use) ]
551
571
pub fn WebPIDecGetRGB (
552
572
idec : * const WebPIDecoder ,
553
573
last_y : * mut c_int ,
@@ -558,6 +578,7 @@ extern "C" {
558
578
/// Same as above function to get a YUVA image. Returns pointer to the luma
559
579
/// plane or NULL in case of error. If there is no alpha information
560
580
/// the alpha pointer '*a' will be returned NULL.
581
+ #[ cfg_attr( feature = "must-use" , must_use) ]
561
582
pub fn WebPIDecGetYUVA (
562
583
idec : * const WebPIDecoder ,
563
584
last_y : * mut c_int ,
@@ -576,6 +597,7 @@ extern "C" {
576
597
/// Returns NULL in case the incremental decoder object is in an invalid state.
577
598
/// Otherwise returns the pointer to the internal representation. This structure
578
599
/// is read-only, tied to WebPIDecoder's lifespan and should not be modified.
600
+ #[ cfg_attr( feature = "must-use" , must_use) ]
579
601
pub fn WebPIDecodedArea (
580
602
idec : * const WebPIDecoder ,
581
603
left : * mut c_int ,
@@ -593,6 +615,7 @@ extern "C" {
593
615
) -> VP8StatusCode ;
594
616
/// Internal, version-checked, entry point
595
617
#[ doc( hidden) ]
618
+ #[ cfg_attr( feature = "must-use" , must_use) ]
596
619
pub fn WebPInitDecoderConfigInternal ( _: * mut WebPDecoderConfig , _: c_int ) -> c_int ;
597
620
/// Instantiate a new incremental decoder object with the requested
598
621
/// configuration. The bitstream can be passed using 'data' and 'data_size'
@@ -605,6 +628,7 @@ extern "C" {
605
628
/// The return WebPIDecoder object must always be deleted calling WebPIDelete().
606
629
/// Returns NULL in case of error (and config->status will then reflect
607
630
/// the error condition, if available).
631
+ #[ cfg_attr( feature = "must-use" , must_use) ]
608
632
pub fn WebPIDecode (
609
633
data : * const u8 ,
610
634
data_size : usize ,
@@ -623,6 +647,7 @@ extern "C" {
623
647
/// Initialize the structure as empty. Must be called before any other use.
624
648
/// Returns false in case of version mismatch
625
649
#[ allow( non_snake_case) ]
650
+ #[ cfg_attr( feature = "must-use" , must_use) ]
626
651
#[ inline]
627
652
pub unsafe extern "C" fn WebPInitDecBuffer ( buffer : * mut WebPDecBuffer ) -> c_int {
628
653
WebPInitDecBufferInternal ( buffer, WEBP_DECODER_ABI_VERSION )
@@ -653,6 +678,7 @@ pub unsafe extern "C" fn WebPGetFeatures(
653
678
/// called first, unless WebPGetFeatures() is to be called.
654
679
/// Returns false in case of mismatched version.
655
680
#[ allow( non_snake_case) ]
681
+ #[ cfg_attr( feature = "must-use" , must_use) ]
656
682
#[ inline]
657
683
pub unsafe extern "C" fn WebPInitDecoderConfig ( config : * mut WebPDecoderConfig ) -> c_int {
658
684
WebPInitDecoderConfigInternal ( config, WEBP_DECODER_ABI_VERSION )
0 commit comments