Lines Matching refs:DEPTH
365 #define FILEID(col, depth, palette, interlace, width, height, do_interlace) \
366 ((png_uint_32)((col) + ((depth)<<3) + ((palette)<<8) + ((interlace)<<13) + \
444 * each log bit depth of a colour type 3 standard image.
475 /* No: next bit depth */
481 /* Palette images are restricted to 8 bit depth */
2456 /* If set assume that the calculation bit depth is set by the input
2462 * depth is 8 bits.
2476 /* Whether or not to run the low-bit-depth grayscale tests. This fails on
2478 * gamma handling for low bit depth.
2576 * with the precision of the input, not the precision of the output depth.
2585 static double digitize(double value, int depth, int do_round)
2589 * sample depth and the 'assume' setting. Digitization is normally by
2593 const unsigned int digitization_factor = (1U << depth) -1;
2614 /* Absolute error permitted in linear values - affected by the bit depth of
2653 * depth is 16 the output error is determined by the 8 bit calculation.
2655 * This limit is not determined by the bit depth of internal calculations.
2695 * and so must be adjusted for low bit depth grayscale:
3509 * and with an ID derived from the colour type, bit depth and interlace type
3525 * the same bit depth to allow testing of more colour combinations -
3618 * bit depth cases select colors at random, else it is difficult to have
3619 * a set of low bit depth palette test with any chance of a reasonable
3974 #define DEPTH(bd) ((png_byte)(1U << (bd)))
4076 /* Make a standardized image given an image colour type, bit depth and
4279 * generating multiple low bit depth palette images. Non-A images (palette
4538 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_NONE,
4540 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_NONE,
4543 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7,
4550 make_size_image(ps, colour_type, DEPTH(bdlo), PNG_INTERLACE_ADAM7,
4564 /* Arguments are colour_type, low bit depth, high bit depth
4617 /* Now we know the bit depth we can easily generate an invalid sBIT entry */
4796 make_error(&pm->this, colour_type, DEPTH(bdlo), interlace_type,
4980 internal_error(ps, "internal: bad bit depth");
5181 png_error(pp, "validate: bit depth changed");
5825 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5867 * a total of 3.5 seconds if done across every combo of bit depth
5886 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5893 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5904 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5913 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5939 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5950 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
5961 standard_test(&pm->this, FILEID(colour_type, DEPTH(bdlo), 0/*palette*/,
6203 /* The bit depth of the row changes at this point too (notice that this is
6204 * the row format, not the sample depth, which is separate.)
6211 * not valid in an alpha image. The bit depth will invariably be set to at
6235 /* After 1.7 the expansion of bit depth only happens if there is a
6282 * original sBIT data (actually it will always be the original bit depth).
6339 * meaningful for this colour type and bit depth - if false then the
6579 /* Validate the combination of colour type and bit depth that we are getting
6603 "invalid final bit depth: colour type(");
6605 pos = safecat(message, sizeof message, pos, ") with bit depth: ");
6650 size_t pos = safecat(message, sizeof message, 0, "bit depth ");
6659 /* If both bit depth and colour type are correct check the sample depth.
6663 png_error(pp, "pngvalid: internal: palette sample depth not 8");
6665 png_error(pp, "pngvalid: internal: bad unpacked pixel depth");
6671 "internal: sample depth ");
6674 * mapped we expect the transform to keep sample depth and bit depth
6686 * expect for the output bit depth.
6690 "internal: bit depth ");
6716 * digitization depth of the libpng output colors (the bit depth except for
6871 /* We don't expect changes to the index here even if the bit depth is
7199 /* Simply expand the bit depth and alter the colour type as required. */
7202 /* RGB images have a bit depth at least equal to '8' */
7276 * depth is at least 8 already.
7308 /* Only expand grayscale of bit depth less than 8: */
7330 /* This should do nothing unless the color type is gray and the bit depth is
7388 /* expand_16 does something unless the bit depth is already 16. */
8728 /* Use 1 byte per pixel in 1, 2, or 4-bit depth files.
8750 * low bit-depth pixel values are unpacked into bytes without
8768 /* Nothing should happen unless the bit depth is less than 8: */
8882 * to test the transform, so they are limited to the bit depth
8887 const unsigned int depth = that->this.bit_depth;
8889 data.red = (png_byte)/*SAFE*/(random_mod(depth)+1);
8890 data.green = (png_byte)/*SAFE*/(random_mod(depth)+1);
8891 data.blue = (png_byte)/*SAFE*/(random_mod(depth)+1);
8892 data.gray = (png_byte)/*SAFE*/(random_mod(depth)+1);
8893 data.alpha = (png_byte)/*SAFE*/(random_mod(depth)+1);
9271 * because the output bit depth is read from the library. Note that there
9749 * encoded_sample: encoded result; input_sample scaled to ouput bit depth
9863 * an sbit less than the bit depth.
10173 * file encoding, determined by sbit and/or the file depth, secondly
10190 * (sample depth scaling) of the PNG spec. That section forces the
10226 * otherwise the bit depth.
10515 png_error(pp, "bad bit depth (internal: 1)");
10538 png_error(pp, "bad bit depth (internal: 2)");
10580 * decision based on colour type or bit depth!
10670 * for overall speed. Only bit depths where sbit is less than the bit depth
11059 summarize_gamma_errors(pm, 0/*who*/, 1/*low bit depth*/, 1/*indexed*/);
11687 * calculations are done in the input bit depth not the output.
11698 /* Low bit depth gray images don't do well in the gamma tests, until
11883 else if (strcmp(*argv, "--low-depth-gray") == 0)
11888 else if (strcmp(*argv, "--nolow-depth-gray") == 0)
11935 else if (strcmp(*argv, "--calculations-follow-bit-depth") == 0)