Panda3D
|
This class maintains the set of all known PNMFileTypes in the universe. More...
#include "pnmFileTypeRegistry.h"
Public Member Functions | |
int | get_num_types () const |
Returns the total number of types registered. | |
PNMFileType * | get_type (int n) const |
Returns the nth type registered. | |
PNMFileType * | get_type_by_handle (TypeHandle handle) const |
Returns the PNMFileType instance stored in the registry for the given TypeHandle, e.g. | |
PNMFileType * | get_type_from_extension (const string &filename) const |
Tries to determine what the PNMFileType is likely to be for a particular image file based on its extension. | |
PNMFileType * | get_type_from_magic_number (const string &magic_number) const |
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. | |
MAKE_SEQ (get_types, get_num_types, get_type) | |
void | register_type (PNMFileType *type) |
Defines a new PNMFileType in the universe. | |
void | write (ostream &out, int indent_level=0) const |
Writes a list of supported image file types to the indicated output stream, one per line. | |
Static Public Member Functions | |
static PNMFileTypeRegistry * | get_global_ptr () |
Returns a pointer to the global PNMFileTypeRegistry object. |
This class maintains the set of all known PNMFileTypes in the universe.
Definition at line 31 of file pnmFileTypeRegistry.h.
PNMFileTypeRegistry * PNMFileTypeRegistry::get_global_ptr | ( | ) | [static] |
Returns a pointer to the global PNMFileTypeRegistry object.
Definition at line 267 of file pnmFileTypeRegistry.cxx.
Referenced by ProgramBase::dispatch_image_type(), PNMImageHeader::make_reader(), and PNMImageHeader::make_writer().
int PNMFileTypeRegistry::get_num_types | ( | ) | const |
Returns the total number of types registered.
Definition at line 98 of file pnmFileTypeRegistry.cxx.
PNMFileType * PNMFileTypeRegistry::get_type | ( | int | n | ) | const |
Returns the nth type registered.
Definition at line 111 of file pnmFileTypeRegistry.cxx.
PNMFileType * PNMFileTypeRegistry::get_type_by_handle | ( | TypeHandle | handle | ) | const |
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.
Definition at line 218 of file pnmFileTypeRegistry.cxx.
PNMFileType * PNMFileTypeRegistry::get_type_from_extension | ( | const string & | filename | ) | const |
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.
Definition at line 125 of file pnmFileTypeRegistry.cxx.
Referenced by ProgramBase::dispatch_image_type(), TexturePool::get_texture_type(), PNMImageHeader::make_reader(), PNMImageHeader::make_writer(), and TexturePool::write_texture_types().
PNMFileType * PNMFileTypeRegistry::get_type_from_magic_number | ( | const string & | magic_number | ) | const |
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.
Definition at line 192 of file pnmFileTypeRegistry.cxx.
References PNMFileType::has_magic_number(), and PNMFileType::matches_magic_number().
void PNMFileTypeRegistry::register_type | ( | PNMFileType * | type | ) |
Defines a new PNMFileType in the universe.
Definition at line 52 of file pnmFileTypeRegistry.cxx.
References PNMFileType::get_extension(), and PNMFileType::get_num_extensions().
void PNMFileTypeRegistry::write | ( | ostream & | out, |
int | indent_level = 0 |
||
) | const |
Writes a list of supported image file types to the indicated output stream, one per line.
Definition at line 235 of file pnmFileTypeRegistry.cxx.
References PNMFileType::get_extension(), and PNMFileType::get_num_extensions().
Referenced by ProgramBase::dispatch_image_type(), and TexturePool::write_texture_types().