| Crates.io | libwebp |
| lib.rs | libwebp |
| version | 0.1.2 |
| created_at | 2020-03-01 06:12:47.14643+00 |
| updated_at | 2020-03-15 12:50:24.092045+00 |
| description | A binding to libwebp |
| homepage | https://github.com/qnighy/libwebp-rs |
| repository | https://github.com/qnighy/libwebp-rs |
| max_upload_size | |
| id | 214106 |
| size | 72,460 |
This is a binding to the libwebp library.
# Cargo.toml
[dependencies]
libwebp = { version = "0.1.2", features = ["0_6"] }
use libwebp::WebPDecodeRGBA;
let data: &[u8];
let (width, height, buf) = WebPDecodeRGBA(data).unwrap();
eprintln!("width = {}, height = {}", width, height);
eprintln!(
"top-left pixel: rgba({}, {}, {}, {})",
buf[0],
buf[1],
buf[2],
buf[3] as f64 / 255.0,
)
use libwebp::WebPEncodeRGBA;
let buf: &[u8] = &[
255, 255, 255, 255, // white
255, 0, 0, 255, // red
0, 255, 0, 255, // green
0, 0, 255, 255, // blue
];
let data = WebPEncodeRGBA(buf, 2, 2, 8, 75.0).unwrap();
let lossless_data = WebPEncodeLosslessRGBA(buf, 2, 2, 8).unwrap();
Rust 1.31.0
demux ... enables libwebpdemux functions.mux ... enables libwebpmux functions.0_5 ... enables functions introduced in libwebp 0.5.0.0_6 ... enables functions introduced in libwebp 0.6.0.1_1 ... enables functions introduced in libwebp 1.1.0.static ... statically link against the bundled libwebp.extern-types ... enables #![feature(extern_types)].If libwebp is found in the system, it links against the library. Otherwise it builds and links against the bundled libwebp.
In these cases, static link is preferred:
static feature is turned on.LIBWEBP_SYS_STATIC environment variable is set to 1 when building.types.h
WebPMallocWebPFreedecode.h
WebPGetDecoderVersionWebPGetInfoWebPDecode*WebPDecodeYUVWebPDecode*IntoWebPDecodeYUVIntoWEBP_CSP_MODEWebPIsPremultipliedModeWebPIsAlphaModeWebPIsRGBModeWebPRGBABufferWebPYUVABufferWebPDecBufferWebPInitDecBufferWebPFreeDecBufferVP8StatusCodeWebPIDecoder (internal memory)WebPIDecoder (external memory)WebPINewDecoder (internal memory)WebPINewDecoder (external memory)WebPINewRGB (internal memory)WebPINewRGB (external memory)WebPINewYUVA (internal memory)WebPINewYUVA (external memory)WebPIDeleteWebPIAppendWebPIUpdateWebPIDecGetRGBWebPIDecGetYUVAWebPIDecodedAreaWebPBitstreamFeaturesWebPGetFeaturesWebPDecoderOptionsWebPDecoderConfigWebPInitDecoderConfigWebPIDecodeWebPDecodeencode.h
WebPGetEncoderVersionWebPEncode*WebPEncodeLossless*WebPImageHintWebPConfigWebPPresetWebPConfigInitWebPConfigPresetWebPConfigLosslessPresetWebPValidateConfigWebPAuxStatsWebPWriterFunctionWebPMemoryWriterWebPMemoryWriterInitWebPMemoryWriterClearWebPMemoryWriteWebPProgressHookWebPEncCSPWebPEncodingErrorWEBP_MAX_DIMENSIONWebPPictureWebPPictureInitWebPPictureAllocWebPPictureFreeWebPPictureCopyWebPPlaneDistortionWebPPictureDistortionWebPPictureCropWebPPictureViewWebPPictureIsViewWebPPictureRescaleWebPPictureImportRGBWebPPictureImportRGBAWebPPictureImportRGBXWebPPictureImportBGRWebPPictureImportBGRAWebPPictureImportBGRXWebPPictureARGBToYUVAWebPPictureARGBToYUVADitheredWebPPictureSharpARGBToYUVAWebPPictureSmartARGBToYUVAWebPPictureYUVAToARGBWebPCleanupTransparentAreaWebPPictureHasTransparencyWebPBlendAlphaWebPEncodemux_types.h
demux.h
mux.h
Not at all