feat(imaging): add pure-Rust JPEG 2000 backend (#109)
Some checks failed
CI / required (push) Failing after 3m18s

This commit is contained in:
2026-08-13 05:44:30 +00:00
parent 27c860c225
commit 0bab5b4c8d
28 changed files with 2770 additions and 109 deletions

View File

@@ -10,10 +10,12 @@ description = "Texture codec abstractions for the MetaCrate LibreMetaverse rewri
[features]
default = []
jpeg2000 = ["dep:libremetaverse-openjpeg"]
rust-j2k = ["dep:j2k"]
[dependencies]
libremetaverse-types = { version = "0.0.1", path = "../libremetaverse-types" }
libremetaverse-openjpeg = { version = "0.0.1", path = "../libremetaverse-openjpeg", optional = true }
j2k = { version = "=0.8.1", optional = true }
[dev-dependencies]
stats_alloc = "0.1.10"

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,15 @@
//! Image and texture abstractions corresponding to `LibreMetaverse.Imaging`.
//!
//! The default surface provides managed images plus native `TGA`/`DDS` handling.
//! Enable `jpeg2000` only when the audited system `OpenJPEG` adapter is available;
//! ordinary users can consume the traits without a native image dependency.
//! Enable `jpeg2000` for the audited system `OpenJPEG` adapter or `rust-j2k`
//! for the independently selectable pure-Rust JPEG 2000 backend. Ordinary
//! users can consume the traits without either codec dependency.
extern crate self as libremetaverse_imaging;
pub mod codec;
#[cfg(feature = "jpeg2000")]
#[cfg(any(feature = "jpeg2000", feature = "rust-j2k"))]
mod jpeg2000;
mod generated;
@@ -16,6 +17,10 @@ mod managed_image;
pub use generated::*;
#[cfg(feature = "jpeg2000")]
pub use jpeg2000::{J2kCodec, J2kCompression, J2kDecodeOptions, J2kEncodeOptions, J2kFormat};
pub use jpeg2000::J2kCodec;
#[cfg(feature = "rust-j2k")]
pub use jpeg2000::RustJ2kCodec;
#[cfg(any(feature = "jpeg2000", feature = "rust-j2k"))]
pub use jpeg2000::{J2kCompression, J2kDecodeOptions, J2kEncodeOptions, J2kFormat};
pub use libremetaverse_types::Error;
pub use managed_image::{DEFAULT_MAX_ENCODED_BYTES, DEFAULT_MAX_PIXELS};