Return a |_Chunk| subclass instance appropriate to `chunk_type` parsed from `stream_rdr` at `offset`.
(chunk_type, stream_rdr, offset)
| 166 | |
| 167 | |
| 168 | def _ChunkFactory(chunk_type, stream_rdr, offset): |
| 169 | """Return a |_Chunk| subclass instance appropriate to `chunk_type` parsed from |
| 170 | `stream_rdr` at `offset`.""" |
| 171 | chunk_cls_map = { |
| 172 | PNG_CHUNK_TYPE.IHDR: _IHDRChunk, |
| 173 | PNG_CHUNK_TYPE.pHYs: _pHYsChunk, |
| 174 | } |
| 175 | chunk_cls = chunk_cls_map.get(chunk_type, _Chunk) |
| 176 | return chunk_cls.from_offset(chunk_type, stream_rdr, offset) |
| 177 | |
| 178 | |
| 179 | class _Chunk: |
searching dependent graphs…