MCPcopy Create free account
hub / github.com/DFHack/dfhack / readChunk_pHYs

Function readChunk_pHYs

depends/lodepng/lodepng.cpp:4618–4627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4616}
4617
4618static unsigned readChunk_pHYs(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
4619 if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/
4620
4621 info->phys_defined = 1;
4622 info->phys_x = 16777216u * data[0] + 65536u * data[1] + 256u * data[2] + data[3];
4623 info->phys_y = 16777216u * data[4] + 65536u * data[5] + 256u * data[6] + data[7];
4624 info->phys_unit = data[8];
4625
4626 return 0; /* OK */
4627}
4628
4629static unsigned readChunk_gAMA(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
4630 if(chunkLength != 4) return 96; /*invalid gAMA chunk size*/

Callers 2

lodepng_inspect_chunkFunction · 0.85
decodeGenericFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected