Lines Matching defs:buf
24 png_save_uint_32(png_bytep buf, png_uint_32 i)
26 buf[0] = (png_byte)((i >> 24) & 0xffU);
27 buf[1] = (png_byte)((i >> 16) & 0xffU);
28 buf[2] = (png_byte)((i >> 8) & 0xffU);
29 buf[3] = (png_byte)( i & 0xffU);
37 png_save_uint_16(png_bytep buf, unsigned int i)
39 buf[0] = (png_byte)((i >> 8) & 0xffU);
40 buf[1] = (png_byte)( i & 0xffU);
76 png_byte buf[8];
79 PNG_CSTRING_FROM_CHUNK(buf, chunk_name);
80 png_debug2(0, "Writing %s chunk, length = %lu", buf, (unsigned long)length);
94 png_save_uint_32(buf, length);
95 png_save_uint_32(buf + 4, chunk_name);
96 png_write_data(png_ptr, buf, 8);
104 png_calculate_crc(png_ptr, buf + 4, 4);
148 png_byte buf[4];
160 png_save_uint_32(buf, png_ptr->crc);
162 png_write_data(png_ptr, buf, 4);
676 png_byte buf[13]; /* Buffer to store the IHDR info */
813 png_save_uint_32(buf, width);
814 png_save_uint_32(buf + 4, height);
815 buf[8] = (png_byte)bit_depth;
816 buf[9] = (png_byte)color_type;
817 buf[10] = (png_byte)compression_type;
818 buf[11] = (png_byte)filter_type;
819 buf[12] = (png_byte)interlace_type;
822 png_write_complete_chunk(png_ptr, png_IHDR, buf, 13);
847 png_byte buf[3];
888 buf[0] = pal_ptr->red;
889 buf[1] = pal_ptr->green;
890 buf[2] = pal_ptr->blue;
891 png_write_chunk_data(png_ptr, buf, 3);
902 buf[0] = pal_ptr[i].red;
903 buf[1] = pal_ptr[i].green;
904 buf[2] = pal_ptr[i].blue;
905 png_write_chunk_data(png_ptr, buf, 3);
1086 png_byte buf[4];
1091 png_save_uint_32(buf, (png_uint_32)file_gamma);
1092 png_write_complete_chunk(png_ptr, png_gAMA, buf, 4);
1101 png_byte buf[1];
1109 buf[0]=(png_byte)srgb_intent;
1110 png_write_complete_chunk(png_ptr, png_sRGB, buf, 1);
1265 png_byte buf[4];
1286 buf[0] = sbit->red;
1287 buf[1] = sbit->green;
1288 buf[2] = sbit->blue;
1300 buf[0] = sbit->gray;
1312 buf[size++] = sbit->alpha;
1315 png_write_complete_chunk(png_ptr, png_sBIT, buf, size);
1324 png_byte buf[32];
1329 png_save_int_32(buf, xy->whitex);
1330 png_save_int_32(buf + 4, xy->whitey);
1332 png_save_int_32(buf + 8, xy->redx);
1333 png_save_int_32(buf + 12, xy->redy);
1335 png_save_int_32(buf + 16, xy->greenx);
1336 png_save_int_32(buf + 20, xy->greeny);
1338 png_save_int_32(buf + 24, xy->bluex);
1339 png_save_int_32(buf + 28, xy->bluey);
1341 png_write_complete_chunk(png_ptr, png_cHRM, buf, 32);
1351 png_byte buf[6];
1380 png_save_uint_16(buf, tran->gray);
1381 png_write_complete_chunk(png_ptr, png_tRNS, buf, 2);
1387 png_save_uint_16(buf, tran->red);
1388 png_save_uint_16(buf + 2, tran->green);
1389 png_save_uint_16(buf + 4, tran->blue);
1391 if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]) != 0)
1393 if ((buf[0] | buf[2] | buf[4]) != 0)
1401 png_write_complete_chunk(png_ptr, png_tRNS, buf, 6);
1416 png_byte buf[6];
1433 buf[0] = back->index;
1434 png_write_complete_chunk(png_ptr, png_bKGD, buf, 1);
1439 png_save_uint_16(buf, back->red);
1440 png_save_uint_16(buf + 2, back->green);
1441 png_save_uint_16(buf + 4, back->blue);
1443 if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]) != 0)
1445 if ((buf[0] | buf[2] | buf[4]) != 0)
1455 png_write_complete_chunk(png_ptr, png_bKGD, buf, 6);
1468 png_save_uint_16(buf, back->gray);
1469 png_write_complete_chunk(png_ptr, png_bKGD, buf, 2);
1480 png_byte buf[1];
1488 buf[0] = exif[i];
1489 png_write_chunk_data(png_ptr, buf, 1);
1502 png_byte buf[3];
1519 png_save_uint_16(buf, hist[i]);
1520 png_write_chunk_data(png_ptr, buf, 2);
1727 png_byte buf[9];
1734 png_save_int_32(buf, x_offset);
1735 png_save_int_32(buf + 4, y_offset);
1736 buf[8] = (png_byte)unit_type;
1738 png_write_complete_chunk(png_ptr, png_oFFs, buf, 9);
1751 png_byte buf[10];
1789 png_save_int_32(buf, X0);
1790 png_save_int_32(buf + 4, X1);
1791 buf[8] = (png_byte)type;
1792 buf[9] = (png_byte)nparams;
1793 png_write_chunk_data(png_ptr, buf, 10);
1812 png_byte buf[64];
1827 buf[0] = (png_byte)unit;
1828 memcpy(buf + 1, width, wlen + 1); /* Append the '\0' here */
1829 memcpy(buf + wlen + 2, height, hlen); /* Do NOT append the '\0' here */
1832 png_write_complete_chunk(png_ptr, png_sCAL, buf, total_len);
1843 png_byte buf[9];
1850 png_save_uint_32(buf, x_pixels_per_unit);
1851 png_save_uint_32(buf + 4, y_pixels_per_unit);
1852 buf[8] = (png_byte)unit_type;
1854 png_write_complete_chunk(png_ptr, png_pHYs, buf, 9);
1865 png_byte buf[7];
1877 png_save_uint_16(buf, mod_time->year);
1878 buf[2] = mod_time->month;
1879 buf[3] = mod_time->day;
1880 buf[4] = mod_time->hour;
1881 buf[5] = mod_time->minute;
1882 buf[6] = mod_time->second;
1884 png_write_complete_chunk(png_ptr, png_tIME, buf, 7);