Lines Matching refs:row
10 * This code illustrates basic 'by-row' reading of a PNG file using libpng.
32 /* Return component 'c' of pixel 'x' from the given row. */
34 component(png_const_bytep row, png_uint_32 x, unsigned int c,
39 * bytes wide. Since the row fitted into memory, however, the following must
45 row = (png_const_bytep)(((PNG_CONST png_byte (*)[8])row) + bit_offset_hi);
46 row += bit_offset_lo >> 3;
55 case 1: return (row[0] >> (7-bit_offset_lo)) & 0x01;
56 case 2: return (row[0] >> (6-bit_offset_lo)) & 0x03;
57 case 4: return (row[0] >> (4-bit_offset_lo)) & 0x0f;
58 case 8: return row[0];
59 case 16: return (row[0] << 8) + row[1];
69 /* Print a pixel from a row returned by libpng; determine the row format, find
73 print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
81 printf("GRAY %u\n", component(row, x, 0, bit_depth, 1));
90 PNG_CONST int index = component(row, x, 0, bit_depth, 1);
119 printf("RGB %u %u %u\n", component(row, x, 0, bit_depth, 3),
120 component(row, x, 1, bit_depth, 3),
121 component(row, x, 2, bit_depth, 3));
125 printf("GRAY+ALPHA %u %u\n", component(row, x, 0, bit_depth, 2),
126 component(row, x, 1, bit_depth, 2));
130 printf("RGBA %u %u %u %u\n", component(row, x, 0, bit_depth, 4),
131 component(row, x, 1, bit_depth, 4),
132 component(row, x, 2, bit_depth, 4),
133 component(row, x, 3, bit_depth, 4));
156 volatile png_bytep row = NULL;
201 * each row in bytes, allocate the appropriate amount of
205 row = png_malloc(png_ptr, png_get_rowbytes(png_ptr,
209 * to a local here - just use row for the png_free below.
211 row_tmp = row;
242 /* Now read the pixels, pass-by-pass, row-by-row: */
254 * expects to be called for each row that is
279 * reading a row and then checking to see if it
298 /* Now find the pixel if it is in this row; there
305 /* 'ppx' is the index of the pixel in the row
320 row = NULL;
335 if (row != NULL)
339 * way of using it is still to clear 'row' before calling
342 png_bytep row_tmp = row;
343 row = NULL;