Document DDS result fields and errors

This commit is contained in:
Dylan M. Taylor committed 2026-11-15 13:59:20 -05:00
1 parent 2797955187
commit 726ad0f829
1 file changed
+6
+6
View File
@@ -7,10 +7,13 @@
use crate::{ImageError, Kind, Limits};
/// A malformed DDS/backend failure or rejected output allocation.
#[derive(Debug, thiserror::Error)]
pub enum DecodeError {
/// Output size or allocation failed shared image limits.
#[error(transparent)]
Image(#[from] ImageError),
/// The decoder rejected input or output geometry.
#[error("DDS decode failed: {0}")]
Decode(String),
}
@@ -18,8 +21,11 @@ pub enum DecodeError {
/// Unmodified backend output. Alpha and out-of-range float values are not clamped.
#[derive(Debug)]
pub struct Surface {
/// Width of the first surface in pixels.
pub width: u32,
/// Height of the first surface in pixels.
pub height: u32,
/// Row-major RGBA float samples without transfer conversion.
pub rgba: Vec<f32>,
/// Exactly the backend's `Precision::F32` classification, as used by MaterialCraft.
pub source_precision_is_f32: bool,