PNMFileTypeRegistry

from panda3d.core import PNMFileTypeRegistry
class PNMFileTypeRegistry

Bases:

This class maintains the set of all known PNMFileTypes in the universe.

Inheritance diagram

Inheritance diagram of PNMFileTypeRegistry

__init__(param0: PNMFileTypeRegistry)
static get_global_ptr() PNMFileTypeRegistry

Returns a pointer to the global PNMFileTypeRegistry object.

get_num_types() int

Returns the total number of types registered.

get_type(n: int) PNMFileType

Returns the nth type registered.

get_type_by_handle(handle: TypeHandle) PNMFileType

Returns the PNMFileType instance stored in the registry for the given TypeHandle, e.g. as retrieved by a previous call to get_type() on the type instance.

get_type_from_extension(filename: str) PNMFileType

Tries to determine what the PNMFileType is likely to be for a particular image file based on its extension. Returns a suitable PNMFileType pointer, or NULL if no type can be determined.

get_type_from_magic_number(magic_number: str) PNMFileType

Tries to determine what the PNMFileType is likely to be for a particular image file based on its magic number, the first two bytes read from the file. Returns a suitable PNMFileType pointer, or NULL if no type can be determined.

get_types() list
property types Sequence[PNMFileType]

Returns the nth type registered.

write(out: ostream, indent_level: int)

Writes a list of supported image file types to the indicated output stream, one per line.