Lines Matching refs:bit_depth

132 pixel_depth_of_type(int color_type, int bit_depth)  in pixel_depth_of_type()  argument
134 return channels_of_type(color_type) * bit_depth; in pixel_depth_of_type()
138 image_size_of_type(int color_type, int bit_depth, unsigned int *colors) in image_size_of_type() argument
145 int pixel_depth = pixel_depth_of_type(color_type, bit_depth); in image_size_of_type()
170 generate_palette(png_colorp palette, png_bytep trans, int bit_depth, in generate_palette() argument
210 if (bit_depth == 1) in generate_palette()
219 unsigned int size = 1U << (bit_depth/2); /* 2, 4 or 16 */ in generate_palette()
249 set_value(png_bytep row, size_t rowbytes, png_uint_32 x, unsigned int bit_depth, in set_value() argument
252 unsigned int mask = (1U << bit_depth)-1; in set_value()
254 x *= bit_depth; /* Maximum x is 4*1024, maximum bit_depth is 16 */ in set_value()
260 if (offset < rowbytes && (bit_depth < 16 || offset+1 < rowbytes)) in set_value()
264 switch (bit_depth) in set_value()
271 unsigned int shift = (8 - bit_depth) - (x & 0x7U); in set_value()
311 int bit_depth, png_const_bytep gamma_table, double conv, in generate_row() argument
314 png_uint_32 size_max = image_size_of_type(color_type, bit_depth, colors)-1; in generate_row()
315 png_uint_32 depth_max = (1U << bit_depth)-1; /* up to 65536 */ in generate_row()
335 set_value(row, rowbytes, x, bit_depth, luma, gamma_table, conv); in generate_row()
350 set_value(row, rowbytes, 2*x, bit_depth, in generate_row()
353 set_value(row, rowbytes, 2*x+1, bit_depth, alpha, gamma_table, in generate_row()
381 set_value(row, rowbytes, 3*x+0, bit_depth, /* red */ Y, in generate_row()
383 set_value(row, rowbytes, 3*x+1, bit_depth, /* green */ in generate_row()
386 set_value(row, rowbytes, 3*x+2, bit_depth, /* blue */ in generate_row()
417 set_value(row, rowbytes, 4*x+0, bit_depth, /* red */ in generate_row()
420 set_value(row, rowbytes, 4*x+1, bit_depth, /* green */ in generate_row()
423 set_value(row, rowbytes, 4*x+2, bit_depth, /* blue */ in generate_row()
426 set_value(row, rowbytes, 4*x+3, bit_depth, /* alpha */ in generate_row()
455 set_value(row, rowbytes, x, bit_depth, luma, gamma_table, in generate_row()
468 set_value(row, rowbytes, 2*x, bit_depth, luma, gamma_table, in generate_row()
470 set_value(row, rowbytes, 2*x+1, bit_depth, alpha, gamma_table, in generate_row()
485 set_value(row, rowbytes, 3*x+0, bit_depth, red, gamma_table, in generate_row()
487 set_value(row, rowbytes, 3*x+1, bit_depth, green, gamma_table, in generate_row()
489 set_value(row, rowbytes, 3*x+2, bit_depth, blue, gamma_table, in generate_row()
505 set_value(row, rowbytes, 4*x+0, bit_depth, red, gamma_table, in generate_row()
507 set_value(row, rowbytes, 4*x+1, bit_depth, green, gamma_table, in generate_row()
509 set_value(row, rowbytes, 4*x+2, bit_depth, blue, gamma_table, in generate_row()
511 set_value(row, rowbytes, 4*x+3, bit_depth, alpha, gamma_table, in generate_row()
555 write_png(const char **name, FILE *fp, int color_type, int bit_depth, in write_png() argument
591 unsigned int size = image_size_of_type(color_type, bit_depth, colors); in write_png()
634 png_set_IHDR(png_ptr, info_ptr, size, size, bit_depth, color_type, in write_png()
643 npalette = generate_palette(palette, trans, bit_depth, gamma_table, in write_png()
700 generate_row(row, rowbytes, y, color_type, bit_depth, in write_png()
1282 int bit_depth = 32; /* invalid */ in main() local
1403 if (bit_depth == 32 && isdigit(arg[0])) in main()
1405 bit_depth = atoi(arg); in main()
1406 if (bit_depth <= 0 || bit_depth > 16 || in main()
1407 (bit_depth & -bit_depth) != bit_depth) in main()
1433 if (color_type == 8 || bit_depth == 32) in main()
1444 (1U<<bit_depth)-1); in main()
1461 if ((color_type & PNG_COLOR_MASK_PALETTE) != 0 || bit_depth < 8) in main()
1466 if (bit_depth == 8) in main()
1478 int ret = write_png(&file_name, fp, color_type, bit_depth, gamma, in main()