Skip to content

Commit

Permalink
Added more bits and pieces to the spline rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
zond committed Dec 17, 2024
1 parent da06bfe commit 8c9dde4
Show file tree
Hide file tree
Showing 3 changed files with 402 additions and 18 deletions.
10 changes: 8 additions & 2 deletions jxl/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use std::collections::TryReserveError;

use thiserror::Error;

use crate::{entropy_coding::huffman::HUFFMAN_MAX_BITS, image::DataTypeTag};
use crate::{
entropy_coding::huffman::HUFFMAN_MAX_BITS, features::spline::Point, image::DataTypeTag,
};

#[derive(Error, Debug)]
pub enum Error {
Expand Down Expand Up @@ -111,18 +113,22 @@ pub enum Error {
InvalidPredictor(u32),
#[error("Invalid modular mode property: {0}")]
InvalidProperty(u32),
#[error("Point list is empty")]
PointListEmpty,
#[error("Too large area for spline: {0}, limit is {1}")]
SplinesAreaTooLarge(u64, u64),
#[error("Too large manhattan_distance reached: {0}, limit is {1}")]
SplinesDistanceTooLarge(u64, u64),
#[error("Too many splines: {0}, limit is {1}")]
SplinesTooMany(u32, u32),
#[error("Spline has adjacent coinciding control points: point[{0}]: {1:?}, point[{2}]: {3:?}")]
SplineAdjacentCoincidingControlPoints(u32, Point, u32, Point),
#[error("Too many control points for splines: {0}, limit is {1}")]
SplinesTooManyControlPoints(u32, u32),
#[error(
"Spline point outside valid bounds: coordinates: {0:?}, out of bounds: {1}, bounds: {2:?}"
)]
SplinesPointOutOfRange((i32, i32), i32, std::ops::Range<i32>),
SplinesPointOutOfRange(Point, i32, std::ops::Range<i32>),
#[error("Spline coordinates out of bounds: {0}, limit is {1}")]
SplinesCoordinatesLimit(i32, i32),
#[error("Spline delta-delta is out of bounds: {0}, limit is {1}")]
Expand Down
Loading

0 comments on commit 8c9dde4

Please # to comment.