#![warn(missing_docs)]
#![warn(unused_qualifications)]
#![deny(unreachable_pub)]
#![deny(deprecated)]
#![deny(missing_copy_implementations)]
#![cfg_attr(all(test, feature = "benchmarks"), feature(test))]
#![allow(clippy::many_single_char_names)]
#[cfg(all(test, feature = "benchmarks"))]
extern crate test;
#[cfg(test)]
#[macro_use]
extern crate quickcheck;
use std::io::Write;
pub use crate::color::{ColorType, ExtendedColorType};
pub use crate::color::{Luma, LumaA, Rgb, Rgba, Bgr, Bgra};
pub use crate::error::{ImageError, ImageResult};
pub use crate::image::{AnimationDecoder,
GenericImage,
GenericImageView,
ImageDecoder,
ImageDecoderExt,
ImageEncoder,
ImageFormat,
ImageOutputFormat,
Progress,
Pixels,
SubImage};
pub use crate::buffer_::{
GrayAlphaImage,
GrayImage,
ImageBuffer,
RgbImage,
RgbaImage};
pub use crate::flat::FlatSamples;
pub use crate::traits::{EncodableLayout, Primitive, Pixel};
pub use crate::io::free_functions::{guess_format, load};
pub use crate::dynimage::{load_from_memory, load_from_memory_with_format, open,
save_buffer, save_buffer_with_format, image_dimensions};
pub use crate::dynimage::DynamicImage;
pub use crate::animation::{Delay, Frame, Frames};
pub mod error;
pub mod buffer {
pub use crate::buffer_::{
ConvertBuffer,
EnumeratePixels,
EnumeratePixelsMut,
EnumerateRows,
EnumerateRowsMut,
Pixels,
PixelsMut,
Rows,
RowsMut,
};
}
pub mod math;
pub mod imageops;
pub mod io;
pub mod flat;
pub mod codecs {
#[cfg(feature = "avif")]
pub mod avif;
#[cfg(feature = "bmp")]
pub mod bmp;
#[cfg(feature = "dds")]
pub mod dds;
#[cfg(feature = "dxt")]
pub mod dxt;
#[cfg(feature = "farbfeld")]
pub mod farbfeld;
#[cfg(feature = "gif")]
pub mod gif;
#[cfg(feature = "hdr")]
pub mod hdr;
#[cfg(feature = "ico")]
pub mod ico;
#[cfg(feature = "jpeg")]
pub mod jpeg;
#[cfg(feature = "png")]
pub mod png;
#[cfg(feature = "pnm")]
pub mod pnm;
#[cfg(feature = "tga")]
pub mod tga;
#[cfg(feature = "tiff")]
pub mod tiff;
#[cfg(feature = "webp")]
pub mod webp;
}
#[cfg(feature = "avif")]
#[deprecated = "Use codecs::avif instead"]
pub mod avif {
pub use crate::codecs::avif::AvifEncoder;
}
#[cfg(feature = "bmp")]
#[deprecated = "Use codecs::bmp instead"]
pub mod bmp {
#[allow(deprecated)]
pub use crate::codecs::bmp::{BMPEncoder, BmpDecoder, BmpEncoder};
}
#[cfg(feature = "dds")]
#[deprecated = "Use codecs::dds instead"]
pub mod dds {
pub use crate::codecs::dds::DdsDecoder;
}
#[cfg(feature = "dxt")]
#[deprecated = "Use codecs:: instead"]
pub mod dxt {
#[allow(deprecated)]
pub use crate::codecs::dxt::{
DXTEncoder, DXTReader, DXTVariant, DxtDecoder, DxtEncoder, DxtReader, DxtVariant,
};
}
#[cfg(feature = "farbfeld")]
#[deprecated = "Use codecs::farbfeld instead"]
pub mod farbfeld {
pub use crate::codecs::farbfeld::{FarbfeldDecoder, FarbfeldEncoder, FarbfeldReader};
}
#[cfg(feature = "gif")]
#[deprecated = "Use codecs::gif instead"]
pub mod gif {
#[allow(deprecated)]
pub use crate::codecs::gif::{Encoder, GifDecoder, GifEncoder, GifReader};
}
#[cfg(feature = "hdr")]
#[deprecated = "Use codecs::hdr instead"]
pub mod hdr {
#[allow(deprecated)]
pub use crate::codecs::hdr::{
read_raw_file, rgbe8, to_rgbe8, HDRAdapter, HDREncoder, HDRImageDecoderIterator,
HDRMetadata, HdrAdapter, HdrDecoder, HdrEncoder, HdrImageDecoderIterator, HdrMetadata,
HdrReader, RGBE8Pixel, Rgbe8Pixel, SIGNATURE,
};
}
#[cfg(feature = "ico")]
#[deprecated = "Use codecs::ico instead"]
pub mod ico {
#[allow(deprecated)]
pub use crate::codecs::ico::{ICOEncoder, IcoDecoder, IcoEncoder};
}
#[cfg(feature = "jpeg")]
#[deprecated = "Use codecs::jpeg instead"]
pub mod jpeg {
#[allow(deprecated)]
pub use crate::codecs::jpeg::{
JPEGEncoder, JpegDecoder, JpegEncoder, PixelDensity, PixelDensityUnit,
};
}
#[cfg(feature = "png")]
#[deprecated = "Use codecs::png instead"]
pub mod png {
#[allow(deprecated)]
pub use crate::codecs::png::{
ApngDecoder, CompressionType, FilterType, PNGEncoder, PNGReader, PngDecoder, PngEncoder,
PngReader,
};
}
#[cfg(feature = "pnm")]
#[deprecated = "Use codecs::pnm instead"]
pub mod pnm {
#[allow(deprecated)]
pub use crate::codecs::pnm::{
ArbitraryHeader, ArbitraryTuplType, BitmapHeader, GraymapHeader, PNMEncoder, PNMHeader,
PNMSubtype, PixmapHeader, PnmDecoder, PnmEncoder, PnmHeader, PnmSubtype, SampleEncoding,
};
}
#[cfg(feature = "tga")]
#[deprecated = "Use codecs::tga instead"]
pub mod tga {
#[allow(deprecated)]
pub use crate::codecs::tga::{TgaDecoder, TgaEncoder};
}
#[cfg(feature = "tiff")]
#[deprecated = "Use codecs::tiff instead"]
pub mod tiff {
#[allow(deprecated)]
pub use crate::codecs::tiff::{TiffDecoder, TiffEncoder, TiffReader};
}
#[cfg(feature = "webp")]
#[deprecated = "Use codecs::webp instead"]
pub mod webp {
#[allow(deprecated)]
pub use crate::codecs::webp::{vp8, WebPDecoder};
}
mod animation;
#[path = "buffer.rs"]
mod buffer_;
mod color;
mod dynimage;
mod image;
mod traits;
mod utils;
macro_rules! insert_as_doc {
{ $content:expr } => {
#[doc = $content] extern { }
}
}
insert_as_doc!(include_str!("../README.md"));
#[inline]
fn copy_memory(src: &[u8], mut dst: &mut [u8]) {
let len_src = src.len();
assert!(dst.len() >= len_src);
dst.write_all(src).unwrap();
}