27class EXPCL_PANDA_PNMIMAGE PNMReader :
public PNMImageHeader {
29 INLINE PNMReader(
PNMFileType *type, std::istream *file,
bool owns_file);
42 virtual bool read_row(xel *
array, xelval *alpha,
int x_size,
int y_size);
49 int get_reduction_shift(
int orig_size,
int new_size);
57 int _read_x_size, _read_y_size;
60 int _x_shift, _y_shift;
61 int _orig_x_size, _orig_y_size;
This is the base class of a family of classes that represent particular image file types that PNMImag...
virtual bool read_row(xel *array, xelval *alpha, int x_size, int y_size)
If supports_read_row(), above, returns true, this function may be called repeatedly to read the image...
virtual int read_data(xel *array, xelval *alpha)
Reads in an entire image all at once, storing it in the pre-allocated _x_size * _y_size array and alp...
virtual bool is_floating_point()
Returns true if this PNMFileType represents a floating-point image type, false if it is a normal,...
virtual void prepare_read()
This method will be called before read_data() or read_row() is called.
virtual bool supports_stream_read() const
Returns true if this particular PNMReader can read from a general stream (including pipes,...
virtual bool supports_read_row() const
Returns true if this particular PNMReader is capable of returning the data one row at a time,...
bool is_valid() const
Returns true if the PNMReader can be used to read data, false if something is wrong.
void set_read_size(int x_size, int y_size)
Instructs the reader to attempt to scale the image to the indicated size while reading it.
virtual bool read_pfm(PfmFile &pfm)
Reads floating-point data directly into the indicated PfmFile.
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.