#!/bin/sh
# Copyright (C) 2004-2012 GraphicsMagick Group
. ./common.shi
. ${top_srcdir}/tests/common.shi

# Test program
rwfile=./rwfile

# Types we will test
check_types='truecolor_70x46'

# Number of tests we plan to run
test_plan_fn 22

# CMYK format
for type in ${check_types}
do
  for interlace in none line plane
  do
    test_command_fn "CMYK ${type} interlace=${interlace}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_${interlace}_%d" -size 70x46  -interlace ${interlace} "${SRCDIR}/input_${type}.miff" CMYK
  done
done

# GRAY format
for type in ${check_types}
do
  test_command_fn "GRAY ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" GRAY
done

# GRAYA format
for type in ${check_types}
do
  test_command_fn "GRAYA ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" GRAYA
done

# R format
for type in ${check_types}
do
  test_command_fn "R (red) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" R
done

# G format
for type in ${check_types}
do
  test_command_fn "G (green) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" G
done

# B format
for type in ${check_types}
do
  test_command_fn "B (blue) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" B
done

# C format
for type in ${check_types}
do
  test_command_fn "C (cyan) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" C
done

# M format
for type in ${check_types}
do
  test_command_fn "M (magenta) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" M
done

# Y format
for type in ${check_types}
do
  test_command_fn "Y (yellow) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" Y
done

# K format
for type in ${check_types}
do
  test_command_fn "K (black) ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" K
done

# MONO format
for type in ${check_types}
do
  test_command_fn "MONO ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" MONO
done

# PAL format
for type in ${check_types}
do
  test_command_fn "PAL ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" PAL
done

# RGB format
for type in ${check_types}
do
  for interlace in none line plane
  do
    test_command_fn "RGB ${type} interlace=${interlace}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_${interlace}_%d" -size 70x46 -interlace ${interlace} "${SRCDIR}/input_${type}.miff" RGB
  done
done

# RGBA format
for type in ${check_types}
do
  for interlace in none line plane
  do
    test_command_fn "RGBA ${type} interlace=${interlace}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_${interlace}_%d" -size 70x46 -interlace ${interlace} "${SRCDIR}/input_${type}.miff" RGBA
  done
done

# UYVY format
for type in ${check_types}
do
  test_command_fn "UYVY ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" UYVY
done

# YUV format
for type in ${check_types}
do
  test_command_fn "YUV ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" -size 70x46 "${SRCDIR}/input_${type}.miff" YUV
done

:
