#!/bin/csh

set in = grid_rgb.ppm

set formatList = ( l la rgb rgba )
set typeList = ( u8 u16 f32 )
set qualityList = ( 100 10 )

foreach format ($formatList)
  foreach type ($typeList)
    foreach quality ($qualityList)
        
      set out = "out"
      set out = ${out}-format_${format}
      set out = ${out}-type_${type}
      set out = ${out}-quality_${quality}
      set out = ${out}.jpeg
          
      ../../bin/djop \
        $in $out \
        -saveFormat $format \
        -saveType $type \
        -saveAttr jpeg quality $quality
      if ($status != 0) then
        exit 1
      endif

    end
  end
end
