# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.70"
name = "jpegli-rs"
version = "0.3.0"
authors = ["Lilith River <lilith@imazen.io>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Pure Rust JPEG encoder/decoder - port of Google's jpegli with perceptual optimizations"
documentation = "https://docs.rs/jpegli-rs"
readme = "README.md"
keywords = [
    "jpeg",
    "image",
    "encoder",
    "decoder",
    "compression",
]
categories = [
    "multimedia::images",
    "encoding",
]
license = "AGPL-3.0-or-later"
repository = "https://github.com/imazen/jpegli-rs"

[features]
cms = ["cms-lcms2"]
cms-lcms2 = [
    "dep:lcms2",
    "dep:jpeg-decoder",
]
cms-moxcms = [
    "dep:moxcms",
    "dep:jpeg-decoder",
]
corpus-tests = ["dep:codec-eval"]
debug-tokens = []
default = [
    "simd",
    "cms",
]
experimental-hybrid-trellis = ["dep:mozjpeg-rs"]
ffi-tests = []
simd = []
test-utils = []

[lib]
name = "jpegli"
path = "src/lib.rs"

[[example]]
name = "aq_analysis"
path = "examples/aq_analysis.rs"

[[example]]
name = "aq_scaling_test"
path = "examples/aq_scaling_test.rs"

[[example]]
name = "benchmark_xyb_vs_ycbcr"
path = "examples/benchmark_xyb_vs_ycbcr.rs"
required-features = ["test-utils"]

[[example]]
name = "check_0x61"
path = "examples/check_0x61.rs"

[[example]]
name = "check_ac_symbols"
path = "examples/check_ac_symbols.rs"

[[example]]
name = "check_huffman"
path = "examples/check_huffman.rs"

[[example]]
name = "compare_bits"
path = "examples/compare_bits.rs"

[[example]]
name = "compare_cms"
path = "examples/compare_cms.rs"

[[example]]
name = "compare_coefficients"
path = "examples/compare_coefficients.rs"
required-features = ["test-utils"]

[[example]]
name = "compare_cpp_quant"
path = "examples/compare_cpp_quant.rs"

[[example]]
name = "compare_dct"
path = "examples/compare_dct.rs"

[[example]]
name = "compare_decoded"
path = "examples/compare_decoded.rs"
required-features = ["test-utils"]

[[example]]
name = "compare_djpegli"
path = "examples/compare_djpegli.rs"

[[example]]
name = "compare_encoders"
path = "examples/compare_encoders.rs"

[[example]]
name = "compare_headers"
path = "examples/compare_headers.rs"

[[example]]
name = "compare_prog_reference"
path = "examples/compare_prog_reference.rs"

[[example]]
name = "compare_quality"
path = "examples/compare_quality.rs"
required-features = ["test-utils"]

[[example]]
name = "compare_quant_tables"
path = "examples/compare_quant_tables.rs"
required-features = ["test-utils"]

[[example]]
name = "compare_to_original"
path = "examples/compare_to_original.rs"
required-features = ["test-utils"]

[[example]]
name = "compare_xyb_constants"
path = "examples/compare_xyb_constants.rs"
required-features = [
    "test-utils",
    "ffi-tests",
]

[[example]]
name = "corpus_comparison"
path = "examples/corpus_comparison.rs"

[[example]]
name = "create_test_jpeg"
path = "examples/create_test_jpeg.rs"

[[example]]
name = "debug_50x50"
path = "examples/debug_50x50.rs"

[[example]]
name = "debug_ac_symbols"
path = "examples/debug_ac_symbols.rs"

[[example]]
name = "debug_aq_values"
path = "examples/debug_aq_values.rs"
required-features = ["test-utils"]

[[example]]
name = "debug_block_by_block"
path = "examples/debug_block_by_block.rs"

[[example]]
name = "debug_block_trace"
path = "examples/debug_block_trace.rs"

[[example]]
name = "debug_byte_trace"
path = "examples/debug_byte_trace.rs"

[[example]]
name = "debug_coef_patterns"
path = "examples/debug_coef_patterns.rs"

[[example]]
name = "debug_coeffs"
path = "examples/debug_coeffs.rs"

[[example]]
name = "debug_compare_49_50"
path = "examples/debug_compare_49_50.rs"

[[example]]
name = "debug_compare_scan"
path = "examples/debug_compare_scan.rs"

[[example]]
name = "debug_decode"
path = "examples/debug_decode.rs"

[[example]]
name = "debug_decode_content"
path = "examples/debug_decode_content.rs"

[[example]]
name = "debug_decode_detail"
path = "examples/debug_decode_detail.rs"

[[example]]
name = "debug_decode_refine"
path = "examples/debug_decode_refine.rs"

[[example]]
name = "debug_decode_sizes"
path = "examples/debug_decode_sizes.rs"

[[example]]
name = "debug_decode_step"
path = "examples/debug_decode_step.rs"

[[example]]
name = "debug_decode_trace"
path = "examples/debug_decode_trace.rs"

[[example]]
name = "debug_failing_jpeg"
path = "examples/debug_failing_jpeg.rs"

[[example]]
name = "debug_gray_prog"
path = "examples/debug_gray_prog.rs"

[[example]]
name = "debug_histogram"
path = "examples/debug_histogram.rs"

[[example]]
name = "debug_minimal_refine"
path = "examples/debug_minimal_refine.rs"

[[example]]
name = "debug_no_refine"
path = "examples/debug_no_refine.rs"

[[example]]
name = "debug_optimized_50"
path = "examples/debug_optimized_50.rs"

[[example]]
name = "debug_prog"
path = "examples/debug_prog.rs"

[[example]]
name = "debug_progressive_decode"
path = "examples/debug_progressive_decode.rs"

[[example]]
name = "debug_quant_field"
path = "examples/debug_quant_field.rs"
required-features = ["test-utils"]

[[example]]
name = "debug_refine_bits"
path = "examples/debug_refine_bits.rs"

[[example]]
name = "debug_refine_blocks"
path = "examples/debug_refine_blocks.rs"

[[example]]
name = "debug_refine_symbols"
path = "examples/debug_refine_symbols.rs"

[[example]]
name = "debug_roundtrip"
path = "examples/debug_roundtrip.rs"
required-features = ["test-utils"]

[[example]]
name = "debug_scans_separate"
path = "examples/debug_scans_separate.rs"
required-features = ["test-utils"]

[[example]]
name = "debug_simple"
path = "examples/debug_simple.rs"

[[example]]
name = "debug_simple_prog"
path = "examples/debug_simple_prog.rs"

[[example]]
name = "debug_single_block"
path = "examples/debug_single_block.rs"

[[example]]
name = "debug_trace_refine"
path = "examples/debug_trace_refine.rs"

[[example]]
name = "decode_benchmark"
path = "examples/decode_benchmark.rs"

[[example]]
name = "decoder_compare"
path = "examples/decoder_compare.rs"

[[example]]
name = "dump_huffman"
path = "examples/dump_huffman.rs"

[[example]]
name = "encode_benchmark"
path = "examples/encode_benchmark.rs"

[[example]]
name = "encode_xyb"
path = "examples/encode_xyb.rs"

[[example]]
name = "encode_xyb_hybrid"
path = "examples/encode_xyb_hybrid.rs"

[[example]]
name = "generate_cpp_reference"
path = "examples/generate_cpp_reference.rs"
required-features = ["test-utils"]

[[example]]
name = "generate_parity_values"
path = "examples/generate_parity_values.rs"

[[example]]
name = "huffman_corpus_validation"
path = "examples/huffman_corpus_validation.rs"

[[example]]
name = "hybrid_benchmark"
path = "examples/hybrid_benchmark.rs"

[[example]]
name = "hybrid_comparison"
path = "examples/hybrid_comparison.rs"

[[example]]
name = "hybrid_sweep"
path = "examples/hybrid_sweep.rs"

[[example]]
name = "jpegli_debug"
path = "examples/jpegli_debug.rs"

[[example]]
name = "low_q_report"
path = "examples/low_q_report.rs"
required-features = ["test-utils"]

[[example]]
name = "minimal_refine_trace"
path = "examples/minimal_refine_trace.rs"

[[example]]
name = "multi_codec_comparison"
path = "examples/multi_codec_comparison.rs"

[[example]]
name = "pareto_comparison"
path = "examples/pareto_comparison.rs"

[[example]]
name = "quality_comparison"
path = "examples/quality_comparison.rs"
required-features = ["test-utils"]

[[example]]
name = "roundtrip_corpus"
path = "examples/roundtrip_corpus.rs"

[[example]]
name = "test_multiple_decoders"
path = "examples/test_multiple_decoders.rs"
required-features = ["test-utils"]

[[example]]
name = "test_our_decoder"
path = "examples/test_our_decoder.rs"

[[example]]
name = "test_photo_like"
path = "examples/test_photo_like.rs"

[[example]]
name = "test_refine_debug"
path = "examples/test_refine_debug.rs"

[[example]]
name = "test_s444_external"
path = "examples/test_s444_external.rs"

[[example]]
name = "test_size_scaling"
path = "examples/test_size_scaling.rs"

[[example]]
name = "test_std_huffman"
path = "examples/test_std_huffman.rs"

[[example]]
name = "trace_decode"
path = "examples/trace_decode.rs"

[[example]]
name = "trace_refine_encoding"
path = "examples/trace_refine_encoding.rs"

[[example]]
name = "trace_single_fail"
path = "examples/trace_single_fail.rs"

[[example]]
name = "validate_jpeg"
path = "examples/validate_jpeg.rs"

[[example]]
name = "verify_icc_decode"
path = "examples/verify_icc_decode.rs"

[[example]]
name = "verify_jpeg"
path = "examples/verify_jpeg.rs"

[[example]]
name = "xyb_aq_test"
path = "examples/xyb_aq_test.rs"

[[example]]
name = "xyb_butteraugli_comparison"
path = "examples/xyb_butteraugli_comparison.rs"
required-features = ["test-utils"]

[[example]]
name = "xyb_comparison"
path = "examples/xyb_comparison.rs"

[[example]]
name = "xyb_cpp_comparison"
path = "examples/xyb_cpp_comparison.rs"

[[example]]
name = "xyb_distance_comparison"
path = "examples/xyb_distance_comparison.rs"
required-features = ["test-utils"]

[[example]]
name = "xyb_parity_test"
path = "examples/xyb_parity_test.rs"

[[example]]
name = "xyb_same_size_comparison"
path = "examples/xyb_same_size_comparison.rs"
required-features = ["test-utils"]

[[example]]
name = "xyb_ssimulacra2_comparison"
path = "examples/xyb_ssimulacra2_comparison.rs"
required-features = ["test-utils"]

[[example]]
name = "xyb_vs_ycbcr_butteraugli"
path = "examples/xyb_vs_ycbcr_butteraugli.rs"

[[example]]
name = "xyb_vs_ycbcr_comparison"
path = "examples/xyb_vs_ycbcr_comparison.rs"
required-features = ["test-utils"]

[[example]]
name = "xyb_ycbcr_pareto"
path = "examples/xyb_ycbcr_pareto.rs"
required-features = ["test-utils"]

[[test]]
name = "aq_cpp_comparison"
path = "tests/aq_cpp_comparison.rs"

[[test]]
name = "aq_locked_tests"
path = "tests/aq_locked_tests.rs"

[[test]]
name = "codec_corpus_conformance"
path = "tests/codec_corpus_conformance.rs"

[[test]]
name = "codec_coverage"
path = "tests/codec_coverage.rs"

[[test]]
name = "color_encoding"
path = "tests/color_encoding.rs"

[[test]]
name = "compare_420_cpp"
path = "tests/compare_420_cpp.rs"

[[test]]
name = "compare_sizes"
path = "tests/compare_sizes.rs"

[[test]]
name = "comprehensive_cpp_comparison"
path = "tests/comprehensive_cpp_comparison.rs"

[[test]]
name = "corpus_cpp_comparison"
path = "tests/corpus_cpp_comparison.rs"

[[test]]
name = "coverage_extension"
path = "tests/coverage_extension.rs"

[[test]]
name = "cpp_comparison"
path = "tests/cpp_comparison.rs"

[[test]]
name = "cpp_filesize_comparison"
path = "tests/cpp_filesize_comparison.rs"

[[test]]
name = "cpp_parity_locked"
path = "tests/cpp_parity_locked.rs"

[[test]]
name = "cpp_quality_comparison"
path = "tests/cpp_quality_comparison.rs"

[[test]]
name = "cpp_reference_parity"
path = "tests/cpp_reference_parity.rs"

[[test]]
name = "decode_api"
path = "tests/decode_api.rs"

[[test]]
name = "decode_external"
path = "tests/decode_external.rs"

[[test]]
name = "decoder_error_handling"
path = "tests/decoder_error_handling.rs"

[[test]]
name = "decoder_parity"
path = "tests/decoder_parity.rs"

[[test]]
name = "encode_api"
path = "tests/encode_api.rs"

[[test]]
name = "error_handling"
path = "tests/error_handling.rs"

[[test]]
name = "fast_math_cpp_comparison"
path = "tests/fast_math_cpp_comparison.rs"

[[test]]
name = "huffman_cpp_comparison"
path = "tests/huffman_cpp_comparison.rs"

[[test]]
name = "metrics_comparison"
path = "tests/metrics_comparison.rs"

[[test]]
name = "parametrized_quality"
path = "tests/parametrized_quality.rs"

[[test]]
name = "pareto_front"
path = "tests/pareto_front.rs"

[[test]]
name = "parity_enforcement"
path = "tests/parity_enforcement.rs"

[[test]]
name = "parity_reference_locked"
path = "tests/parity_reference_locked.rs"

[[test]]
name = "progressive_encoding"
path = "tests/progressive_encoding.rs"

[[test]]
name = "q100_comparison"
path = "tests/q100_comparison.rs"

[[test]]
name = "quality_mapping"
path = "tests/quality_mapping.rs"

[[test]]
name = "roundtrip_corpus"
path = "tests/roundtrip_corpus.rs"

[[test]]
name = "roundtrip_quality"
path = "tests/roundtrip_quality.rs"

[[test]]
name = "s440_progressive_bug"
path = "tests/s440_progressive_bug.rs"

[[test]]
name = "scan_script_validation"
path = "tests/scan_script_validation.rs"

[[test]]
name = "subsampling_tests"
path = "tests/subsampling_tests.rs"

[[test]]
name = "tone_mapping"
path = "tests/tone_mapping.rs"

[[test]]
name = "transfer_functions"
path = "tests/transfer_functions.rs"

[[test]]
name = "visual_encoding"
path = "tests/visual_encoding.rs"

[[test]]
name = "xyb_cpp_comparison"
path = "tests/xyb_cpp_comparison.rs"

[[test]]
name = "xyb_roundtrip"
path = "tests/xyb_roundtrip.rs"

[[bench]]
name = "decode"
path = "benches/decode.rs"
harness = false

[[bench]]
name = "encode"
path = "benches/encode.rs"
harness = false

[dependencies.arrayref]
version = "0.3"

[dependencies.butteraugli]
version = "0.3"

[dependencies.bytemuck]
version = "1.14"
features = ["derive"]

[dependencies.codec-eval]
version = "0.2"
optional = true

[dependencies.imgref]
version = "1.10"

[dependencies.jpeg-decoder]
version = "0.3"
optional = true

[dependencies.lcms2]
version = "6.0"
optional = true

[dependencies.moxcms]
version = "0.6"
optional = true

[dependencies.mozjpeg-rs]
version = "0.2"
optional = true

[dependencies.multiversion]
version = "0.7"

[dependencies.rgb]
version = "0.8"

[dependencies.wide]
version = "0.7"

[dev-dependencies.approx]
version = "0.5"

[dev-dependencies.bincode]
version = "1.3"

[dev-dependencies.chrono]
version = "0.4"

[dev-dependencies.criterion]
version = "0.5"

[dev-dependencies.dssim]
version = "3.2"

[dev-dependencies.jpeg-decoder]
version = "0.3"

[dev-dependencies.mozjpeg]
version = "0.10"

[dev-dependencies.png]
version = "0.17"

[dev-dependencies.proptest]
version = "1.4"

[dev-dependencies.serde]
version = "1.0"
features = ["derive"]

[dev-dependencies.serde_json]
version = "1.0"

[dev-dependencies.ssimulacra2]
version = "0.5"

[dev-dependencies.test-case]
version = "3.3"

[dev-dependencies.zune-jpeg]
version = "0.4"

[lints.clippy]
approx_constant = "allow"
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
doc_markdown = "allow"
doc_overindented_list_items = "allow"
enum_variant_names = "allow"
excessive_precision = "allow"
items_after_statements = "allow"
many_single_char_names = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
must_use_candidate = "allow"
needless_range_loop = "allow"
redundant_closure = "allow"
similar_names = "allow"
too_many_arguments = "allow"
type_complexity = "allow"
uninlined_format_args = "allow"
unnecessary_wraps = "allow"
unreadable_literal = "allow"
unused_self = "allow"

[lints.clippy.all]
level = "warn"
priority = -1

[lints.rust]
unsafe_code = "warn"
