From 44be564ca46d5a9b2a00c936f30e49c0456f8583 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 3 Jul 2008 14:10:56 -0500 Subject: [svn-r15316] added one more palette to the test generator file tested: windows, linux --- MANIFEST | 6 +- hl/tools/h52jpeg/h52jpegtst.c | 72 ++++---- hl/tools/h52jpeg/h52jpegtst.h | 286 +++++++++++++++++++++++++++++++ hl/tools/h52jpeg/testfiles/h52jpegtst.h5 | Bin 227613 -> 227613 bytes 4 files changed, 331 insertions(+), 33 deletions(-) create mode 100644 hl/tools/h52jpeg/h52jpegtst.h diff --git a/MANIFEST b/MANIFEST index dbba608..646fc04 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1518,15 +1518,15 @@ ./tools/testfiles/h5mkgrp_version.ls #h52jpeg -./hl/tools/h52jpeg/testfiles/h52jpegtst.h5 +./hl/tools/h52jpeg/h52jpegtst.h ./hl/tools/h52jpeg/h52jpegtst.c -./hl/tools/h52jpeg/Makefile.in ./hl/tools/h52jpeg/h52jpeg.c ./hl/tools/h52jpeg/image24pixel.txt ./hl/tools/h52jpeg/image8.txt ./hl/tools/h52jpeg/Makefile.am +./hl/tools/h52jpeg/Makefile.in ./hl/tools/h52jpeg/h52jpeg.sh - +./hl/tools/h52jpeg/testfiles/h52jpegtst.h5 # high level libraries ./hl/COPYING diff --git a/hl/tools/h52jpeg/h52jpegtst.c b/hl/tools/h52jpeg/h52jpegtst.c index d22be87..c22f232 100644 --- a/hl/tools/h52jpeg/h52jpegtst.c +++ b/hl/tools/h52jpeg/h52jpegtst.c @@ -16,26 +16,21 @@ #include "hdf5.h" #include "hdf5_hl.h" #include "H5private.h" +#include "hdf5_hl.h" +#include "h52jpegtst.h" #include #include -#define DATA_FILE1 "image8.txt" -#define DATA_FILE2 "image24pixel.txt" -#define IMAGE1_NAME "image8bit" -#define IMAGE2_NAME "image24bitpixel" -#define PAL_NAME "palette" -#define PAL_ENTRIES 256 - static int make_images( hid_t fid ); -static int read_data(const char* file_name, hsize_t *width, hsize_t *height ); -unsigned char *gbuf = 0; /* global buffer for image data */ +static int read_data(const char* fname, hsize_t *width, hsize_t *height ); +unsigned char *gbuf = NULL; /* global buffer for image data */ /*------------------------------------------------------------------------- * Function: main * - * Purpose: h52jpegtst main program. Generate images and datasets to be used + * Purpose: h52jpegtst main program. Generate images to be used * by h52jpeg tests * * Programmer: Pedro Vicente, pvn@hdfgroup.org @@ -79,50 +74,67 @@ static int make_images( hid_t fid ) { hsize_t width; /* width of image */ hsize_t height; /* height of image */ - unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */ hsize_t pal_dims[2] = {PAL_ENTRIES,3}; /* palette dimensions */ + unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */ int i, n; + /*------------------------------------------------------------------------- + * indexed image + *------------------------------------------------------------------------- + */ + /* read first data file */ - if ( read_data( DATA_FILE1, &width, &height ) < 0 ) + if ( read_data( "image8.txt", &width, &height ) < 0 ) goto out; /* make the image */ - if ( H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, gbuf ) < 0 ) + if ( H5IMmake_image_8bit( fid, "img8", width, height, gbuf ) < 0 ) goto out; - /*------------------------------------------------------------------------- - * define a palette, blue to red tones - *------------------------------------------------------------------------- - */ - for ( i=0, n=0; i