Panda3D
 All Classes Functions Variables Enumerations
config_pnmimage.cxx
1 // Filename: config_pnmimage.cxx
2 // Created by: drose (19Mar00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_pnmimage.h"
16 #include "pnmFileType.h"
17 #include "pnmFileTypeRegistry.h"
18 
19 #include "dconfig.h"
20 
21 Configure(config_pnmimage);
22 NotifyCategoryDef(pnmimage, "");
23 
24 ConfigureFn(config_pnmimage) {
25  init_libpnmimage();
26 }
27 
28 ConfigVariableBool pfm_force_littleendian
29 ("pfm-force-littleendian", false,
30  PRC_DESC("This forces a pfm file to be read as a sequence of little-endian "
31  "floats, even if its scale factor is given as a positive number."));
32 
33 ConfigVariableBool pfm_reverse_dimensions
34 ("pfm-reverse-dimensions", false,
35  PRC_DESC("Understands that the width and height of a pfm file are given "
36  "backwards, in the form height width instead of width height, "
37  "on input. Does not affect output, which is always written width height."));
38 
39 ConfigVariableBool pfm_resize_quick
40 ("pfm-resize-quick", true,
41  PRC_DESC("Specify true to implement PfmFile::resize() with a \"quick\" filter, "
42  "but only when the pfm is being downsampled (to a smaller size). "
43  "This just controls the behavior of resize(); you can "
44  "always call quick_filter() explicitly."));
45 
46 ConfigVariableBool pfm_resize_gaussian
47 ("pfm-resize-gaussian", true,
48  PRC_DESC("Specify true to implement PfmFile::resize() with a higher-quality "
49  "Gaussian filter, or false to implement it with a faster box "
50  "filter. If pfm-resize-quick is also true, this only takes effect "
51  "when the pfm is being upsampled. This just controls the behavior "
52  "of resize(); you can always call box_filter() or gaussian_filter() "
53  "explicitly."));
54 
55 ConfigVariableDouble pfm_resize_radius
56 ("pfm-resize-radius", 1.0,
57  PRC_DESC("Specify the default filter radius for PfmFile::resize(). "
58  "This just controls the behavior of resize(); you can "
59  "always call box_filter() or gaussian_filter() explicitly with "
60  "a specific radius."));
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: init_libpnmimage
64 // Description: Initializes the library. This must be called at
65 // least once before any of the functions or classes in
66 // this library can be used. Normally it will be
67 // called by the static initializers and need not be
68 // called explicitly, but special cases exist.
69 ////////////////////////////////////////////////////////////////////
70 void
71 init_libpnmimage() {
72  static bool initialized = false;
73  if (initialized) {
74  return;
75  }
76  initialized = true;
77 
78  PNMFileType::init_type();
79 }
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating-point type.