#! /bin/csh -f -e

set dirs = ( \
    95-09-16-230228 \
    95-09-16-232950 \
    95-09-17-012718 \
    95-09-17-014530 \
    95-09-17-015949 \
    95-09-17-020741 \
    96-04-09-192500 \
    96-04-09-233954 \
    96-04-10-214806 \
  )

set curd = "$cwd"

foreach f ( ${dirs} )
  echo $f
  cd ${curd}/$f
  # Turn the blue background into separate black and white images:
  cat dcc-logo-white.ppm | pnmflip -rotate90 | pnmdepth 255 | ppmtorgb3 
  rgb3toppm noname.red  noname.red noname.red > p-black.pgm
  rgb3toppm noname.blu  noname.blu noname.blu > p-white.pgm
  # make smaller versions:
  cat p-black.pgm | pnmscale -xsize 80 | pnmdepth 255 > q-black.pgm
  cat p-white.pgm | pnmscale -xsize 80 | pnmdepth 255 > q-white.pgm
  # combine them into a transparent gif:
  foreach pic ( p q )
    ppmoquant \
      -fs \
      -transparent '(0,0,1)' \
      -map ${HOME}/PUB/lib/standard-6x6x6-linear-colormap.ppm \
      ${pic}-black.pgm ${pic}-white.pgm \
    | pnmgamma 1.8 \
    | ppmtogif -transparent 'rgb:00/00/0c' \
    > ${pic}.gif
  end
  xv *.{ppm,pgm,gif,red,grn,blu}
end
