Lines Matching refs:CHUNK
366 * indicating if a tRNS chunk was generated.
2358 /* One modification structure must be provided for each chunk to be modified (in
2360 * for a single chunk.) Modifications include adding a new chunk when a
2361 * suitable chunk does not exist.
2363 * The caller of modify_fn will reset the CRC of the chunk and record 'modified'
2365 * modify_fn is NULL the chunk is simply removed.
2370 png_uint_32 chunk;
2376 /* If the following is set to PLTE, IDAT or IEND and the chunk has not been
2378 * to add the chunk before the relevant chunk.
2381 unsigned int modified :1; /* Chunk was modified */
2382 unsigned int added :1; /* Chunk was added */
2383 unsigned int removed :1; /* Chunk was removed */
2403 pmm->chunk = 0;
2585 #define CHUNK(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d))
2586 #define CHUNK_IHDR CHUNK(73,72,68,82)
2587 #define CHUNK_PLTE CHUNK(80,76,84,69)
2588 #define CHUNK_IDAT CHUNK(73,68,65,84)
2589 #define CHUNK_IEND CHUNK(73,69,78,68)
2590 #define CHUNK_cHRM CHUNK(99,72,82,77)
2591 #define CHUNK_gAMA CHUNK(103,65,77,65)
2592 #define CHUNK_sBIT CHUNK(115,66,73,84)
2593 #define CHUNK_sRGB CHUNK(115,82,71,66)
2599 /* Recalculate the chunk CRC - a complete chunk must be in
2627 png_uint_32 len, chunk;
2656 if (mod->chunk == CHUNK_IHDR && mod->modify_fn &&
2677 /* Read a new chunk and process it until we see PLTE, IDAT or
2679 * output from the preceding chunk.
2692 * chunk.
2707 /* Check for something to modify or a terminator chunk. */
2709 chunk = png_get_uint_32(pm->buffer+4);
2714 if (chunk == CHUNK_PLTE || chunk == CHUNK_IDAT ||
2715 chunk == CHUNK_IEND)
2721 if ((mod->add == chunk ||
2722 (mod->add == CHUNK_PLTE && chunk == CHUNK_IDAT)) &&
2732 /* Reset the CRC on a new chunk */
2743 * so output this. Pend the current chunk.
2746 pm->pending_chunk = chunk;
2755 * otherwise the code will end up modifying a chunk that was
2762 /* If we get to here then this chunk may need to be modified. To
2776 if (mod->chunk == chunk)
2780 /* Remove this chunk */
2789 /* The chunk may have been removed: */
2865 * (This doesn't quite work - the modifier might delete a chunk; unlikely
2946 me->this.chunk = CHUNK_gAMA;
2966 /* As with gAMA this just adds the required cHRM chunk to the buffer. */
3001 me->this.chunk = CHUNK_cHRM;
3018 /* As above, ignore add and just make a new chunk */
3029 me->this.chunk = CHUNK_sBIT;
3097 /* Remove the sBIT chunk */
3109 me->this.chunk = CHUNK_sBIT;
3242 values[i][0] = 255; /* no transparency/tRNS chunk */
3268 * indicates whether or not to also set the tRNS chunk.
4581 int has_tRNS; /* color type GRAY or RGB with a tRNS chunk. */
4790 png_error(pp, "validate: PLTE or tRNS chunk changed");
4933 png_error(pp, "validate: invalid tRNS chunk with alpha image");
5645 unsigned int have_tRNS :1; /* tRNS chunk may need processing */
5809 * chunk at the same time, because the tRNS will be in palette form. The way
5861 * tRNS chunk to expand at this point.
5871 * original tRNS gray chunk valie.
6730 /* If there was a tRNS chunk that would get expanded and add an alpha
6783 /* We don't know yet whether there will be a tRNS chunk, but we know that
7240 * or an sRGB chunk will be inserted.
7406 /* We have an encoding so a cHRM chunk may have been set; if so then
7489 * from the cHRm chunk. PNG uses fixed point in the cHRM chunk, so
8930 * gamma, but since the file has a gAMA chunk this does not matter.
10059 * given gamma value and the sBIT chunk to the given precision.
10671 printf("increases when the image file includes an sBIT chunk.\n");