RLE_GETROW(3) UNIX Programmer's Manual RLE_GETROW(3) NAME rle_getrow - Read a scanline of pixels from an RLE file. SYNOPSIS #include rle_getrow( the_hdr, rows ); rle_hdr * the_hdr; rle_pixel ** rows; DESCRIPTION _R_l_e__g_e_t_r_o_w reads information for a single scanline from the input file each time it is called. _T_h_e__h_d_r should point to the structure initialized by _r_l_e__g_e_t__s_e_t_u_p(3). The array _r_o_w_s should contain pointers to arrays of characters, into which the scanline data will be written. There should be as many elements in _r_o_w_s as there are primary colors in the input file (typically 1 or 3), and the scanline arrays must be indexable up to the maximum X coordinate, as specified by _t_h_e__h_d_r->_x_m_a_x. _r_l_e__g_e_t_r_o_w returns the y value of the scan- line just read. This will always be 1 greater than the y value from the scanline previously read, and starts at _t_h_e__h_d_r->_y_m_i_n. Only those channels enabled by _t_h_e__h_d_r->_b_i_t_s will be returned. NOTES If an alpha channel is present in the input and enabled (by _R_L_E__S_E_T__B_I_T, see _r_l_e__h_d_r(3)), then _r_o_w_s should include a -1 entry. (I.e., _r_o_w_s[-_1] should point to a valid scanline array.) The easiest way to ensure this is to use _r_l_e__r_o_w__a_l_l_o_c(3) to allocate _r_o_w_s. _R_l_e__g_e_t_r_o_w will continue to return scanlines even after the end of the input file has been reached, incrementing the return scanline number each time it is called. The calling program should use some other termination criterion (such as the scanline number reaching _t_h_e__h_d_r->_y_m_a_x, or explicitly testing testing for end of file on the input with _f_e_o_f(_i_n_f_i_l_e). The second test may fail if _r_l_e__g_e_t_r_o_w has encountered a logical EOF in the file. The first will always work eventually.) EXAMPLE The code below reads the first two 3 color scanlines of 512 pixels from an RLE file on the standard input. char scanline[2][3][512], *rows[3]; int row, i; rle_dflt_hdr.rle_file = stdin; rle_get_setup( &rle_dflt_hdr ); for ( row = 0; row < 2; row++ ) { Printed 5/12/93 2/2/87 1 RLE_GETROW(3) UNIX Programmer's Manual RLE_GETROW(3) for ( i = 0; i < 3; i++ ) rows[i] = scanline[row][i]; rle_getrow( &rle_dflt_hdr, rows ); } SEE ALSO _r_l_e__h_d_r(3), _r_l_e__r_o_w__a_l_l_o_c(3), _r_l_e__r_o_w__f_r_e_e(3), _r_l_e__g_e_t__s_e_t_u_p(3), _r_l_e__g_e_t_r_a_w(3), _r_l_e__g_e_t_s_k_i_p(3), _r_l_e__p_u_t_r_o_w(3), _l_i_b_r_l_e(3), _R_L_E(5). AUTHOR Spencer W. Thomas, Todd Fuqua University of Utah Printed 5/12/93 2/2/87 2