*** empty log message ***

This commit is contained in:
Andrey Kiselev 2004-09-15 13:00:02 +00:00
parent 41a9133549
commit eca092d8d3
3 changed files with 381 additions and 118 deletions

View File

@ -1,4 +1,4 @@
/* $Id: strip_rw.c,v 1.1 2004-09-14 15:01:16 dron Exp $ */
/* $Id: strip_rw.c,v 1.2 2004-09-15 13:00:02 dron Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@remotesensing.org>
@ -32,6 +32,7 @@
#include "tif_config.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
@ -43,10 +44,10 @@
const char *filename = "strip_test.tiff";
int
write_strips(TIFF *tif, tdata_t array, tsize_t size)
write_strips(TIFF *tif, const tdata_t array, const tsize_t size)
{
tstrip_t strip;
tsize_t stripsize, offset;
tstrip_t strip, nstrips;
tsize_t stripsize, offset;
stripsize = TIFFStripSize(tif);
if (!stripsize) {
@ -54,9 +55,19 @@ write_strips(TIFF *tif, tdata_t array, tsize_t size)
return -1;
}
for (offset = 0, strip = 0; offset < size; offset+=stripsize, strip++) {
nstrips = TIFFNumberOfStrips(tif);
for (offset = 0, strip = 0;
offset < size && strip < nstrips;
offset+=stripsize, strip++) {
/*
* Properly write last strip.
*/
tsize_t bufsize = size - offset;
if (bufsize > stripsize)
bufsize = stripsize;
if (TIFFWriteEncodedStrip(tif, strip, (char *)array + offset,
stripsize) < 0) {
bufsize) != bufsize) {
fprintf (stderr, "Can't write strip %d.\n", (int)strip);
return -1;
}
@ -66,10 +77,199 @@ write_strips(TIFF *tif, tdata_t array, tsize_t size)
}
int
write_scanlines(TIFF *tif, tdata_t array, tsize_t size)
read_strips(TIFF *tif, const tdata_t array, const tsize_t size)
{
uint32 length, row;
tsize_t scanlinesize, offset;
tstrip_t strip, nstrips;
tsize_t stripsize, offset;
tdata_t buf = NULL;
stripsize = TIFFStripSize(tif);
if (!stripsize) {
fprintf (stderr, "Wrong size of strip.\n");
return -1;
}
buf = _TIFFmalloc(stripsize);
if (!buf) {
fprintf (stderr, "Can't allocate space for strip buffer.\n");
return -1;
}
nstrips = TIFFNumberOfStrips(tif);
for (offset = 0, strip = 0;
offset < size && strip < nstrips;
offset+=stripsize, strip++) {
/*
* Properly read last strip.
*/
tsize_t bufsize = size - offset;
if (bufsize > stripsize)
bufsize = stripsize;
if (TIFFReadEncodedStrip(tif, strip, buf, -1) != bufsize) {
fprintf (stderr, "Can't read strip %d.\n", (int)strip);
return -1;
}
if (memcmp(buf, (char *)array + offset, bufsize) != 0) {
fprintf (stderr, "Wrong data read for strip %d.\n",
strip);
_TIFFfree(buf);
return -1;
}
}
_TIFFfree(buf);
return 0;
}
int
create_image_stripped(const char *name, uint32 width, uint32 length,
uint32 rowsperstrip, uint16 compression,
uint16 spp, uint16 bps, uint16 photometric,
uint16 sampleformat, uint16 planarconfig,
const tdata_t array, const tsize_t size)
{
TIFF *tif;
/* Test whether we can write tags. */
tif = TIFFOpen(name, "w");
if (!tif)
goto openfailure;
if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) {
fprintf (stderr, "Can't set ImageWidth tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) {
fprintf (stderr, "Can't set ImageLength tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps)) {
fprintf (stderr, "Can't set BitsPerSample tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, spp)) {
fprintf (stderr, "Can't set SamplesPerPixel tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip)) {
fprintf (stderr, "Can't set RowsPerStrip tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, planarconfig)) {
fprintf (stderr, "Can't set PlanarConfiguration tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric)) {
fprintf (stderr, "Can't set PhotometricInterpretation tag.\n");
goto failure;
}
if (write_strips(tif, array, size) < 0) {
fprintf (stderr, "Can't write image data.\n");
goto failure;
}
TIFFClose(tif);
return 0;
failure:
TIFFClose(tif);
openfailure:
fprintf (stderr, "Can't create test TIFF file %s:\n"
" ImageWidth=%ld, ImageLength=%ld, RowsPerStrip=%ld, Compression=%d,\n"
" BitsPerSample=%d, SamplesPerPixel=%d, SampleFormat=%d,\n"
" PlanarConfiguration=%d, PhotometricInterpretation=%d.\n",
name, width, length, rowsperstrip, compression,
bps, spp, sampleformat, planarconfig,
photometric);
return -1;
}
int
read_image_stripped(const char *name, uint32 width, uint32 length,
uint32 rowsperstrip, uint16 compression,
uint16 spp, uint16 bps, uint16 photometric,
uint16 sampleformat, uint16 planarconfig,
const tdata_t array, const tsize_t size)
{
TIFF *tif;
uint16 value_u16;
uint32 value_u32;
/* Test whether we can read written values. */
tif = TIFFOpen(name, "r");
if (!tif)
goto openfailure;
if (TIFFIsTiled(tif)) {
fprintf (stderr, "Can't read image %s, it is tiled.\n",
name);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &value_u32)
|| value_u32 != width) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGEWIDTH);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &value_u32)
|| value_u32 != length) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGELENGTH);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &value_u16)
|| value_u16 != bps) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_BITSPERSAMPLE);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &value_u16)
|| value_u16 != photometric) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_PHOTOMETRIC);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &value_u16)
|| value_u16 != spp) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_SAMPLESPERPIXEL);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &value_u32)
|| value_u32 != rowsperstrip) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_ROWSPERSTRIP);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &value_u16)
|| value_u16 != planarconfig) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_PLANARCONFIG);
goto failure;
}
if (read_strips(tif, array, size) < 0) {
fprintf (stderr, "Can't read image data.\n");
goto failure;
}
TIFFClose(tif);
return 0;
failure:
TIFFClose(tif);
openfailure:
fprintf (stderr, "Can't read test TIFF file %s:\n"
" ImageWidth=%ld, ImageLength=%ld, RowsPerStrip=%ld, Compression=%d,\n"
" BitsPerSample=%d, SamplesPerPixel=%d, SampleFormat=%d,\n"
" PlanarConfiguration=%d, PhotometricInterpretation=%d.\n",
name, width, length, rowsperstrip, compression,
bps, spp, sampleformat, planarconfig,
photometric);
return -1;
}
int
write_scanlines(TIFF *tif, const tdata_t array, const tsize_t size)
{
uint32 length, row;
tsize_t scanlinesize, offset;
if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &length)) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGELENGTH);
@ -79,7 +279,7 @@ write_scanlines(TIFF *tif, tdata_t array, tsize_t size)
scanlinesize = TIFFScanlineSize(tif);
if (!scanlinesize) {
fprintf (stderr, "Wrong size of scanline.\n");
return -1;
return -1;
}
for (offset = 0, row = 0; row < length; offset+=scanlinesize, row++) {
@ -96,108 +296,100 @@ write_scanlines(TIFF *tif, tdata_t array, tsize_t size)
int
main(int argc, char **argv)
{
TIFF *tif;
uint16 value;
uint16 spp = 1;
uint16 bps = 8;
uint16 photometric = PHOTOMETRIC_MINISBLACK;
uint16 rows_per_strip = 1;
uint16 planarconfig = PLANARCONFIG_CONTIG;
uint32 rowsperstrip;
uint16 compression;
uint16 spp, bps, photometric, sampleformat, planarconfig;
/* Test whether we can write tags. */
tif = TIFFOpen(filename, "w");
if (!tif) {
fprintf (stderr, "Can't create test TIFF file %s.\n", filename);
return 1;
}
/*
* Test two special cases: image consisting from single line and image
* consisting from single column.
*/
rowsperstrip = 1;
compression = COMPRESSION_NONE;
spp = 1;
bps = 8;
photometric = PHOTOMETRIC_MINISBLACK;
sampleformat = SAMPLEFORMAT_UINT;
planarconfig = PLANARCONFIG_CONTIG;
if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, XSIZE)) {
fprintf (stderr, "Can't set ImageWidth tag.\n");
if (create_image_stripped(filename, XSIZE * YSIZE, 1, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't create TIFF file %s.\n", filename);
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, YSIZE)) {
fprintf (stderr, "Can't set ImageLength tag.\n");
if (read_image_stripped(filename, XSIZE * YSIZE, 1, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't read TIFF file %s.\n", filename);
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps)) {
fprintf (stderr, "Can't set BitsPerSample tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, spp)) {
fprintf (stderr, "Can't set SamplesPerPixel tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) {
fprintf (stderr, "Can't set SamplesPerPixel tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, planarconfig)) {
fprintf (stderr, "Can't set PlanarConfiguration tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric)) {
fprintf (stderr, "Can't set PhotometricInterpretation tag.\n");
goto failure;
}
if (write_strips(tif, (tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't write image data.\n");
goto failure;
}
TIFFClose(tif);
/* Ok, now test whether we can read written values. */
tif = TIFFOpen(filename, "r");
if (!tif) {
fprintf (stderr, "Can't open test TIFF file %s.\n", filename);
return 1;
}
if (!TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &value)
|| value != XSIZE) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGEWIDTH);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &value)
|| value != YSIZE) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGELENGTH);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &value)
|| value != bps) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_BITSPERSAMPLE);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &value)
|| value != photometric) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_PHOTOMETRIC);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &value)
|| value != spp) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_SAMPLESPERPIXEL);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &value)
|| value != rows_per_strip) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_ROWSPERSTRIP);
goto failure;
}
if (!TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &value)
|| value != planarconfig) {
fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_PLANARCONFIG);
goto failure;
}
TIFFClose(tif);
/* All tests passed; delete file and exit with success status. */
unlink(filename);
if (create_image_stripped(filename, 1, XSIZE * YSIZE, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't create TIFF file %s.\n", filename);
goto failure;
}
if (read_image_stripped(filename, 1, XSIZE * YSIZE, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't read TIFF file %s.\n", filename);
goto failure;
}
unlink(filename);
/*
* Test one-channel image with different parameters.
*/
rowsperstrip = 1;
spp = 1;
bps = 8;
photometric = PHOTOMETRIC_MINISBLACK;
sampleformat = SAMPLEFORMAT_UINT;
planarconfig = PLANARCONFIG_CONTIG;
if (create_image_stripped(filename, XSIZE, YSIZE, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't create TIFF file %s.\n", filename);
goto failure;
}
if (read_image_stripped(filename, XSIZE, YSIZE, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't read TIFF file %s.\n", filename);
goto failure;
}
unlink(filename);
rowsperstrip = YSIZE;
if (create_image_stripped(filename, XSIZE, YSIZE, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't create TIFF file %s.\n", filename);
goto failure;
}
if (read_image_stripped(filename, XSIZE, YSIZE, rowsperstrip,
compression, spp, bps, photometric,
sampleformat, planarconfig,
(const tdata_t) byte_array1, byte_array1_size) < 0) {
fprintf (stderr, "Can't read TIFF file %s.\n", filename);
goto failure;
}
unlink(filename);
return 0;
failure:
/* Something goes wrong; close file and return unsuccessful status. */
TIFFClose(tif);
unlink(filename);
return 1;
}

View File

@ -1,4 +1,4 @@
/* $Id: test_arrays.c,v 1.1 2004-09-14 15:01:16 dron Exp $ */
/* $Id: test_arrays.c,v 1.2 2004-09-15 13:00:02 dron Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@remotesensing.org>
@ -29,7 +29,8 @@
* Numerical arrays used to test libtiff's read/write functions.
*/
#include "tiffio.h"
#include <stddef.h>
#include "test_arrays.h"
const unsigned char byte_array1[XSIZE * YSIZE]=
@ -105,7 +106,7 @@ const unsigned char byte_array1[XSIZE * YSIZE]=
68, 71, 74, 95, 120, 138, 148, 143, 139
};
const tsize_t byte_array1_size = sizeof(byte_array1);
const size_t byte_array1_size = sizeof(byte_array1);
const unsigned char byte_array2[YSIZE * XSIZE] =
{
@ -180,7 +181,74 @@ const unsigned char byte_array2[YSIZE * XSIZE] =
53, 53, 56, 62, 115, 143, 157, 156, 159
};
const tsize_t byte_array2_size = sizeof(byte_array2);
const size_t byte_array2_size = sizeof(byte_array2);
const unsigned char byte_array3[YSIZE * XSIZE] =
{
211, 221, 216, 201, 205, 216, 195, 236, 244, 237, 250, 250, 248, 218,
223, 232, 236, 224, 221, 221, 227, 231, 232, 227, 229, 227, 227, 225,
227, 225, 226, 226, 226, 228, 234, 234, 234, 216, 226, 228, 205, 200,
214, 198, 215, 250, 233, 247, 250, 242, 219, 220, 229, 235, 225, 217,
220, 227, 232, 230, 228, 229, 228, 227, 224, 225, 223, 226, 225, 226,
230, 233, 233, 234, 213, 227, 237, 220, 200, 204, 202, 201, 248, 231,
246, 250, 245, 214, 215, 223, 232, 225, 218, 218, 225, 230, 232, 231,
229, 227, 225, 224, 223, 226, 224, 225, 228, 229, 230, 232, 231, 215,
223, 242, 233, 206, 200, 201, 197, 250, 227, 250, 249, 248, 211, 212,
216, 233, 229, 216, 218, 225, 230, 232, 237, 226, 224, 224, 223, 225,
225, 224, 225, 228, 229, 231, 229, 231, 208, 220, 247, 238, 221, 202,
194, 194, 245, 237, 247, 247, 249, 234, 210, 212, 237, 222, 219, 217,
226, 229, 232, 235, 222, 222, 223, 223, 223, 224, 224, 227, 226, 229,
229, 228, 231, 200, 221, 247, 239, 224, 217, 196, 189, 229, 248, 245,
248, 250, 241, 210, 210, 230, 225, 218, 218, 224, 230, 230, 229, 224,
222, 222, 222, 222, 223, 225, 226, 231, 226, 228, 229, 230, 191, 216,
246, 245, 226, 228, 207, 191, 221, 251, 248, 249, 251, 245, 214, 214,
233, 229, 217, 217, 224, 229, 230, 229, 225, 220, 223, 221, 222, 224,
224, 227, 230, 227, 226, 229, 230, 187, 199, 238, 248, 242, 231, 213,
211, 209, 246, 248, 251, 251, 250, 226, 215, 236, 237, 217, 215, 222,
226, 229, 229, 227, 222, 222, 223, 222, 225, 227, 228, 226, 227, 228,
228, 230, 188, 189, 221, 243, 247, 237, 215, 209, 223, 241, 248, 248,
250, 248, 228, 234, 251, 239, 219, 210, 205, 224, 229, 228, 230, 221,
223, 223, 222, 226, 229, 228, 224, 227, 229, 230, 232, 190, 190, 201,
235, 236, 238, 198, 214, 243, 238, 248, 248, 250, 249, 215, 244, 250,
250, 240, 168, 220, 224, 228, 230, 231, 226, 221, 224, 223, 226, 230,
227, 226, 226, 230, 233, 234, 179, 185, 195, 224, 215, 210, 195, 204,
239, 245, 250, 250, 252, 254, 216, 243, 249, 249, 233, 210, 215, 223,
227, 230, 234, 234, 224, 223, 223, 227, 230, 226, 226, 228, 231, 235,
212, 178, 174, 190, 211, 207, 199, 189, 194, 230, 250, 250, 250, 253,
253, 222, 225, 250, 248, 218, 216, 217, 225, 226, 232, 239, 242, 229,
223, 224, 229, 230, 225, 228, 230, 236, 241, 183, 194, 194, 185, 190,
185, 190, 191, 191, 219, 250, 251, 250, 253, 254, 241, 225, 246, 249,
198, 217, 220, 224, 225, 234, 241, 242, 246, 224, 223, 227, 229, 227,
228, 234, 237, 245, 149, 203, 178, 182, 193, 185, 179, 191, 194, 211,
236, 252, 252, 254, 254, 253, 192, 240, 244, 235, 224, 220, 229, 224,
236, 239, 243, 244, 236, 224, 229, 230, 229, 231, 230, 233, 244, 128,
188, 177, 171, 184, 191, 182, 196, 197, 208, 224, 247, 253, 255, 252,
250, 248, 226, 216, 228, 230, 220, 220, 227, 234, 237, 231, 247, 244,
231, 231, 229, 228, 229, 182, 128, 196, 118, 160, 182, 174, 172, 179,
183, 216, 203, 206, 220, 236, 253, 254, 253, 253, 249, 225, 219, 232,
230, 220, 224, 227, 233, 237, 234, 244, 250, 245, 240, 224, 212, 174,
123, 124, 176, 127, 171, 163, 161, 167, 177, 198, 221, 228, 212, 215,
233, 245, 252, 255, 253, 252, 251, 223, 231, 216, 222, 227, 231, 231,
234, 227, 238, 245, 249, 244, 210, 177, 124, 129, 134, 124, 113, 156,
155, 172, 168, 197, 201, 224, 247, 224, 219, 233, 242, 249, 250, 252,
254, 252, 230, 230, 224, 224, 225, 225, 227, 232, 232, 235, 239, 239,
241, 213, 178, 131, 128, 128, 120, 114, 149, 157, 165, 168, 191, 218,
231, 246, 237, 226, 234, 241, 243, 239, 244, 252, 249, 237, 225, 226,
224, 227, 220, 229, 235, 235, 239, 238, 236, 230, 204, 177, 125, 131,
127, 117, 111, 146, 151, 158, 166, 187, 215, 230, 246, 246, 231, 238,
243, 246, 243, 241, 244, 253, 245, 226, 226, 229, 229, 229, 231, 236,
238, 241, 240, 241, 235, 224, 188, 134, 123, 127, 116, 116, 144, 151,
158, 173, 190, 214, 251, 250, 243, 236, 242, 249, 246, 241, 241, 244,
251, 251, 228, 230, 230, 226, 232, 231, 236, 241, 243, 244, 243, 243,
235, 200, 150, 128, 122, 119, 117, 144, 151, 156, 176, 190, 207, 246,
253, 244, 239, 244, 246, 244, 242, 240, 243, 249, 198, 239, 234, 226,
226, 228, 234, 238, 241, 244, 245, 247, 250, 244, 219, 182, 138, 118,
118, 116, 143, 150, 162, 173, 208, 205, 238, 253, 251, 241, 244, 244,
242, 243, 238, 246, 193, 146, 173, 246, 231, 223, 230, 232, 236, 240,
245, 247, 252, 252, 245, 233, 195, 138, 114, 118, 108
};
const size_t byte_array3_size = sizeof(byte_array3);
const float array_float1[YSIZE * XSIZE] =
{
@ -301,7 +369,7 @@ const float array_float1[YSIZE * XSIZE] =
327.720, 376.878, 404.188, 390.533, 379.609
};
const tsize_t array_float1_size = sizeof(array_float1);
const size_t array_float1_size = sizeof(array_float1);
const float array_float2[YSIZE * XSIZE] =
{
@ -422,7 +490,7 @@ const float array_float2[YSIZE * XSIZE] =
314.065, 390.533, 428.767, 426.036, 434.229
};
const tsize_t array_float2_size = sizeof(array_float2);
const size_t array_float2_size = sizeof(array_float2);
const double array_double1[YSIZE * XSIZE] =
{
@ -589,7 +657,7 @@ const double array_double1[YSIZE * XSIZE] =
240.687813
};
const tsize_t array_double1_size = sizeof(array_double1);
const size_t array_double1_size = sizeof(array_double1);
const double array_double2[YSIZE * XSIZE] =
{
@ -756,6 +824,6 @@ const double array_double2[YSIZE * XSIZE] =
275.319153
};
const tsize_t array_double2_size = sizeof(array_double2);
const size_t array_double2_size = sizeof(array_double2);
/* vim: set ts=8 sts=8 sw=8 noet: */

View File

@ -1,4 +1,4 @@
/* $Id: test_arrays.h,v 1.1 2004-09-14 15:01:16 dron Exp $ */
/* $Id: test_arrays.h,v 1.2 2004-09-15 13:00:02 dron Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@remotesensing.org>
@ -32,28 +32,31 @@
#ifndef _TEST_ARRAYS_
#define _TEST_ARRAYS_
#include "tiffio.h"
#include <stddef.h>
#define XSIZE 37
#define YSIZE 23
extern const unsigned char byte_array1[];
extern const tsize_t byte_array1_size;
extern const size_t byte_array1_size;
extern const unsigned char byte_array2[];
extern const tsize_t byte_array2_size;
extern const size_t byte_array2_size;
extern const unsigned char byte_array3[];
extern const size_t byte_array3_size;
extern const float array_float1[];
extern const tsize_t array_float1_size;
extern const size_t array_float1_size;
extern const float array_float2[];
extern const tsize_t array_float2_size;
extern const size_t array_float2_size;
extern const double array_double1[];
extern const tsize_t array_double1_size;
extern const size_t array_double1_size;
extern const double array_double2[];
extern const tsize_t array_double2_size;
extern const size_t array_double2_size;
#endif /* _TEST_ARRAYS_ */