#!/bin/csh

set in = grid_rgb.ppm

set formatList = ( l la rgb rgba )
set typeList = ( u8 u16 f32 )
set compressList = ( none piz zip rle )
set bitDepthList = ( auto f16 f32 )

foreach format ($formatList)
  foreach type ($typeList)
    foreach compress ($compressList)
      foreach bitDepth ($bitDepthList)
        
        set out = "out"
        set out = ${out}-format_${format}
        set out = ${out}-type_${type}
        set out = ${out}-compress_${compress}
        set out = ${out}-bitDepth_${bitDepth}
        set out = ${out}.exr
          
        ../../bin/djop \
          $in $out \
          -saveFormat $format \
          -saveType $type \
          -saveAttr exr compress $compress \
          -saveAttr exr "bit depth" $bitDepth
        if ($status != 0) then
          exit 1
        endif

      end
    end
  end
end
