#include <pnmFileTypeRegistry.h>
Public Member Functions | |
~PNMFileTypeRegistry () | |
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_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. | |
PNMFileType * | get_type_by_handle (TypeHandle handle) const |
Returns the PNMFileType instance stored in the registry for the given TypeHandle, e.g. | |
void | write_types (ostream &out, int indent_level=0) const |
Writes a list of supported image file types to the indicated output stream, one per line. | |
void | register_type (PNMFileType *type) |
Defines a new PNMFileType in the universe. | |
Static Public Member Functions | |
PNMFileTypeRegistry * | get_ptr () |
Returns a pointer to the global PNMFileTypeRegistry object. | |
Protected Member Functions | |
PNMFileTypeRegistry () | |
Private Types | |
typedef pvector< PNMFileType * > | Types |
typedef pmap< string, Types > | Extensions |
typedef pmap< TypeHandle, PNMFileType * > | Handles |
Private Member Functions | |
void | sort_preferences () |
Sorts the PNMFileType pointers in order according to user-specified preferences in the config file. | |
Private Attributes | |
Types | _types |
Extensions | _extensions |
Handles | _handles |
bool | _requires_sort |
Static Private Attributes | |
PNMFileTypeRegistry * | _global_ptr |
Definition at line 40 of file pnmFileTypeRegistry.h.
|
Definition at line 66 of file pnmFileTypeRegistry.h. |
|
Definition at line 69 of file pnmFileTypeRegistry.h. |
|
Definition at line 63 of file pnmFileTypeRegistry.h. |
|
Definition at line 42 of file pnmFileTypeRegistry.cxx. |
|
Definition at line 54 of file pnmFileTypeRegistry.cxx. References _global_ptr, and NULL. |
|
Returns the total number of types registered.
Definition at line 84 of file pnmFileTypeRegistry.cxx. |
|
Returns a pointer to the global PNMFileTypeRegistry object.
Definition at line 68 of file pnmFileTypeRegistry.cxx. References _types. Referenced by PNMFileTypeSGI::make_reader(), PNMFileTypeJPG2000::make_reader(), PNMFileTypeJPG::make_reader(), PNMFileTypeBMP::make_reader(), PNMImageHeader::make_writer(), PNMFileTypeSoftImage::Writer::write_header(), and PNMFileTypeAlias::Writer::write_header(). |
|
Returns the nth type registered.
Definition at line 100 of file pnmFileTypeRegistry.cxx. |
|
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 205 of file pnmFileTypeRegistry.cxx. Referenced by PNMFileTypeSGI::make_reader(), PNMFileTypeJPG2000::make_reader(), PNMFileTypeJPG::make_reader(), PNMFileTypeBMP::make_reader(), PNMFileTypeSoftImage::Writer::write_header(), and PNMFileTypeAlias::Writer::write_header(). |
|
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 120 of file pnmFileTypeRegistry.cxx. Referenced by PNMImageHeader::make_writer(). |
|
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 173 of file pnmFileTypeRegistry.cxx. |
|
Defines a new PNMFileType in the universe.
Definition at line 260 of file pnmFileTypeRegistry.cxx. References _requires_sort. |
|
Sorts the PNMFileType pointers in order according to user-specified preferences in the config file. This allows us to choose a particular PNMFileType over another for particular extensions when multiple file types map to the same extension, or for file types that have no magic number. Definition at line 314 of file pnmFileTypeRegistry.cxx. |
|
Writes a list of supported image file types to the indicated output stream, one per line.
Definition at line 226 of file pnmFileTypeRegistry.cxx. |
|
Definition at line 67 of file pnmFileTypeRegistry.h. |
|
Definition at line 32 of file pnmFileTypeRegistry.cxx. Referenced by ~PNMFileTypeRegistry(). |
|
Definition at line 70 of file pnmFileTypeRegistry.h. Referenced by write_types(). |
|
Definition at line 72 of file pnmFileTypeRegistry.h. Referenced by register_type(). |
|
Definition at line 64 of file pnmFileTypeRegistry.h. Referenced by get_num_types(), get_ptr(), and write_types(). |