Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/ape/lib/jbig/pbmtools/mkfile

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


APE=/sys/src/ape
<$APE/config

BIN=/$objtype/bin

TARG=\
	jbgtopbm\
	pbmtojbg\

</sys/src/cmd/mkmany

CFLAGS=-c

test:Q: $O.pbmtojbg $O.jbgtopbm
	mk 'IMG=ccitt1'					dotest1
	mk 'IMG=ccitt2'					dotest1
	mk 'IMG=ccitt3'					dotest1
	mk 'IMG=xvlogo'	'OPTIONSP=-d 3' 		dotest1
	mk 'IMG=sandra'					dotest2g
	mk 'IMG=sandra'	'OPTIONSP=-b'	'OPTIONSJ=-b'	dotest2g
	mk 'IMG=sandra'	'OPTIONSP=-q'			dotest2g
	mk 'IMG=sandra'	'OPTIONSP=-o 0' 		dotest2g
	mk 'IMG=sandra'	'OPTIONSP=-o 2'			dotest2g
	mk 'IMG=multi' 					dotest2g
	mk 'IMG=multi'	'OPTIONSP=-b'	'OPTIONSJ=-b'	dotest2g
	mk 'IMG=mx'	'OPTIONSP=-q -s 3 -m 128'       dotest1
	mk 'IMG=mx'	'OPTIONSP=-q -s 3 -m 128'       dotest2b
	mk 'IMG=mx'	'OPTIONSP=-q -s 3 -m 128 -p 92' dotest2b
	mk 'IMG=mx'	'OPTIONSP=-q -Y -1'		dotest2b
	mk 'IMG=mx'	'OPTIONSP=-Y -1'		dotest2b
	rm -f test-*.jbg test-*.pbm test-*.pgm
	$O.jbgtopbm ../examples/ccitt1.jbg | $O.pbmtojbg > test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	$O.jbgtopbm < ../examples/ccitt1.jbg | $O.pbmtojbg - test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	$O.jbgtopbm < ../examples/ccitt1.jbg - test-ccitt1.pbm ; \
	$O.pbmtojbg test-ccitt1.pbm test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	$O.jbgtopbm ../examples/ccitt1.jbg test-ccitt1.pbm ; \
	$O.pbmtojbg test-ccitt1.pbm >test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	echo
	echo The pbmtools have PASSED the functional tests. Good!
	echo

dotest1:
	$O.jbgtopbm $OPTIONSJ ../examples/$IMG.jbg test-$IMG.pbm
	$O.pbmtojbg $OPTIONSP test-$IMG.pbm test-$IMG.jbg
	cmp test-$IMG.jbg ../examples/$IMG.jbg

dotest2b:
	$O.pbmtojbg $OPTIONSP test-$IMG.pbm test-$IMG.jbg
	$O.jbgtopbm $OPTIONSJ test-$IMG.jbg test-$IMG-2.pbm
	cmp test-$IMG.pbm test-$IMG-2.pbm

dotest2g:
	$O.pbmtojbg $OPTIONSP ../examples/$IMG.pgm test-$IMG.jbg
	$O.jbgtopbm $OPTIONSJ test-$IMG.jbg test-$IMG.pgm
	cmp test-$IMG.pgm ../examples/$IMG.pgm


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].