35 void operator = (
const PfmFile ©);
38 void clear(
int x_size,
int y_size,
int num_channels);
40 BLOCKING
bool read(
const Filename &fullpath);
43 BLOCKING
bool write(
const Filename &fullpath);
44 BLOCKING
bool write(std::ostream &out,
const Filename &fullpath =
Filename());
47 BLOCKING
bool load(
const PNMImage &pnmimage);
48 BLOCKING
bool store(
PNMImage &pnmimage)
const;
49 BLOCKING
bool store_mask(
PNMImage &pnmimage)
const;
50 BLOCKING
bool store_mask(
PNMImage &pnmimage,
const LVecBase4f &min_point,
const LVecBase4f &max_point)
const;
52 INLINE
bool is_valid()
const;
53 MAKE_PROPERTY(valid, is_valid);
55 INLINE PN_float32 get_scale()
const;
56 INLINE
void set_scale(PN_float32 scale);
57 MAKE_PROPERTY(scale, get_scale, set_scale);
59 INLINE
bool has_point(
int x,
int y)
const;
60 INLINE PN_float32 get_channel(
int x,
int y,
int c)
const;
61 INLINE
void set_channel(
int x,
int y,
int c, PN_float32 value);
62 INLINE PN_float32 get_point1(
int x,
int y)
const;
63 INLINE
void set_point1(
int x,
int y, PN_float32 point);
64 INLINE
const LPoint2f &get_point2(
int x,
int y)
const;
65 INLINE
void set_point2(
int x,
int y,
const LVecBase2f &point);
66 INLINE
void set_point2(
int x,
int y,
const LVecBase2d &point);
67 INLINE LPoint2f &modify_point2(
int x,
int y);
68 INLINE
const LPoint3f &get_point(
int x,
int y)
const;
69 INLINE
void set_point(
int x,
int y,
const LVecBase3f &point);
70 INLINE
void set_point(
int x,
int y,
const LVecBase3d &point);
71 INLINE LPoint3f &modify_point(
int x,
int y);
72 INLINE
const LPoint3f &get_point3(
int x,
int y)
const;
73 INLINE
void set_point3(
int x,
int y,
const LVecBase3f &point);
74 INLINE
void set_point3(
int x,
int y,
const LVecBase3d &point);
75 INLINE LPoint3f &modify_point3(
int x,
int y);
76 INLINE
const LPoint4f &get_point4(
int x,
int y)
const;
77 INLINE
void set_point4(
int x,
int y,
const LVecBase4f &point);
78 INLINE
void set_point4(
int x,
int y,
const LVecBase4d &point);
79 INLINE LPoint4f &modify_point4(
int x,
int y);
81 INLINE
void fill(PN_float32 value);
82 INLINE
void fill(
const LPoint2f &value);
83 INLINE
void fill(
const LPoint3f &value);
84 void fill(
const LPoint4f &value);
86 void fill_no_data_value();
87 void fill_channel(
int channel, PN_float32 value);
88 void fill_channel_nan(
int channel);
89 void fill_channel_masked(
int channel, PN_float32 value);
90 void fill_channel_masked_nan(
int channel);
92 BLOCKING
bool calc_average_point(LPoint3f &result, PN_float32 x, PN_float32 y, PN_float32 radius)
const;
93 BLOCKING
bool calc_bilinear_point(LPoint3f &result, PN_float32 x, PN_float32 y)
const;
94 BLOCKING
bool calc_min_max(LVecBase3f &min_points, LVecBase3f &max_points)
const;
95 BLOCKING
bool calc_autocrop(
int &x_begin,
int &x_end,
int &y_begin,
int &y_end)
const;
96 BLOCKING INLINE
bool calc_autocrop(LVecBase4f &range)
const;
97 BLOCKING INLINE
bool calc_autocrop(LVecBase4d &range)
const;
99 bool is_row_empty(
int y,
int x_begin,
int x_end)
const;
100 bool is_column_empty(
int x,
int y_begin,
int y_end)
const;
102 INLINE
void set_zero_special(
bool zero_special);
103 INLINE
void set_no_data_chan4(
bool chan4);
104 void set_no_data_nan(
int num_channels);
105 void set_no_data_value(
const LPoint4f &no_data_value);
106 INLINE
void set_no_data_value(
const LPoint4d &no_data_value);
107 void set_no_data_threshold(
const LPoint4f &no_data_value);
108 INLINE
void set_no_data_threshold(
const LPoint4d &no_data_value);
109 INLINE
void clear_no_data_value();
110 INLINE
bool has_no_data_value()
const;
111 INLINE
bool has_no_data_threshold()
const;
112 INLINE
const LPoint4f &get_no_data_value()
const;
114 BLOCKING
void resize(
int new_x_size,
int new_y_size);
115 BLOCKING
void box_filter_from(
float radius,
const PfmFile ©);
116 BLOCKING
void gaussian_filter_from(
float radius,
const PfmFile ©);
117 BLOCKING
void quick_filter_from(
const PfmFile ©);
119 BLOCKING
void reverse_rows();
120 BLOCKING
void flip(
bool flip_x,
bool flip_y,
bool transpose);
121 BLOCKING
void xform(
const LMatrix4f &transform);
122 INLINE BLOCKING
void xform(
const LMatrix4d &transform);
123 BLOCKING
void forward_distort(
const PfmFile &dist, PN_float32 scale_factor = 1.0);
124 BLOCKING
void reverse_distort(
const PfmFile &dist, PN_float32 scale_factor = 1.0);
125 BLOCKING
void apply_1d_lut(
int channel,
const PfmFile &lut, PN_float32 x_scale = 1.0);
127 BLOCKING
void merge(
const PfmFile &other);
128 BLOCKING
void apply_mask(
const PfmFile &other);
129 BLOCKING
void copy_channel(
int to_channel,
const PfmFile &other,
int from_channel);
130 BLOCKING
void copy_channel_masked(
int to_channel,
const PfmFile &other,
int from_channel);
131 BLOCKING
void apply_crop(
int x_begin,
int x_end,
int y_begin,
int y_end);
132 BLOCKING
void clear_to_texcoords(
int x_size,
int y_size);
134 BLOCKING
int pull_spot(
const LPoint4f &delta,
float xc,
float yc,
135 float xr,
float yr,
float exponent);
137 bool calc_tight_bounds(LPoint3f &min_point, LPoint3f &max_point)
const;
138 BLOCKING PT(
BoundingHexahedron) compute_planar_bounds(
const LPoint2f ¢er, PN_float32 point_dist, PN_float32 sample_radius,
bool points_only)
const;
139 INLINE BLOCKING PT(
BoundingHexahedron) compute_planar_bounds(
const LPoint2d ¢er, PN_float32 point_dist, PN_float32 sample_radius,
bool points_only)
const;
140 void compute_sample_point(LPoint3f &result,
141 PN_float32 x, PN_float32 y, PN_float32 sample_radius)
const;
143 void copy_sub_image(
const PfmFile ©,
int xto,
int yto,
144 int xfrom = 0,
int yfrom = 0,
145 int x_size = -1,
int y_size = -1);
146 void add_sub_image(
const PfmFile ©,
int xto,
int yto,
147 int xfrom = 0,
int yfrom = 0,
148 int x_size = -1,
int y_size = -1,
149 float pixel_scale = 1.0);
150 void mult_sub_image(
const PfmFile ©,
int xto,
int yto,
151 int xfrom = 0,
int yfrom = 0,
152 int x_size = -1,
int y_size = -1,
153 float pixel_scale = 1.0);
154 void divide_sub_image(
const PfmFile ©,
int xto,
int yto,
155 int xfrom = 0,
int yfrom = 0,
156 int x_size = -1,
int y_size = -1,
157 float pixel_scale = 1.0);
159 void operator *= (
float multiplier);
161 void indirect_1d_lookup(
const PfmFile &index_image,
int channel,
164 INLINE
void gamma_correct(
float from_gamma,
float to_gamma);
165 INLINE
void gamma_correct_alpha(
float from_gamma,
float to_gamma);
166 INLINE
void apply_exponent(
float gray_exponent);
167 INLINE
void apply_exponent(
float gray_exponent,
float alpha_exponent);
168 INLINE
void apply_exponent(
float c0_exponent,
float c1_exponent,
float c2_exponent);
169 void apply_exponent(
float c0_exponent,
float c1_exponent,
float c2_exponent,
float c3_exponent);
171 void output(std::ostream &out)
const;
174 EXTENSION(PyObject *get_points()
const);
176 EXTENSION(
int __getbuffer__(PyObject *self, Py_buffer *view,
int flags)
const);
180 INLINE
const vector_float &get_table()
const;
181 INLINE
void swap_table(vector_float &table);
184 INLINE
void setup_sub_image(
const PfmFile ©,
int &xto,
int &yto,
185 int &xfrom,
int &yfrom,
int &x_size,
int &y_size,
186 int &xmin,
int &ymin,
int &xmax,
int &ymax);
188 void box_filter_region(PN_float32 &result,
189 PN_float32 x0, PN_float32 y0, PN_float32 x1, PN_float32 y1)
const;
190 void box_filter_region(LPoint2f &result,
191 PN_float32 x0, PN_float32 y0, PN_float32 x1, PN_float32 y1)
const;
192 void box_filter_region(LPoint3f &result,
193 PN_float32 x0, PN_float32 y0, PN_float32 x1, PN_float32 y1)
const;
194 void box_filter_region(LPoint4f &result,
195 PN_float32 x0, PN_float32 y0, PN_float32 x1, PN_float32 y1)
const;
196 void box_filter_line(PN_float32 &result, PN_float32 &coverage,
197 PN_float32 x0,
int y, PN_float32 x1, PN_float32 y_contrib)
const;
198 void box_filter_line(LPoint2f &result, PN_float32 &coverage,
199 PN_float32 x0,
int y, PN_float32 x1, PN_float32 y_contrib)
const;
200 void box_filter_line(LPoint3f &result, PN_float32 &coverage,
201 PN_float32 x0,
int y, PN_float32 x1, PN_float32 y_contrib)
const;
202 void box_filter_line(LPoint4f &result, PN_float32 &coverage,
203 PN_float32 x0,
int y, PN_float32 x1, PN_float32 y_contrib)
const;
204 void box_filter_point(PN_float32 &result, PN_float32 &coverage,
205 int x,
int y, PN_float32 x_contrib, PN_float32 y_contrib)
const;
206 void box_filter_point(LPoint2f &result, PN_float32 &coverage,
207 int x,
int y, PN_float32 x_contrib, PN_float32 y_contrib)
const;
208 void box_filter_point(LPoint3f &result, PN_float32 &coverage,
209 int x,
int y, PN_float32 x_contrib, PN_float32 y_contrib)
const;
210 void box_filter_point(LPoint4f &result, PN_float32 &coverage,
211 int x,
int y, PN_float32 x_contrib, PN_float32 y_contrib)
const;
215 MiniGridCell() : _sxi(-1), _syi(-1), _dist(-1) { }
220 void fill_mini_grid(MiniGridCell *mini_grid,
int x_size,
int y_size,
221 int xi,
int yi,
int dist,
int sxi,
int syi)
const;
223 static bool has_point_noop(
const PfmFile *file,
int x,
int y);
224 static bool has_point_1(
const PfmFile *file,
int x,
int y);
225 static bool has_point_2(
const PfmFile *file,
int x,
int y);
226 static bool has_point_3(
const PfmFile *file,
int x,
int y);
227 static bool has_point_4(
const PfmFile *file,
int x,
int y);
228 static bool has_point_threshold_1(
const PfmFile *file,
int x,
int y);
229 static bool has_point_threshold_2(
const PfmFile *file,
int x,
int y);
230 static bool has_point_threshold_3(
const PfmFile *file,
int x,
int y);
231 static bool has_point_threshold_4(
const PfmFile *file,
int x,
int y);
232 static bool has_point_chan4(
const PfmFile *file,
int x,
int y);
233 static bool has_point_nan_1(
const PfmFile *file,
int x,
int y);
234 static bool has_point_nan_2(
const PfmFile *file,
int x,
int y);
235 static bool has_point_nan_3(
const PfmFile *file,
int x,
int y);
236 static bool has_point_nan_4(
const PfmFile *file,
int x,
int y);
239 typedef vector_float Table;
244 bool _has_no_data_value;
245 bool _has_no_data_threshold;
246 LPoint4f _no_data_value;
248 typedef bool HasPointFunc(
const PfmFile *file,
int x,
int y);
249 HasPointFunc *_has_point;