Lines Matching refs:bit_depth

297     int bit_depth, unsigned int npalette, int interlace_type,  in standard_name()  argument
308 pos = safecatn(buffer, bufsize, pos, bit_depth); in standard_name()
359 #define PALETTE_COUNT(bit_depth) ((bit_depth) > 4 ? 1U : 16U) argument
362 next_format(png_bytep colour_type, png_bytep bit_depth, in next_format() argument
365 if (*bit_depth == 0) in next_format()
369 *bit_depth = 8; in next_format()
371 *bit_depth = 1; in next_format()
379 if (++*palette_number < PALETTE_COUNT(*bit_depth)) in next_format()
385 *bit_depth = (png_byte)(*bit_depth << 1); in next_format()
388 if (*bit_depth <= 8 in next_format()
390 || (*colour_type != 3 && *bit_depth <= 16) in next_format()
400 *bit_depth = 8; in next_format()
405 *bit_depth = 1; in next_format()
410 *bit_depth = 8; in next_format()
415 *bit_depth = 8; in next_format()
425 sample(png_const_bytep row, png_byte colour_type, png_byte bit_depth, in sample() argument
431 x *= bit_depth; in sample()
444 bit_index += sample_index * bit_depth; in sample()
451 if (bit_depth == 8) in sample()
454 else if (bit_depth > 8) in sample()
459 return (result >> (8-bit_index-bit_depth)) & ((1U<<bit_depth)-1); in sample()
1850 png_byte bit_depth; /* From IHDR */ member
2317 ((pm->bit_depth == 16 || pm->assume_16_bit_calculations) ? in modifier_total_encodings()
2371 pm->bit_depth = pm->colour_type = 0; in modifier_reset()
2516 pm->bit_depth = pm->buffer[8+8]; in modifier_read_imp()
2753 pm->bit_depth = 0; in set_modifier_for_read()
2908 if (pm->bit_depth > sbit) in sbit_modify()
3185 bit_size(png_const_structp pp, png_byte colour_type, png_byte bit_depth) in bit_size() argument
3191 case 0: return bit_depth; in bit_size()
3193 case 2: return 3*bit_depth; in bit_size()
3195 case 3: return bit_depth; in bit_size()
3197 case 4: return 2*bit_depth; in bit_size()
3199 case 6: return 4*bit_depth; in bit_size()
3211 png_byte bit_depth) in transform_rowsize() argument
3213 return (TRANSFORM_WIDTH * bit_size(pp, colour_type, bit_depth)) / 8; in transform_rowsize()
3219 #define transform_width(pp, colour_type, bit_depth) TRANSFORM_WIDTH argument
3222 transform_height(png_const_structp pp, png_byte colour_type, png_byte bit_depth) in transform_height() argument
3224 switch (bit_size(pp, colour_type, bit_depth)) in transform_height()
3291 png_byte colour_type, png_byte bit_depth, png_uint_32 y) in transform_row() argument
3296 switch (bit_size(pp, colour_type, bit_depth)) in transform_row()
3440 png_byte PNG_CONST bit_depth, unsigned int palette_number, in make_transform_image() argument
3460 h = transform_height(pp, colour_type, bit_depth); in make_transform_image()
3462 png_set_IHDR(pp, pi, transform_width(pp, colour_type, bit_depth), h, in make_transform_image()
3463 bit_depth, colour_type, interlace_type, in make_transform_image()
3496 init_standard_palette(ps, pp, pi, 1U << bit_depth, 1/*do tRNS*/); in make_transform_image()
3501 transform_rowsize(pp, colour_type, bit_depth)) in make_transform_image()
3524 transform_row(pp, buffer, colour_type, bit_depth, y); in make_transform_image()
3554 store_storefile(ps, FILEID(colour_type, bit_depth, palette_number, in make_transform_image()
3574 png_byte bit_depth = 0; in make_transform_images() local
3583 while (next_format(&colour_type, &bit_depth, &palette_number, 0)) in make_transform_images()
3592 standard_name(name, sizeof name, 0, colour_type, bit_depth, in make_transform_images()
3594 make_transform_image(ps, colour_type, bit_depth, palette_number, in make_transform_images()
3672 png_byte PNG_CONST bit_depth, int PNG_CONST interlace_type, in make_size_image() argument
3692 PNG_CONST png_uint_32 id = FILEID(colour_type, bit_depth, 0/*palette*/, in make_size_image()
3705 png_set_IHDR(pp, pi, w, h, bit_depth, colour_type, interlace_type, in make_size_image()
3733 init_standard_palette(ps, pp, pi, 1U << bit_depth, 0/*do tRNS*/); in make_size_image()
3741 pixel_size = bit_size(pp, colour_type, bit_depth); in make_size_image()
3951 png_byte bit_depth; in sBIT_error_fn() local
3955 bit_depth = 8; in sBIT_error_fn()
3958 bit_depth = png_get_bit_depth(pp, pi); in sBIT_error_fn()
3962 (png_byte)(bit_depth+1); in sBIT_error_fn()
3980 png_byte bit_depth, int interlace_type, int test, png_const_charp name) in make_error() argument
3998 png_set_IHDR(pp, pi, transform_width(pp, colour_type, bit_depth), in make_error()
3999 transform_height(pp, colour_type, bit_depth), bit_depth, colour_type, in make_error()
4003 init_standard_palette(ps, pp, pi, 1U << bit_depth, 0/*do tRNS*/); in make_error()
4044 transform_rowsize(pp, colour_type, bit_depth)) in make_error()
4049 png_uint_32 h = transform_height(pp, colour_type, bit_depth); in make_error()
4064 transform_row(pp, buffer, colour_type, bit_depth, y); in make_error()
4244 png_byte bit_depth; member
4280 dp->bit_depth = DEPTH_FROM_ID(id); in standard_display_init()
4281 if (dp->bit_depth < 1 || dp->bit_depth > 16) in standard_display_init()
4287 dp->bit_depth; in standard_display_init()
4481 if (png_get_bit_depth(pp, pi) != dp->bit_depth) in standard_info_part1()
4521 if (sBIT->red == 0 || sBIT->red > dp->bit_depth) in standard_info_part1()
4526 if (sBIT->green == 0 || sBIT->green > dp->bit_depth) in standard_info_part1()
4531 if (sBIT->blue == 0 || sBIT->blue > dp->bit_depth) in standard_info_part1()
4539 if (sBIT->gray == 0 || sBIT->gray > dp->bit_depth) in standard_info_part1()
4550 if (sBIT->alpha == 0 || sBIT->alpha > dp->bit_depth) in standard_info_part1()
5278 png_byte bit_depth; /* Defines bit size in row */ member
5327 png_byte bit_depth, png_uint_32 x, store_palette palette) in image_pixel_init() argument
5330 PNG_COLOR_TYPE_PALETTE ? 8 : bit_depth); in image_pixel_init()
5338 sample(row, colour_type, bit_depth, x, 0); in image_pixel_init()
5364 this->green = sample(row, colour_type, bit_depth, x, 1); in image_pixel_init()
5365 this->blue = sample(row, colour_type, bit_depth, x, 2); in image_pixel_init()
5369 this->alpha = sample(row, colour_type, bit_depth, x, ++i); in image_pixel_init()
5382 this->bit_depth = bit_depth; in image_pixel_init()
5410 this->bit_depth = 8; in image_pixel_convert_PLTE()
5428 if (this->bit_depth < 8) in image_pixel_add_alpha()
5429 this->bit_depth = 8; in image_pixel_add_alpha()
5532 png_byte bit_depth);
5778 test_pixel.bit_depth = dp->this.bit_depth; in transform_info_imp()
5782 test_pixel.sample_depth = test_pixel.bit_depth; in transform_info_imp()
5804 if (test_pixel.bit_depth != dp->output_bit_depth) in transform_info_imp()
5811 pos = safecatn(message, sizeof message, pos, test_pixel.bit_depth); in transform_info_imp()
5896 PNG_CONST png_byte in_bd = dp->this.bit_depth; in transform_image_validate()
6173 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_default_add() argument
6176 UNUSED(bit_depth) in image_transform_default_add()
6208 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_palette_to_rgb_add() argument
6210 UNUSED(bit_depth) in image_transform_png_set_palette_to_rgb_add()
6251 if (that->bit_depth < 8) in image_transform_png_set_tRNS_to_alpha_mod()
6252 that->bit_depth =8; in image_transform_png_set_tRNS_to_alpha_mod()
6262 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_tRNS_to_alpha_add() argument
6264 UNUSED(bit_depth) in image_transform_png_set_tRNS_to_alpha_add()
6308 if (that->bit_depth < 8) in image_transform_png_set_gray_to_rgb_mod()
6309 that->sample_depth = that->bit_depth = 8; in image_transform_png_set_gray_to_rgb_mod()
6325 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_gray_to_rgb_add() argument
6327 UNUSED(bit_depth) in image_transform_png_set_gray_to_rgb_add()
6358 else if (that->bit_depth < 8) /* grayscale */ in image_transform_png_set_expand_mod()
6359 that->sample_depth = that->bit_depth = 8; in image_transform_png_set_expand_mod()
6369 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_expand_add() argument
6371 UNUSED(bit_depth) in image_transform_png_set_expand_add()
6410 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_expand_gray_1_2_4_to_8_add() argument
6413 bit_depth); in image_transform_png_set_expand_gray_1_2_4_to_8_add()
6445 if (that->bit_depth < 16) in image_transform_png_set_expand_16_mod()
6446 that->sample_depth = that->bit_depth = 16; in image_transform_png_set_expand_16_mod()
6453 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_expand_16_add() argument
6461 return bit_depth < 16; in image_transform_png_set_expand_16_add()
6484 if (that->bit_depth == 16) in image_transform_png_set_scale_16_mod()
6486 that->sample_depth = that->bit_depth = 8; in image_transform_png_set_scale_16_mod()
6498 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_scale_16_add() argument
6505 return bit_depth > 8; in image_transform_png_set_scale_16_add()
6528 if (that->bit_depth == 16) in image_transform_png_set_strip_16_mod()
6530 that->sample_depth = that->bit_depth = 8; in image_transform_png_set_strip_16_mod()
6565 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_strip_16_add() argument
6572 return bit_depth > 8; in image_transform_png_set_strip_16_add()
6608 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_strip_alpha_add() argument
6610 UNUSED(bit_depth) in image_transform_png_set_strip_alpha_add()
6768 if (that->this.bit_depth == 16 || pm->assume_16_bit_calculations) in image_transform_png_set_rgb_to_gray_ini()
6781 (that->this.bit_depth == 16 ? 8. : in image_transform_png_set_rgb_to_gray_ini()
6819 if (that->this.bit_depth != 16 && !pm->assume_16_bit_calculations) in image_transform_png_set_rgb_to_gray_ini()
7229 PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) in image_transform_png_set_rgb_to_gray_add() argument
7231 UNUSED(bit_depth) in image_transform_png_set_rgb_to_gray_add()
7263 png_byte colour_type, bit_depth; in image_transform_png_set_background_set() local
7282 bit_depth = 8; in image_transform_png_set_background_set()
7288 bit_depth = that->this.bit_depth; in image_transform_png_set_background_set()
7293 bit_depth, 0/*x*/, 0/*unused: palette*/); in image_transform_png_set_background_set()
7486 png_byte colour_type, png_byte bit_depth) in image_transform_add() argument
7527 if (list->add(list, this, colour_type, bit_depth) || max == 0) in image_transform_add()
7581 size_t *pos, png_byte colour_type, png_byte bit_depth) in _add() argument
7642 png_byte bit_depth = 0; in perform_transform_test() local
7645 while (next_format(&colour_type, &bit_depth, &palette_number, 0)) in perform_transform_test()
7662 name, sizeof name, &pos, colour_type, bit_depth); in perform_transform_test()
7671 transform_test(pm, FILEID(colour_type, bit_depth, palette_number, in perform_transform_test()
8643 PNG_CONST png_byte in_bd = dp->this.bit_depth; in gamma_image_validate()
8926 d.this.bit_depth, colour_types[d.this.colour_type], name, in gamma_test()
8932 switch (d.this.bit_depth) in gamma_test()
8968 switch (d.this.bit_depth) in gamma_test()
9001 png_byte bit_depth, int interlace_type, double file_gamma, in gamma_threshold_test() argument
9011 (void)gamma_test(pm, colour_type, bit_depth, 0/*palette*/, interlace_type, in gamma_threshold_test()
9022 png_byte bit_depth = 0; in perform_gamma_threshold_tests() local
9029 while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/)) in perform_gamma_threshold_tests()
9038 gamma_threshold_test(pm, colour_type, bit_depth, pm->interlace_type, in perform_gamma_threshold_tests()
9044 gamma_threshold_test(pm, colour_type, bit_depth, pm->interlace_type, in perform_gamma_threshold_tests()
9053 PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth, in gamma_transform_test() argument
9062 if (sbit != bit_depth && sbit != 0) in gamma_transform_test()
9079 gamma_test(pm, colour_type, bit_depth, palette_number, interlace_type, in gamma_transform_test()
9087 png_byte bit_depth = 0; in perform_gamma_transform_tests() local
9090 while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/)) in perform_gamma_transform_tests()
9097 gamma_transform_test(pm, colour_type, bit_depth, palette_number, in perform_gamma_transform_tests()
9117 png_byte colour_type = 0, bit_depth = 0; in perform_gamma_sbit_tests() local
9120 while (next_format(&colour_type, &bit_depth, &npalette, 1/*gamma*/)) in perform_gamma_sbit_tests()
9123 (colour_type != 3 && sbit < bit_depth))) in perform_gamma_sbit_tests()
9133 gamma_transform_test(pm, colour_type, bit_depth, npalette, in perform_gamma_sbit_tests()
9208 PNG_CONST png_byte colour_type, PNG_CONST png_byte bit_depth, in gamma_composition_test() argument
9267 if (expand_16 || bit_depth == 16) in gamma_composition_test()
9345 gamma_test(pm, colour_type, bit_depth, palette_number, interlace_type, in gamma_composition_test()
9356 png_byte bit_depth = 0; in perform_gamma_composition_tests() local
9362 while (next_format(&colour_type, &bit_depth, &palette_number, 1/*gamma*/)) in perform_gamma_composition_tests()
9370 gamma_composition_test(pm, colour_type, bit_depth, palette_number, in perform_gamma_composition_tests()