Lines Matching defs:image
23 #include "image.h"
191 auto image = TIFFOpen(filename.c_str(), "w");
192 if (!image) {
193 dbg.log(DBG_error, "Could not save debug image");
196 TIFFSetField(image, TIFFTAG_IMAGEWIDTH, pixels_per_line);
197 TIFFSetField(image, TIFFTAG_IMAGELENGTH, lines);
198 TIFFSetField(image, TIFFTAG_BITSPERSAMPLE, depth);
199 TIFFSetField(image, TIFFTAG_SAMPLESPERPIXEL, channels);
201 TIFFSetField(image, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
203 TIFFSetField(image, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
205 TIFFSetField(image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
206 TIFFSetField(image, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
214 TIFFWriteScanline(image, const_cast<std::uint8_t*>(line_data), iline, 0);
216 TIFFClose(image);
239 void write_tiff_file(const std::string& filename, const Image& image)
241 if (!is_supported_write_tiff_file_image_format(image.get_format())) {
242 throw SaneException("Unsupported format %d", static_cast<unsigned>(image.get_format()));
245 write_tiff_file(filename, image.get_row_ptr(0), get_pixel_format_depth(image.get_format()),
246 get_pixel_channels(image.get_format()), image.get_width(), image.get_height());