Panda3D
pnmReader.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pnmReader.I
10  * @author drose
11  * @date 2000-06-16
12  */
13 
14 /**
15  *
16  */
17 INLINE PNMReader::
18 PNMReader(PNMFileType *type, std::istream *file, bool owns_file) :
19  _type(type),
20  _owns_file(owns_file),
21  _file(file),
22  _is_valid(true),
23  _has_read_size(false)
24 {
25 }
26 
27 /**
28  * Instructs the reader to attempt to scale the image to the indicated size
29  * while reading it. The reader may or may not follow this suggestion, or may
30  * follow it only partially (e.g. by reading a file which is slightly reduced
31  * in size, but not the precise size requested).
32  */
33 void PNMReader::
34 set_read_size(int x_size, int y_size) {
35  _read_x_size = x_size;
36  _read_y_size = y_size;
37  _has_read_size = true;
38 }
39 
40 /**
41  * Returns a pointer to the PNMFileType object that created this PNMReader.
42  */
44 get_type() const {
45  return _type;
46 }
47 
48 /**
49  * Returns true if the PNMReader can be used to read data, false if something
50  * is wrong.
51  */
52 INLINE bool PNMReader::
53 is_valid() const {
54  return _is_valid;
55 }
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.
Definition: pnmReader.I:34
This is the base class of a family of classes that represent particular image file types that PNMImag...
Definition: pnmFileType.h:32
bool is_valid() const
Returns true if the PNMReader can be used to read data, false if something is wrong.
Definition: pnmReader.I:53
PNMFileType * get_type() const
Returns a pointer to the PNMFileType object that created this PNMReader.
Definition: pnmReader.I:44