|
|
|
This is the base class of a family of classes that represent particular image file types that PNMImage supports.
More...
#include "pnmFileType.h"
List of all members.
Public Member Functions |
|
virtual TypeHandle | force_init_type () |
| virtual string | get_extension (int n) const |
| | Returns the nth possible filename extension associated with this particular file type, without a leading dot.
|
|
virtual string | get_name () const =0 |
| virtual int | get_num_extensions () const |
| | Returns the number of different possible filename extensions associated with this particular file type.
|
| virtual string | get_suggested_extension () const |
| | Returns a suitable filename extension (without a leading dot) to suggest for files of this type, or empty string if no suggestions are available.
|
|
virtual TypeHandle | get_type () const |
| virtual bool | has_magic_number () const |
| | Returns true if this particular file type uses a magic number to identify it, false otherwise.
|
| virtual PNMReader * | make_reader (istream *file, bool owns_file=true, const string &magic_number=string()) |
| | Allocates and returns a new PNMReader suitable for reading from this file type, if possible.
|
|
| MAKE_SEQ (get_extensions, get_num_extensions, get_extension) |
| virtual PNMWriter * | make_writer (ostream *file, bool owns_file=true) |
| | Allocates and returns a new PNMWriter suitable for reading from this file type, if possible.
|
| virtual bool | matches_magic_number (const string &magic_number) const |
| | Returns true if the indicated "magic number" byte stream (the initial few bytes read from the file) matches this particular file type, false otherwise.
|
| virtual void | write_datagram (BamWriter *writer, Datagram &datagram) |
| | Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
|
static void | register_with_read_factory () |
Static Protected Member Functions |
| static void | init_pnm () |
| | Initializes the underlying PNM library, if it has not already been initialized.
|
|
static TypedWritable * | make_PNMFileType (const FactoryParams ¶ms) |
Detailed Description
This is the base class of a family of classes that represent particular image file types that PNMImage supports.
Definition at line 35 of file pnmFileType.h.
Member Function Documentation
| string PNMFileType::get_extension |
( |
int |
n | ) |
const [virtual] |
| int PNMFileType::get_num_extensions |
( |
| ) |
const [virtual] |
| string PNMFileType::get_suggested_extension |
( |
| ) |
const [virtual] |
| bool PNMFileType::has_magic_number |
( |
| ) |
const [virtual] |
| void PNMFileType::init_pnm |
( |
| ) |
[static, protected] |
Initializes the underlying PNM library, if it has not already been initialized.
This should be called by every implementation of make_reader() and make_writer(), to ensure that the library is properly initialized before any I/O is attempted.
Definition at line 139 of file pnmFileType.cxx.
| static void PNMFileType::init_type |
( |
| ) |
[inline, static] |
| PNMReader * PNMFileType::make_reader |
( |
istream * |
file, |
|
|
bool |
owns_file = true, |
|
|
const string & |
magic_number = string() |
|
) |
| [virtual] |
| PNMWriter * PNMFileType::make_writer |
( |
ostream * |
file, |
|
|
bool |
owns_file = true |
|
) |
| [virtual] |
| bool PNMFileType::matches_magic_number |
( |
const string & |
magic_number | ) |
const [virtual] |
| void PNMFileType::write_datagram |
( |
BamWriter * |
writer, |
|
|
Datagram & |
datagram |
|
) |
| [virtual] |
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
None of the particular PNMFileType objects store any extra data--at least, not yet--so we just define this up here to do nothing.
Reimplemented from TypedWritable.
Definition at line 159 of file pnmFileType.cxx.
The documentation for this class was generated from the following files:
| | |