/////////////////////////////////////////////////////////////////////////////// // Ein Item wurde Expandiert/Collapst void CUndoRedoDetails::OnItemExpanded (NotifyEvt e) { NM_TREEVIEW *pnmtv = (NM_TREEVIEW *)e.GetNotifyInfo(); HTREEITEM hItem = pnmtv -> itemNew.hItem; AdjustImage (hItem); }
int WriteTIFF(unsigned short * buffer, int cols, int rows, char * filename) { #ifdef HAVE_TIFFIO_H TIFF *image; unsigned char out[cols*rows]; AdjustImage(buffer, cols, rows, out); // Open the TIFF file if((image = TIFFOpen(filename, "w")) == NULL) { printf("Could not open %s for writing\n", filename); exit(1); } // We need to set some values for basic tags before we can add any data TIFFSetField(image, TIFFTAG_IMAGEWIDTH, cols); TIFFSetField(image, TIFFTAG_IMAGELENGTH, rows); TIFFSetField(image, TIFFTAG_BITSPERSAMPLE, 8); TIFFSetField(image, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, 1); TIFFSetField(image, TIFFTAG_COMPRESSION, COMPRESSION_NONE); TIFFSetField(image, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(image, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); TIFFSetField(image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(image, TIFFTAG_XRESOLUTION, 150.0); TIFFSetField(image, TIFFTAG_YRESOLUTION, 150.0); TIFFSetField(image, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); // Write the information to the file for (int y = 0; y < rows; y++) { TIFFWriteScanline(image, &out[cols*y], y); } // Close the file TIFFClose(image); #else /* HAVE_TIFFIO_H */ std::cerr << "TIFF not supported" << std::endl; return -1; #endif /* HAVE_TIFFIO_H */ }