Panda3D
Classes | Public Member Functions | Static Public Member Functions | List of all members
PNMFileTypePfm Class Reference

For reading and writing PFM files using the basic PNMImage interface, as if they were basic RGB files. More...

#include "pnmFileTypePfm.h"

Inheritance diagram for PNMFileTypePfm:
PNMFileType TypedWritable TypedObject MemoryBase

Classes

class  Reader
 
class  Writer
 

Public Member Functions

virtual TypeHandle force_init_type ()
 
virtual std::string get_extension (int n) const
 Returns the nth possible filename extension associated with this particular file type, without a leading dot. More...
 
virtual std::string get_name () const
 Returns a few words describing the file type. More...
 
virtual int get_num_extensions () const
 Returns the number of different possible filename extensions associated with this particular file type. More...
 
virtual std::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. More...
 
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. More...
 
virtual PNMReadermake_reader (std::istream *file, bool owns_file=true, const std::string &magic_number=std::string())
 Allocates and returns a new PNMReader suitable for reading from this file type, if possible. More...
 
virtual PNMWritermake_writer (std::ostream *file, bool owns_file=true)
 Allocates and returns a new PNMWriter suitable for reading from this file type, if possible. More...
 
virtual bool matches_magic_number (const std::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. More...
 
- Public Member Functions inherited from PNMFileType
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. More...
 
- Public Member Functions inherited from TypedWritable
 TypedWritable (const TypedWritable &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). More...
 
vector_uchar encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More...
 
bool encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
virtual void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More...
 
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
void operator= (const TypedWritable &copy)
 
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More...
 
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
static void register_with_read_factory ()
 Registers the current object as something that can be read from a Bam file. More...
 
- Static Public Member Functions inherited from PNMFileType
static TypeHandle get_class_type ()
 
static void init_type ()
 
static void register_with_read_factory ()
 
- Static Public Member Functions inherited from TypedWritable
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, vector_uchar data, BamReader *reader=nullptr)
 Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 

Additional Inherited Members

- Public Attributes inherited from PNMFileType
 get_extension
 Returns the nth possible filename extension associated with this particular file type, without a leading dot. More...
 
 get_name
 
 get_num_extensions
 Returns the number of different possible filename extensions associated with this particular file type. More...
 
 get_suggested_extension
 Returns a suitable filename extension (without a leading dot) to suggest for files of this type, or empty string if no suggestions are available. More...
 
- Public Attributes inherited from TypedObject
 get_type
 
- Static Public Attributes inherited from TypedWritable
static TypedWritable *const Null = nullptr
 

Detailed Description

For reading and writing PFM files using the basic PNMImage interface, as if they were basic RGB files.

Definition at line 28 of file pnmFileTypePfm.h.

Member Function Documentation

◆ get_extension()

string PNMFileTypePfm::get_extension ( int  n) const
virtual

Returns the nth possible filename extension associated with this particular file type, without a leading dot.

Reimplemented from PNMFileType.

Definition at line 56 of file pnmFileTypePfm.cxx.

◆ get_name()

string PNMFileTypePfm::get_name ( ) const
virtual

Returns a few words describing the file type.

Implements PNMFileType.

Definition at line 38 of file pnmFileTypePfm.cxx.

◆ get_num_extensions()

int PNMFileTypePfm::get_num_extensions ( ) const
virtual

Returns the number of different possible filename extensions associated with this particular file type.

Reimplemented from PNMFileType.

Definition at line 47 of file pnmFileTypePfm.cxx.

◆ get_suggested_extension()

string PNMFileTypePfm::get_suggested_extension ( ) const
virtual

Returns a suitable filename extension (without a leading dot) to suggest for files of this type, or empty string if no suggestions are available.

Reimplemented from PNMFileType.

Definition at line 65 of file pnmFileTypePfm.cxx.

◆ has_magic_number()

bool PNMFileTypePfm::has_magic_number ( ) const
virtual

Returns true if this particular file type uses a magic number to identify it, false otherwise.

Reimplemented from PNMFileType.

Definition at line 74 of file pnmFileTypePfm.cxx.

◆ make_reader()

PNMReader * PNMFileTypePfm::make_reader ( std::istream *  file,
bool  owns_file = true,
const std::string &  magic_number = std::string() 
)
virtual

Allocates and returns a new PNMReader suitable for reading from this file type, if possible.

If reading from this file type is not supported, returns NULL.

Reimplemented from PNMFileType.

Definition at line 97 of file pnmFileTypePfm.cxx.

◆ make_writer()

PNMWriter * PNMFileTypePfm::make_writer ( std::ostream *  file,
bool  owns_file = true 
)
virtual

Allocates and returns a new PNMWriter suitable for reading from this file type, if possible.

If writing files of this type is not supported, returns NULL.

Reimplemented from PNMFileType.

Definition at line 107 of file pnmFileTypePfm.cxx.

◆ matches_magic_number()

bool PNMFileTypePfm::matches_magic_number ( const std::string &  magic_number) const
virtual

Returns true if the indicated "magic number" byte stream (the initial few bytes read from the file) matches this particular file type, false otherwise.

Reimplemented from PNMFileType.

Definition at line 84 of file pnmFileTypePfm.cxx.

◆ register_with_read_factory()

void PNMFileTypePfm::register_with_read_factory ( )
static

Registers the current object as something that can be read from a Bam file.

Definition at line 317 of file pnmFileTypePfm.cxx.

References BamReader::get_factory().

Referenced by init_libpnmimagetypes().


The documentation for this class was generated from the following files: