Warnings removed.
This commit is contained in:
parent
5bf48e861c
commit
3d90486ac8
@ -1,4 +1,4 @@
|
|||||||
/* $Id: raw2tiff.c,v 1.11 2004-06-08 09:56:35 dron Exp $
|
/* $Id: raw2tiff.c,v 1.12 2004-06-29 19:19:17 dron Exp $
|
||||||
*
|
*
|
||||||
* Project: libtiff tools
|
* Project: libtiff tools
|
||||||
* Purpose: Convert raw byte sequences in TIFF images
|
* Purpose: Convert raw byte sequences in TIFF images
|
||||||
@ -31,6 +31,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ main(int argc, char* argv[])
|
|||||||
int depth = 1; /* bytes per pixel in input image */
|
int depth = 1; /* bytes per pixel in input image */
|
||||||
int swab = 0; /* byte swapping flag */
|
int swab = 0; /* byte swapping flag */
|
||||||
InterleavingType interleaving = 0; /* interleaving type flag */
|
InterleavingType interleaving = 0; /* interleaving type flag */
|
||||||
uint32 rowsperstrip = (uint32) -1;
|
uint32 rowsperstrip = (uint32) -1;
|
||||||
uint16 photometric = PHOTOMETRIC_MINISBLACK;
|
uint16 photometric = PHOTOMETRIC_MINISBLACK;
|
||||||
uint16 config = PLANARCONFIG_CONTIG;
|
uint16 config = PLANARCONFIG_CONTIG;
|
||||||
uint16 fillorder = FILLORDER_LSB2MSB;
|
uint16 fillorder = FILLORDER_LSB2MSB;
|
||||||
@ -244,7 +245,7 @@ main(int argc, char* argv[])
|
|||||||
bufsize = width * nbands * depth;
|
bufsize = width * nbands * depth;
|
||||||
buf1 = (unsigned char *)_TIFFmalloc(bufsize);
|
buf1 = (unsigned char *)_TIFFmalloc(bufsize);
|
||||||
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
|
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
|
||||||
TIFFDefaultStripSize(out, rowsperstrip));
|
TIFFDefaultStripSize(out, rowsperstrip));
|
||||||
fseek(in, hdr_size, SEEK_SET); /* Skip the file header */
|
fseek(in, hdr_size, SEEK_SET); /* Skip the file header */
|
||||||
for (row = 0; row < length; row++) {
|
for (row = 0; row < length; row++) {
|
||||||
switch(interleaving) {
|
switch(interleaving) {
|
||||||
@ -344,7 +345,7 @@ guessSize(FILE *fp, TIFFDataType dtype, off_t hdr_size, uint32 nbands,
|
|||||||
|
|
||||||
*length = imagesize / *width;
|
*length = imagesize / *width;
|
||||||
|
|
||||||
fprintf(stderr, "Height is guessed as %ld.\n", *length);
|
fprintf(stderr, "Height is guessed as %u.\n", *length);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else if (*width == 0 && *length != 0) {
|
} else if (*width == 0 && *length != 0) {
|
||||||
@ -352,7 +353,7 @@ guessSize(FILE *fp, TIFFDataType dtype, off_t hdr_size, uint32 nbands,
|
|||||||
|
|
||||||
*width = imagesize / *length;
|
*width = imagesize / *length;
|
||||||
|
|
||||||
fprintf(stderr, "Width is guessed as %ld.\n", *width);
|
fprintf(stderr, "Width is guessed as %u.\n", *width);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else if (*width == 0 && *length == 0) {
|
} else if (*width == 0 && *length == 0) {
|
||||||
@ -387,7 +388,7 @@ guessSize(FILE *fp, TIFFDataType dtype, off_t hdr_size, uint32 nbands,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Width is guessed as %ld, height is guessed as %ld.\n",
|
"Width is guessed as %u, height is guessed as %u.\n",
|
||||||
*width, *length);
|
*width, *length);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -412,8 +413,8 @@ correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype)
|
|||||||
case TIFF_BYTE:
|
case TIFF_BYTE:
|
||||||
default:
|
default:
|
||||||
for (i = 0; i < n_elem; i++) {
|
for (i = 0; i < n_elem; i++) {
|
||||||
X = ((u_char *)buf1)[i];
|
X = ((unsigned char *)buf1)[i];
|
||||||
Y = ((u_char *)buf2)[i];
|
Y = ((unsigned char *)buf2)[i];
|
||||||
M1 += X, M2 += Y;
|
M1 += X, M2 += Y;
|
||||||
D1 += X * X, D2 += Y * Y;
|
D1 += X * X, D2 += Y * Y;
|
||||||
K += X * Y;
|
K += X * Y;
|
||||||
@ -522,8 +523,8 @@ processCompressOptions(char* opt)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* stuff[] = {
|
static char* stuff[] = {
|
||||||
"raw2tiff --- tool to converting raw byte sequences in TIFF images",
|
"raw2tiff --- tool for converting raw byte sequences in TIFF images",
|
||||||
"usage: raw2tiff [options] input.raw output.tif",
|
"usage: raw2tiff [options] input.raw output.tif",
|
||||||
"where options are:",
|
"where options are:",
|
||||||
" -L input data has LSB2MSB bit order (default)",
|
" -L input data has LSB2MSB bit order (default)",
|
||||||
|
Loading…
Reference in New Issue
Block a user