Home | History | Annotate | Download | only in libtests

Lines Matching defs:CHUNK

2208 /* One modification structure must be provided for each chunk to be modified (in
2210 * for a single chunk.) Modifications include adding a new chunk when a
2211 * suitable chunk does not exist.
2213 * The caller of modify_fn will reset the CRC of the chunk and record 'modified'
2215 * modify_fn is NULL the chunk is simply removed.
2220 png_uint_32 chunk;
2226 /* If the following is set to PLTE, IDAT or IEND and the chunk has not been
2228 * to add the chunk before the relevant chunk.
2231 unsigned int modified :1; /* Chunk was modified */
2232 unsigned int added :1; /* Chunk was added */
2233 unsigned int removed :1; /* Chunk was removed */
2253 pmm->chunk = 0;
2433 #define CHUNK(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d))
2434 #define CHUNK_IHDR CHUNK(73,72,68,82)
2435 #define CHUNK_PLTE CHUNK(80,76,84,69)
2436 #define CHUNK_IDAT CHUNK(73,68,65,84)
2437 #define CHUNK_IEND CHUNK(73,69,78,68)
2438 #define CHUNK_cHRM CHUNK(99,72,82,77)
2439 #define CHUNK_gAMA CHUNK(103,65,77,65)
2440 #define CHUNK_sBIT CHUNK(115,66,73,84)
2441 #define CHUNK_sRGB CHUNK(115,82,71,66)
2447 /* Recalculate the chunk CRC - a complete chunk must be in
2475 png_uint_32 len, chunk;
2504 if (mod->chunk == CHUNK_IHDR && mod->modify_fn &&
2525 /* Read a new chunk and process it until we see PLTE, IDAT or
2527 * output from the preceding chunk.
2540 * chunk.
2555 /* Check for something to modify or a terminator chunk. */
2557 chunk = png_get_uint_32(pm->buffer+4);
2562 if (chunk == CHUNK_PLTE || chunk == CHUNK_IDAT ||
2563 chunk == CHUNK_IEND)
2569 if ((mod->add == chunk ||
2570 (mod->add == CHUNK_PLTE && chunk == CHUNK_IDAT)) &&
2580 /* Reset the CRC on a new chunk */
2591 * so output this. Pend the current chunk.
2594 pm->pending_chunk = chunk;
2603 * otherwise the code will end up modifying a chunk that was
2610 /* If we get to here then this chunk may need to be modified. To
2624 if (mod->chunk == chunk)
2628 /* Remove this chunk */
2637 /* The chunk may have been removed: */
2713 * (This doesn't quite work - the modifier might delete a chunk; unlikely
2794 me->this.chunk = CHUNK_gAMA;
2814 /* As with gAMA this just adds the required cHRM chunk to the buffer. */
2849 me->this.chunk = CHUNK_cHRM;
2866 /* As above, ignore add and just make a new chunk */
2877 me->this.chunk = CHUNK_sBIT;
2945 /* Remove the sBIT chunk */
2957 me->this.chunk = CHUNK_sBIT;
3090 values[i][0] = 255; /* no transparency/tRNS chunk */
3116 * indicates whether or not to also set the tRNS chunk.
4466 png_error(pp, "validate: PLTE or tRNS chunk changed");
4609 png_error(pp, "validate: invalid tRNS chunk with alpha image");
5280 int have_tRNS; /* tRNS chunk may need processing */
5388 * chunk at the same time, because the tRNS will be in palette form. The way
5436 * original tRNS gray chunk valie.
6269 /* We don't know yet whether there will be a tRNS chunk, but we know that
6678 * or an sRGB chunk will be inserted.
6840 /* We have an encoding so a cHRM chunk may have been set; if so then
6923 * from the cHRm chunk. PNG uses fixed point in the cHRM chunk, so
7783 * gamma, but since the file has a gAMA chunk this does not matter.
8879 * given gamma value and the sBIT chunk to the given precision.
9463 printf("increases when the image file includes an sBIT chunk.\n");