zooui.tilesystem.tiler.ppm module

Module for reading PPM images.

zooui.tilesystem.tiler.ppm.read_ppm_header(f)[source]
Function :

read_ppm_header(f)

Parameters :

f : Any

read_ppm_header(f) –> Tuple[int, int]

Read the PPM header in the given file object f and return a tuple representing the dimensions of the image.

Raises IOError if the header is invalid and/or unsupported (must be ‘P6’ binary PPM format with maxval=255).

class zooui.tilesystem.tiler.ppm.PPMTiler(infile, media_id=None, filext='jpg', tilesize=256)[source]

Bases: Tiler

Constructor:

PPMTiler(infile, media_id, filext, tilesize)

Parameters :

infile : str media_id : Optional[str] filext : str tilesize : int

PPMTiler(infile, media_id, filext, tilesize) –> None

PPMTiler objects are used for tiling PPM images. Inherits from Tiler class and provides PPM-specific image reading.

Constructor:

PPMTiler(infile, media_id, filext, tilesize)

Parameters :

infile : str media_id : Optional[str] filext : str tilesize : int

PPMTiler(infile, media_id, filext, tilesize) –> None

Create a new PPMTiler for tiling the media given by media_id with the PPM image given by infile.

If media_id is omitted, it will be set to infile.

Tiles will be saved in the format indicated by filext and with the dimensions given by tilesize.

_scanchunk()[source]
Method :

PPMTiler._scanchunk()

Parameters :

None

PPMTiler._scanchunk() –> bytes

Scan a chunk of ppm image bytes correspondent of a tile row. The row length of the tile is given by self._bytes_per_pixel*self._width.