panda3d.core.PNMFileTypeRegistry

class PNMFileTypeRegistry

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

Inheritance diagram

Inheritance diagram of PNMFileTypeRegistry

__init__(param0: PNMFileTypeRegistry) → None
getNumTypes() → int

Returns the total number of types registered.

getType(n: int) → PNMFileType

Returns the nth type registered.

Return type

PNMFileType

getTypeFromExtension(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.

Return type

PNMFileType

getTypeFromMagicNumber(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.

Return type

PNMFileType

getTypeByHandle(handle: TypeHandle) → PNMFileType

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

Return type

PNMFileType

write(out: ostream, indent_level: int) → None

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

static getGlobalPtr() → PNMFileTypeRegistry

Returns a pointer to the global PNMFileTypeRegistry object.

Return type

PNMFileTypeRegistry

getTypes() → list
property types

Returns the nth type registered.

Return type

Sequence[PNMFileType]