Home | History | Annotate | Download | only in libtests

Lines Matching defs:be

13  *   This is a C program that is intended to be linked against libpng.  It
18 * The program can be modified and extended to test the correctness of
103 /* 1.6.0 constifies many APIs, the following exists to allow pngvalid to be
144 * name 'the_exception_context' must be defined.
279 * was done by libpng. Width and height must be less than 256. 'palette' is an
340 * write support is required to do 16 bit read tests (we must be able to make a
469 * NOTE: The to and from buffers may be the same.
541 /* There are, but they may not be significant, remove the bits
550 /* From libpng-1.5.6 the overwrite should be fixed, so compare the trailing
593 png_uint_32 id; /* must be correct (see FILEID) */
597 store_palette_entry* palette; /* May be NULL */
1229 * readpos will be set.
1280 /* The result may be null if there is no palette. */
1323 /* Note that pp may be NULL (see store_pool_delete below), the caller has
1333 /* It should be safe to read the size field now. */
1444 * to return so cleanup can be performed.
1470 /* First check that this 'memory' really is valid memory - it must be in the
1602 /* Always do this to be safe. */
1642 * to retrieve. Ids must be unique or the earlier file will be hidden. The API
1643 * returns a png_struct and, optionally, a png_info. Both of these will be
1717 /* Files may be modified on read. The following structure contains a complete
1719 * read callback for libpng. To use this the 'modifications' field must be set
1853 /* While handling PLTE, IDAT and IEND these chunks may be pended to allow
1854 * other chunks to be inserted.
1871 * following must be set to 0 and tested by the function that uses the
1935 * range input-.5 to input+.5 will be accepted, otherwise the value must be
1936 * within the normal limits. It should not be necessary to set this; the
1937 * result should always be exact within the permitted error limits.
1966 * be modified - they must fit (including header and CRC) into the buffer!
1974 /* This returns true if the test should be stopped now because it has already
2057 * rounding and 'do_round' should be 1, if it is 0 the digitized value will
2058 * be truncated.
2117 * digitization of the output so can be +/-0.5 in the actual output value. In
2162 * and so must be adjusted for low bit depth grayscale:
2193 * final value. Normally this would just be quantization to an integral value,
2208 /* One modification structure must be provided for each chunk to be modified (in
2209 * fact more than one can be provided if multiple separate changes are desired
2222 /* If the following is NULL all matching chunks will be removed: */
2227 * found and modified (and there is a modify_fn) the modify_fn will be called
2296 * that this function changes the colour space encoding so it must only be
2300 * After the function has been called the 'repeat' flag will still be set; the
2362 /* The following must be set in the next run. In particular
2363 * test_uses_encodings must be set in the _ini function of each transform
2374 /* The following must be called before anything else to get the encoding set up
2375 * on the modifier. In particular it must be called before the transform init
2447 /* Recalculate the chunk CRC - a complete chunk must be in
2559 /* Terminators first, they may have to be delayed for added
2610 /* If we get to here then this chunk may need to be modified. To
2611 * do this it must be less than 1024 bytes in total size, otherwise
2620 /* Check for a modification, else leave it be. */
2768 * macros because the chunks can be there regardless of whether this specific
2996 * special case code which needs to be validated. To cause this to happen the
3015 * The store must be open for write when this is called, otherwise an internal
3093 * 'npalette' will always be a power of 2: 2, 4, 16 or 256. In the low
3118 /* TODO: the png_structp here can probably be 'const' in the future */
3247 return 0; /* Error, will be caught later */
3252 /* The following can only be defined here, now we have the definitions
3402 /* This is just to do the right cast - could be changed to a function to check
3423 /* This is an internal error - --interlace tests should be skipped, not
3473 static char key[] = "image name"; /* must be writeable */
3483 /* Yuck: the text must be writable! */
3506 /* Somewhat confusingly this must be called *after* png_write_info
3564 * and ps will always be the same value.
3609 /* Note that this can, trivially, be optimized to a memcpy on pass 7, the
3631 * this to be checked).
3660 /* There may be up to 7 remaining bits, these go in the most significant
3710 static char key[] = "image name"; /* must be writeable */
3720 /* Yuck: the text must be writable! */
3782 * need a reduced interlace row; this may be reduced
3787 /* The row must not be written if it doesn't exist, notice
3789 * ever in the pass or the row would be but isn't wide
3791 * can be used to skip the whole y loop in this case.
3862 * and ps will always be the same value.
3883 * no interlace + DIY should be identical to no interlace with
3932 * to ensure that they get detected - it should not be possible to write an
3935 /* TODO: the 'set' functions can probably all be made to take a
4141 * then the warning messages the library outputs will probably be garbage.
4235 * requirement that the pointer to the first member of a structure must be the
4237 * functions in the gamma test code; something that could not be done with
4309 /* Initialize the palette fields - this must be done later because the palette
4470 /* By passing a 'standard_display' the progressive callbacks can be used
4569 /* Validate the colour type 3 palette (this can be present on other color
4627 /* This must be called *after* the png_read_update_info call to get the correct
4635 /* Record cbRow now that it can be found. */
4697 /* When handling interlacing some rows will be absent in each pass, the
4772 /* wPass may be zero or this row may not be in this pass.
4773 * png_read_row must not be called in either case.
4936 /* The row must be pre-initialized to the magic number here for the size
4943 * In earlier passes 'row' will be partially filled in, with only the pixels
5266 * are legion because the transforms can be combined in a combinatorial
5322 * transforms and call it for each pixel since all the fields may need to be
5388 * chunk at the same time, because the tRNS will be in palette form. The way
5415 * not valid in an alpha image. The bit depth will invariably be set to at
5416 * least 8. Palette images will be converted to alpha (using the above API).
5470 * original sBIT data (actually it will always be the original bit depth).
5483 /* Each transform can be disabled from the command line: */
5638 * the sBIT allows the implementation to be worse than this. In addition the
5643 * any algorithm that digitizes intermediate results can be more accurate.
5783 /* Don't need sBIT here, but it must be set to non-zero to avoid
5941 * samples and the output has 16 bit samples the calculations will be done
5978 /* Find out what we think the pixel should be: */
6011 * be separately verified itself in most cases.
6269 /* We don't know yet whether there will be a tRNS chunk, but we know that
6538 * 'scale' API (above) must be used.
6542 # error PNG_READ_ACCURATE_SCALE should not be set
6629 * The 'default' test here uses values known to be used inside libpng:
6674 /* Since we check the encoding this flag must be set: */
6678 * or an sRGB chunk will be inserted.
6682 /* Coefficients come from the encoding, but may need to be normalized to a
6798 * NOTE: this magic number was determined by experiment to be 1.1 (when
6869 * color space encoding may not be normalized.
6981 * will be identical after this operation if there is only one
7069 /* Now the error can be calculated.
7104 double be = that->bluee;
7112 if (err < be) err = be;
7118 * so the calculation should be a lot more accurate. There is a
7128 be * data.blue_coefficient + 1./32768 + gray * 5 * DBL_EPSILON;
7151 bhi = b + be + in_qe; if (bhi > 1) bhi = 1;
7152 b -= be + in_qe; if (b < 0) b = 0;
7384 /* This may just be 'end' if all the transforms are disabled! */
7604 * like set_shift and set_packing, can't be done at present because they change
7658 /* 'max' is currently hardwired to '1'; this should be settable on the
7797 * to be linear, so if the test requires non-linear output it must be
7998 * this is the alpha component and the function should not be called!
8031 * gamma to be set to 1.0!)
8124 /* There may be an error, or background processing is required, so calculate
8307 * library should be between the two limits (inclusive) that were
8334 * for sbit) can be anywhere between value-.5 and value+.5 - quite a
8404 /* This may be required for other components in the future,
8680 * value stored in a PNG file be the original sample bits.
9036 * but this can be set from the command line.
9162 * by much) - this could be fixed, it only appears with the -g option.
9226 bg = 4; /* should not be used */
9239 * value tends to be <1, but is neither screen nor file (even if they
9247 bg = 4; /* should not be used */
9251 bg = 4; /* should not be used */
9255 bg = 4; /* should not be used */
9259 bg = 4; /* should not be used */
9288 /* The background values will be looked up in an 8-bit table to do
9459 printf("Expect this value to be less than .5 for 8 bit formats,\n");
9497 #ifdef DO_16BIT /* Should be READ_16BIT_SUPPORTED */
9579 * be indexed adam7[y][x] and notice that the pass numbers are based at
9927 * used the published errors the 'slack' permitted would have to be +/-.5E-4 or
9935 /* sRGB: must be first in this list! */
10064 /* Preallocate the image buffer, because we know how big it needs to be,
10116 * images can never be good enough, regardless of encoding.
10410 * read and interlace stuff has to be done in separate runs, so only the