fakejpeg 0.2.0

Rust port of Alun Jones' fakejpeg library
Documentation
// SPDX-FileCopyrightText: Alun Jones
// SPDX-FileCopyrightText: Gergely Nagy
// SPDX-FileContributor: Gergely Nagy
//
// SPDX-License-Identifier: MIT

#![warn(missing_docs)]

//! **"Fake" jpeg generator library for Rust**
//!
//! This library began as a port of Alun Jones' [`fakejpeg`] Python library to
//! Rust, using `winnow` for parsing, and with a focus on performance. Much like
//! the original library, the generated images aren't exactly correct, but
//! they're - usually - good enough that browsers, and a lot of image viewers
//! display them nevertheless.
//!
//! The main components of the library are [`Template`] and [`ImageGenerator`]:
//! these can be used to parse JPEG images into a template, and to generate
//! randomized fakes from said template, as many as you wish.
//!
//! While a [`Template`] is expensive to build, an [`ImageGenerator`] isn't: it
//! borrows the template for generation purposes. As such, it is recommended to
//! keep a [`Template`] around as long as possible - you're free to create and
//! drop [`ImageGenerator`]s as needed, they're not much more than a thin
//! wrapper around the template.
//!
//! [`fakejpeg`]: https://github.com/gw1urf/fakejpeg

mod error;
mod image_generator;
mod masked_rng;
mod parser;
mod template;

pub use error::{Error, Result};
pub use image_generator::{
    ImageGenerator,
    config::{Config, ConfigBuilder},
};
pub use template::Template;

#[cfg(feature = "serde")]
pub use template::pickle::Pickle;