about summary refs log tree commit diff
path: root/test/pamchannel.test
blob: f83dd3b60698153e7d11db37da0d88d924fa80c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/bash
# This script tests: pamchannel
# Also requires: pamtopnm


# Extract planes one by one.
# Convert output to pgm to make it identical to ppmtorgb3 output.

# $ ppmtorgb3 testimg.ppm ; cksum testimg.{red,grn,blu}
#
# 1571496937 33838 testimg.red
# 394856971 33838 testimg.grn
# 3164158573 33838 testimg.blu


# Test 1. red channel
# Should produce 1571496937 33838

${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 0 | \
  ${PBM_BINPREFIX}pamtopnm --assume | cksum

# Test 2. green channel
# Should produce  394856971 33838

${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 1 | \
  ${PBM_BINPREFIX}pamtopnm --assume | cksum

# Test 3. blue channel
# Should produce 3164158573 33838

${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 2 | \
  ${PBM_BINPREFIX}pamtopnm --assume | cksum