TIFFWRITESCANLINE(3tiff) LibTIFF TIFFWRITESCANLINE(3tiff) NNAAMMEE TIFFWriteScanline - write a scanline to an open TIFF file SSYYNNOOPPSSIISS #include iinntt TTIIFFFFWWrriitteeSSccaannlliinnee((TTIIFFFF **ttiiff,, ttddaattaa__tt bbuuff,, uuiinntt3322__tt rrooww,, ttssaammppllee__tt ssaammppllee)) DDEESSCCRRIIPPTTIIOONN Write data to a file at the specified row. The _s_a_m_p_l_e parameter is used only if data are organized in separate planes (PPllaannaarrCCoonnffiigguurraattiioonn = 2). The data are assumed to be uncompressed and in the native bit- and byte-order of the host machine. The data written to the file is com- pressed according to the compression scheme of the current TIFF direc- tory (see further below). If the current scanline is past the end of the current subfile, the IImmaaggeeLLeennggtthh field is automatically increased to include the scanline (except for PPllaannaarrCCoonnffiigguurraattiioonn = 2, where the IImmaaggeeLLeennggtthh cannot be changed once the first data are written). If the IImmaaggeeLLeennggtthh is increased, the SSttrriippOOffffsseettss and SSttrriippBByytteeCCoouunnttss fields are similarly enlarged to reflect data written past the previous end of image. NNOOTTEESS The library writes encoded data using the native machine byte order. Correctly implemented TIFF readers are expected to do any necessary byte-swapping to correctly process image data with BBiittssPPeerrSSaammppllee greater than 8. The library attempts to hide bit-ordering differences between the image and the native machine by converting data from the native machine order. In C++ the _s_a_m_p_l_e parameter defaults to 0. Once data are written to a file for the current directory, the values of certain tags may not be altered; see _T_I_F_F_S_e_t_F_i_e_l_d_(_) for more infor- mation. It is not possible to write scanlines to a file that uses a tiled orga- nization. The routine _T_I_F_F_I_s_T_i_l_e_d_(_) can be used to determine if the file is organized as tiles or strips. RREETTUURRNN VVAALLUUEESS _T_I_F_F_W_r_i_t_e_S_c_a_n_l_i_n_e_(_) returns -1 if it immediately detects an error and 1 for a successful write. DDIIAAGGNNOOSSTTIICCSS All error messages are directed to the _T_I_F_F_E_r_r_o_r_E_x_t_R_(_) routine. %%ss:: FFiillee nnoott ooppeenn ffoorr wwrriittiinngg: The file was opened for reading, not writing. ""CCaann nnoott wwrriittee ssccaannlliinneess ttoo aa ttiilleedd iimmaaggee"": An attempt was made to write a scanline to a tiled image. The image is assumed to be organized in tiles because the TTiilleeWWiiddtthh and TTiillee-- LLeennggtthh tags have been set with _T_I_F_F_S_e_t_F_i_e_l_d_(_). ""CCoommpprreessssiioonn aallggoorriitthhmm ddooeess nnoott ssuuppppoorrtt rraannddoomm aacccceessss"": Data was written in a non-sequential order to a file that uses a compression algorithm and that has RRoowwssPPeerrSSttrriipp greater than one. That is, data in the image is to be stored in a compressed form, and with multiple rows packed into a strip. In this case, the library does not support random access to the data. The data should either be written as entire strips, sequentially by rows, or the value of RRoowwssPPeerrSSttrriipp should be set to one. %%ss:: MMuusstt sseett ""IImmaaggeeWWiiddtthh"" bbeeffoorree wwrriittiinngg ddaattaa: The images width has not be set before the first write. See _T_I_F_F_S_e_t_F_i_e_l_d_(_) for information on how to do this. %%ss:: MMuusstt sseett ""PPllaannaarrCCoonnffiigguurraattiioonn"" bbeeffoorree wwrriittiinngg ddaattaa: The organization of data has not be defined before the first write. See _T_I_F_F_S_e_t_F_i_e_l_d_(_) for information on how to do this. CCaann nnoott cchhaannggee ""IImmaaggeeLLeennggtthh"" wwhheenn uussiinngg sseeppaarraattee ppllaanneess: Separate image planes are being used (PPllaannaarrCCoonnffiigguurraattiioonn = 2), but the number of rows has not been specified before the first write. The library supports the dynamic growth of an image only when data are organized in a contiguous manner (PPllaannaarrCCoonnffiigguurraattiioonn = 1). ""%%dd:: SSaammppllee oouutt ooff rraannggee,, mmaaxx %%dd"": The _s_a_m_p_l_e parameter was greater than the value of the SSaammpplleessPPeerr-- PPiixxeell tag. %%ss:: NNoo ssppaaccee ffoorr ssttrriipp aarrrraayyss: There was not enough space for the arrays that hold strip offsets and byte counts. BBUUGGSS Writing subsampled YCbCR data does not work correctly because, for PPllaa-- nnaarrCCoonnffiigguurraattiioonn = 2 the size of a scanline is not calculated on a per-sample basis, and for PPllaannaarrCCoonnffiigguurraattiioonn = 1 the library does not pack the block-interleaved samples. SSEEEE AALLSSOO _T_I_F_F_O_p_e_n (3tiff), _T_I_F_F_W_r_i_t_e_E_n_c_o_d_e_d_S_t_r_i_p (3tiff), _T_I_F_F_W_r_i_t_e_R_a_w_S_t_r_i_p (3tiff), _l_i_b_t_i_f_f (3tiff) AAUUTTHHOORR LibTIFF contributors CCOOPPYYRRIIGGHHTT 1988-2022, LibTIFF contributors 4.6 Sep 08, 2023 TIFFWRITESCANLINE(3tiff)