src/lib/cache.c
changeset 55 a3542e78ecd8
parent 54 4a25113cb2a4
child 56 d5e3089906da
equal deleted inserted replaced
54:4a25113cb2a4 55:a3542e78ecd8
   375         // read row data, non-interlaced
   375         // read row data, non-interlaced
   376         png_read_row(png, row_buf, NULL);
   376         png_read_row(png, row_buf, NULL);
   377         
   377         
   378         // skip background-colored regions to keep the cache file sparse
   378         // skip background-colored regions to keep the cache file sparse
   379         // ...in blocks of PT_CACHE_BLOCK_SIZE bytes
   379         // ...in blocks of PT_CACHE_BLOCK_SIZE bytes
   380         for (size_t col_base = 0; col_base < cache->header->width; ){
   380         for (size_t col_base = 0; col_base < cache->header->width; col_base += PT_CACHE_BLOCK_SIZE) {
   381             // size of this block in bytes
   381             // size of this block in bytes
   382             size_t block_size = min(PT_CACHE_BLOCK_SIZE * cache->header->col_bytes, cache->header->row_bytes - col_base);
   382             size_t block_size = min(PT_CACHE_BLOCK_SIZE * cache->header->col_bytes, cache->header->row_bytes - col_base);
   383 
   383 
   384             // ...each pixel
   384             // ...each pixel
   385             for (
   385             for (