35#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_PNMIMAGETYPES)
36 #error Buildsystem error: BUILDING_PANDA_PNMIMAGETYPES not defined
43Configure(config_pnmimagetypes);
44NotifyCategoryDefName(pnmimage_sgi,
"sgi", pnmimage_cat);
45NotifyCategoryDefName(pnmimage_tga,
"tga", pnmimage_cat);
46NotifyCategoryDefName(pnmimage_img,
"img", pnmimage_cat);
47NotifyCategoryDefName(pnmimage_soft,
"soft", pnmimage_cat);
48NotifyCategoryDefName(pnmimage_bmp,
"bmp", pnmimage_cat);
49NotifyCategoryDefName(pnmimage_jpg,
"jpg", pnmimage_cat);
50NotifyCategoryDefName(pnmimage_png,
"png", pnmimage_cat);
51NotifyCategoryDefName(pnmimage_pnm,
"pnm", pnmimage_cat);
52NotifyCategoryDefName(pnmimage_tiff,
"tiff", pnmimage_cat);
53NotifyCategoryDefName(pnmimage_exr,
"exr", pnmimage_cat);
56(
"sgi-storage-type", SST_rle,
57 PRC_DESC(
"Use either 'rle' or 'verbatim' to indicate how SGI (*.rgb) "
58 "files are written."));
61 PRC_DESC(
"This string is written to the header of an SGI (*.rgb) file. "
62 "It seems to have documentation purposes only."));
70 PRC_DESC(
"Set this true to enable RLE compression when writing TGA files."));
73(
"tga-colormap",
false,
74 PRC_DESC(
"Set this true to write colormapped TGA files."));
77(
"tga-grayscale",
false,
78 PRC_DESC(
"Set this true to enable writing grayscale TGA files."));
81(
"img-header-type", IHT_short,
82 PRC_DESC(
"IMG format is just a sequential string of r, g, b bytes. However, "
83 "it may or may not include a \"header\" which consists of the xsize "
84 "and the ysize of the image, either as shorts or as longs. Specify "
85 "that with this variable, either 'short', 'long', or 'none' for "
86 "no header at all (in which case you should also set img-size)."));
90 PRC_DESC(
"If an IMG file without a header is loaded (e.g. img-header-type "
91 "is set to 'none', this specifies the fixed x y size of the image."));
95 PRC_DESC(
"Set this to the quality percentage for writing JPEG files. 95 is "
96 "the highest useful value (values greater than 95 do not lead to "
97 "significantly better quality, but do lead to significantly greater "
101(
"png-compression-level", 6,
102 PRC_DESC(
"Set this to the desired compression level for writing PNG images. "
103 "Valid values are 0 (no compression), or 1 (compression, best "
104 "speed) to 9 (best compression). Default is 6. PNG compression is "
109 PRC_DESC(
"Set this true to allow writing palette-based PNG images when "
114 PRC_DESC(
"This controls how many bits per pixel are written out for BMP "
115 "files. If this is zero, the default, the number of bits per pixel "
116 "is based on the image."));
119operator << (ostream &out, SGIStorageType sst) {
124 return out <<
"verbatim";
127 return out <<
"**invalid SGIStorageType(" << (int)sst <<
")**";
131operator >> (istream &in, SGIStorageType &sst) {
135 if (cmp_nocase(word,
"rle") == 0) {
137 }
else if (cmp_nocase(word,
"verbatim") == 0) {
140 pnmimage_img_cat->error()
141 <<
"Invalid SGIStorageType: " << word <<
"\n";
149operator << (ostream &out, IMGHeaderType iht) {
152 return out <<
"none";
154 return out <<
"short";
156 return out <<
"long";
159 return out <<
"**invalid IMGHeaderType(" << (int)iht <<
")**";
163operator >> (istream &in, IMGHeaderType &iht) {
167 if (cmp_nocase(word,
"none") == 0) {
169 }
else if (cmp_nocase(word,
"short") == 0) {
171 }
else if (cmp_nocase(word,
"long") == 0) {
174 pnmimage_img_cat->error()
175 <<
"Invalid IMGHeaderType: " << word <<
"\n";
182ConfigureFn(config_pnmimagetypes) {
194 static bool initialized =
false;
205 PNMFileTypeSGI::init_type();
206 PNMFileTypeSGI::register_with_read_factory();
211 PNMFileTypeTGA::init_type();
212 PNMFileTypeTGA::register_with_read_factory();
217 PNMFileTypeIMG::init_type();
218 PNMFileTypeIMG::register_with_read_factory();
222#ifdef HAVE_SOFTIMAGE_PIC
223 PNMFileTypeSoftImage::init_type();
224 PNMFileTypeSoftImage::register_with_read_factory();
229 PNMFileTypeBMP::init_type();
230 PNMFileTypeBMP::register_with_read_factory();
235 PNMFileTypePNM::init_type();
236 PNMFileTypePNM::register_with_read_factory();
240 PNMFileTypePfm::init_type();
245 PNMFileTypeJPG::init_type();
246 PNMFileTypeJPG::register_with_read_factory();
251 PNMFileTypePNG::init_type();
252 PNMFileTypePNG::register_with_read_factory();
257 PNMFileTypeTIFF::init_type();
258 PNMFileTypeTIFF::register_with_read_factory();
263 PNMFileTypeEXR::init_type();
264 PNMFileTypeEXR::register_with_read_factory();
269 PNMFileTypeStbImage::init_type();
270 PNMFileTypeStbImage::register_with_read_factory();
This is a convenience class to specialize ConfigVariable as a boolean type.
This class specializes ConfigVariable as an enumerated type.
This is a convenience class to specialize ConfigVariable as an integer type.
This is a convenience class to specialize ConfigVariable as a string type.
For reading and writing PFM files using the basic PNMImage interface, as if they were basic RGB files...
static void register_with_read_factory()
Registers the current object as something that can be read from a Bam file.
This class maintains the set of all known PNMFileTypes in the universe.
static PNMFileTypeRegistry * get_global_ptr()
Returns a pointer to the global PNMFileTypeRegistry object.
void register_type(PNMFileType *type)
Defines a new PNMFileType in the universe.
This class is used as a namespace to group several global properties of Panda.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
void init_libpnmimage()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libpnmimagetypes()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.