test_dng_validate.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. set -e
  3. if [ $# -ne 1 ]; then
  4. echo "Missing tool argument"
  5. exit 1
  6. fi
  7. makedng="$1"
  8. echo "Running tests with '$makedng'"
  9. # This testsuite runs raw data through the makedng utility and validates the
  10. # result using the dng_validate tool from the Adobe DNG SDK. This tool needs
  11. # to be manually installed for these tests to run.
  12. # Create test raw data
  13. mkdir -p scratch
  14. magick -size 1280x720 gradient: -colorspace RGB scratch/data.rgb
  15. # Generate DNG
  16. $makedng -w 1280 -h 720 -p RGGB -m Test,RGGB scratch/data.rgb scratch/RGGB.dng
  17. $makedng -w 1280 -h 720 -p GRBG -m Test,GRBG scratch/data.rgb scratch/GRBG.dng
  18. $makedng -w 1280 -h 720 -p GBRG -m Test,GBRG scratch/data.rgb scratch/GBRG.dng
  19. $makedng -w 1280 -h 720 -p BGGR -m Test,BGGR scratch/data.rgb scratch/BGGR.dng
  20. $makedng -w 1280 -h 720 -p RG10 scratch/data.rgb scratch/RG10.dng
  21. $makedng -w 1280 -h 720 -p SRGGB10P scratch/data.rgb scratch/SRGGB10P.dng
  22. $makedng --width 1280 --height 720 --pixfmt RGGB \
  23. --software "Testsuite" \
  24. --orientation 2 \
  25. --neutral 0.1,0.2,0.3 \
  26. --balance 0.4,0.5,0.6 \
  27. --program 2 \
  28. --exposure 0.01 \
  29. --iso 1600 \
  30. --fnumber 2.8 \
  31. --focal-length 50,1.5 \
  32. --frame-rate 30 \
  33. scratch/data.rgb scratch/fields.dng
  34. # Validate DNG
  35. dng_validate scratch/RGGB.dng
  36. dng_validate scratch/GRBG.dng
  37. dng_validate scratch/GBRG.dng
  38. dng_validate scratch/BGGR.dng
  39. dng_validate scratch/RG10.dng
  40. dng_validate scratch/SRGGB10P.dng
  41. dng_validate scratch/fields.dng