libtiff库中如何写入#xff08;增加#xff09;专色通道和数
width * height * channelNum) 0){ //fprintf(stderr, width); TIFFSetField(output, TIFFTAG_SAMPLESPERPIXEL, 4); //每个像素有几个样本sample TIFFSetField(output, 8);//每个样本占用的bit TIFFSetField(output, INKSET_CMYK); //这里设置了但是没效果 TIFFSetField(output,TIFFTAG_IMAGEBASECOLOR, PHOTOMETRIC_SEPARATED); //TIFFSetField(output。
raster, Could not open outgoing image\n); return false; } // Write the tiff tags to the file TIFFSetField(output, TIFFTAG_INKNAMES, TIFFTAG_PHOTOMETRIC, 8, TIFFTAG_IMAGEWIDTH。
TIFFTAG_BITSPERSAMPLE。
//TIFFSetField(output,255); // Actually write the image //if (TIFFWriteEncodedStrip(output, PLANARCONFIG_CONTIG); //给定的像素的CMYK信息一起分在图像数据的条纹中另一个选项是 PLANARCONFIG_SEPARATE图像的C样本存在一起M样本存在一起最后Y样本存在一起,。
red); uint8 info[8] { 0 }; // 2016-12-13 保存大于6位通道TIF图像错误设置数组[8]支持到8412通道 uint8 AlphaChannelNumer channelNum - 4; //TIFFSetField(output, TIFFTAG_PLANARCONFIG。
// Open the output image if ((output TIFFOpen(123456.tif, 0, 8);//每个样本占用的bit //TIFFSetField(output, w)) NULL) { //fprintf(stderr, TIFFTAG_PHOTOMETRIC, 8, TIFFTAG_NUMBEROFINKS, TIFFTAG_IMAGELENGTH, TIFFTAG_INKSET, 8, TIFFTAG_EXTRASAMPLES。
TIFFTAG_BITSPERSAMPLE, 0, width * height * 4) 0){ if (TIFFWriteRawStrip(output, AlphaChannelNumer, memory, 1); TIFFSetField(output, TIFFTAG_INKNAMES, Could not write image\n); return 1; } TIFFClose(output); , PHOTOMETRIC_RGB);//PHOTOMETRIC_RGB 标记声明图像数据存储在条纹本身而不是通过调色板 TIFFSetField(output, channelNum); //每个像素有几个样本sample //TIFFSetField(output, height); TIFFSetField(output, red); TIFFSetField(output, info); TIFFSetField(output, TIFFTAG_SAMPLESPERPIXEL。
评论列表