| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2010.01.07 23:51 "Re: create simple tiff", by Kavallieratou ErginaThank you Bob, for the answer. I repeat more correctly here.
Can anybody please comment on my code?
Gin
struct gen
{
unsigned char ** data;
unsigned short int width;
unsigned short int height;
unsigned short int bits_per_pixel;
};
stuct gen imagen;
TIFF *out= TIFFOpen("ar.tif", "w");
TIFFSetField (out, TIFFTAG_IMAGEWIDTH, imagen->width);
TIFFSetField(out, TIFFTAG_IMAGELENGTH, imagen->height);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
BYTE *bits;
for (int y = 0; y < imagen->height; y++)
{
bits= imagen->data[y];
if (TIFFWriteScanline(out,bits, y, 0)==-1) cout<<"Complete or error";
}
|
|||||||