DECLAREcpFunc(cpSeparate2ContigByRow)
{
	tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));
	tdata_t outbuf = _TIFFmalloc(TIFFScanlineSize(out));
	register uint8 *inp, *outp;
	register uint32 n;
	uint32 row;
	tsample_t s;
	for (row = 0; row < imagelength; row++) {
		for (s = 0; s < spp; s++) {
			if (TIFFReadScanline(in, inbuf, row, s) < 0
			    && !ignore) {
				TIFFError(TIFFFileName(in),
				    "Error, can't read scanline %lu",
				    (unsigned long) row);
				goto bad;
			}
			inp = (uint8*)inbuf;
			outp = ((uint8*)outbuf) + s;
			for (n = imagewidth; n-- > 0;) {
				*outp = *inp++;
				outp += spp;
			}
		}
		if (TIFFWriteScanline(out, outbuf, row, 0) < 0) {
			TIFFError(TIFFFileName(out),
			    "Error, can't write scanline %lu",
			    (unsigned long) row);
			goto bad;
		}
	}
	if (inbuf) _TIFFfree(inbuf);
	if (outbuf) _TIFFfree(outbuf);
	return 1;
bad:
	if (inbuf) _TIFFfree(inbuf);
	if (outbuf) _TIFFfree(outbuf);
	return 0;
}
['DECLAREcpFunc(cpSeparate2ContigByRow)\n{\n\ttdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));\n\ttdata_t outbuf = _TIFFmalloc(TIFFScanlineSize(out));\n\tregister uint8 *inp, *outp;\n\tregister uint32 n;\n\tuint32 row;\n\ttsample_t s;\n\tfor (row = 0; row < imagelength; row++) {\n\t\tfor (s = 0; s < spp; s++) {\n\t\t\tif (TIFFReadScanline(in, inbuf, row, s) < 0\n\t\t\t    && !ignore) {\n\t\t\t\tTIFFError(TIFFFileName(in),\n\t\t\t\t    "Error, can\'t read scanline %lu",\n\t\t\t\t    (unsigned long) row);\n\t\t\t\tgoto bad;\n\t\t\t}\n\t\t\tinp = (uint8*)inbuf;\n\t\t\toutp = ((uint8*)outbuf) + s;\n\t\t\tfor (n = imagewidth; n-- > 0;) {\n\t\t\t\t*outp = *inp++;\n\t\t\t\toutp += spp;\n\t\t\t}\n\t\t}\n\t\tif (TIFFWriteScanline(out, outbuf, row, 0) < 0) {\n\t\t\tTIFFError(TIFFFileName(out),\n\t\t\t    "Error, can\'t write scanline %lu",\n\t\t\t    (unsigned long) row);\n\t\t\tgoto bad;\n\t\t}\n\t}\n\tif (inbuf) _TIFFfree(inbuf);\n\tif (outbuf) _TIFFfree(outbuf);\n\treturn 1;\nbad:\n\tif (inbuf) _TIFFfree(inbuf);\n\tif (outbuf) _TIFFfree(outbuf);\n\treturn 0;\n}']