From eba1d5f75d674c7e5b3e59d7b37b4e84b779513d Mon Sep 17 00:00:00 2001 From: dhilvert Date: Sun, 1 Jan 2006 23:06:00 +0000 Subject: [PATCH] Change --dsg back to --dgi. Add options --dgo, --oc, and --no-oc. darcs-hash:20060101230616-789c2-b05f5cc2b6314e8ca0d19ab1ad91004defeba5e5.gz --- ale.cc | 22 +++++++++++++++++----- d3/scene.cc | 4 +++- d3/scene.h | 40 +++++++++++++++++++++++++++++----------- help.h | 5 ++++- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/ale.cc b/ale.cc index fbcc340..fd70622 100644 --- a/ale.cc +++ b/ale.cc @@ -479,6 +479,10 @@ int main(int argc, const char *argv[]){ extend = 1; } else if (!strcmp(argv[i], "--no-mc")) { d2::align::no_mc(); + } else if (!strcmp(argv[i], "--oc")) { + d3::scene::oc(); + } else if (!strcmp(argv[i], "--no-oc")) { + d3::scene::no_oc(); } else if (!strcmp(argv[i], "--gs")) { if (i + 1 >= argc) not_enough("--gs"); @@ -735,14 +739,22 @@ int main(int argc, const char *argv[]){ sscanf(argv[i+1], "%lf", &rc_parameter); i += 1; d3::scene::rc(rc_parameter); - } else if (!strcmp(argv[i], "--dsg")) { + } else if (!strcmp(argv[i], "--dgo")) { if (i + 1 >= argc) - not_enough("--dsg"); + not_enough("--dgo"); - double dsg_parameter; - sscanf(argv[i+1], "%lf", &dsg_parameter); + double dgo_parameter; + sscanf(argv[i+1], "%lf", &dgo_parameter); i += 1; - d3::scene::dsg(dsg_parameter); + d3::scene::dgo(dgo_parameter); + } else if (!strcmp(argv[i], "--dgi")) { + if (i + 1 >= argc) + not_enough("--dgi"); + + double dgi_parameter; + sscanf(argv[i+1], "%lf", &dgi_parameter); + i += 1; + d3::scene::dgi(dgi_parameter); } else if (!strcmp(argv[i], "--fc")) { if (i + 1 >= argc) not_enough("--fc"); diff --git a/d3/scene.cc b/d3/scene.cc index bf189fa..177a197 100644 --- a/d3/scene.cc +++ b/d3/scene.cc @@ -30,7 +30,9 @@ ale_pos scene::perturb; ale_pos scene::edge_cost_multiplier = 0; ale_pos scene::angle_cost_multiplier = 0; ale_pos scene::front_clip = 0; -ale_pos scene::decimation_exponent = 0; +ale_pos scene::input_decimation_exponent = 0; +ale_pos scene::output_decimation_exponent = 0; +int scene::output_clip = 0; ale_pos scene::rear_clip = 0; ale_pos scene::mpl_value = 1; ale_pos scene::mpu_value = 25; diff --git a/d3/scene.h b/d3/scene.h index 6c4163f..f858c43 100644 --- a/d3/scene.h +++ b/d3/scene.h @@ -65,7 +65,13 @@ class scene { /* * Decimation for geometry */ - static ale_pos decimation_exponent; + static ale_pos input_decimation_exponent; + static ale_pos output_decimation_exponent; + + /* + * Output clipping + */ + static int output_clip; /* * Perturb bounds @@ -1052,8 +1058,20 @@ public: front_clip = fc; } - static void dsg(ale_pos _dsg) { - decimation_exponent = _dsg; + static void dgi(ale_pos _dgi) { + input_decimation_exponent = _dgi; + } + + static void dgo(ale_pos _dgo) { + output_decimation_exponent = _dgo; + } + + static void oc() { + output_clip = 1; + } + + static void no_oc() { + output_clip = 0; } static void rc(ale_pos rc) { @@ -1195,7 +1213,7 @@ public: * Scale image structures according to the decimation exponent. */ - ale_pos decimation_index = decimation_exponent; + ale_pos decimation_index = input_decimation_exponent; while (decimation_index > 0 && reduce_lod()) decimation_index -= 1; @@ -1482,7 +1500,7 @@ public: * Get transformation data. */ pt _pt = align::projective(f); - _pt.scale(1 / _pt.scale_2d() / pow(2, ceil(decimation_exponent))); + _pt.scale(1 / _pt.scale_2d() / pow(2, ceil(input_decimation_exponent))); /* * Get color data for the frames. @@ -1492,7 +1510,7 @@ public: assert(im); - ale_pos decimation_index = decimation_exponent; + ale_pos decimation_index = input_decimation_exponent; while (decimation_index > 0 && im->height() > 2 && im->width() > 2) { @@ -2144,7 +2162,7 @@ public: assert(cl->reference[f]); pt _ptf = align::projective(f); - _ptf.scale(1 / _ptf.scale_2d() / pow(2, ceil(decimation_exponent))); + _ptf.scale(1 / _ptf.scale_2d() / pow(2, ceil(input_decimation_exponent))); point p = _ptf.wp_scaled(iw); @@ -2628,7 +2646,7 @@ public: assert(if1); - ale_pos decimation_index = decimation_exponent; + ale_pos decimation_index = input_decimation_exponent; while (decimation_index > 0 && if1->height() > 2 && if1->width() > 2) { @@ -2656,7 +2674,7 @@ public: assert(if2); - ale_pos decimation_index = decimation_exponent; + ale_pos decimation_index = input_decimation_exponent; while (decimation_index > 0 && if2->height() > 2 && if2->width() > 2) { @@ -2677,8 +2695,8 @@ public: pt _pt1 = align::projective(f1); pt _pt2 = align::projective(f2); - _pt1.scale(1 / _pt1.scale_2d() / pow(2, ceil(decimation_exponent))); - _pt2.scale(1 / _pt2.scale_2d() / pow(2, ceil(decimation_exponent))); + _pt1.scale(1 / _pt1.scale_2d() / pow(2, ceil(input_decimation_exponent))); + _pt2.scale(1 / _pt2.scale_2d() / pow(2, ceil(input_decimation_exponent))); /* * Iterate over all points in the primary frame. diff --git a/help.h b/help.h index 399d4e0..2d3c49c 100644 --- a/help.h +++ b/help.h @@ -620,7 +620,10 @@ public: BETWEEN_SECTIONS "Model rules:\n" HEADER_SPACE - "--dsg Decimate scene geometry scale by 2^x [default is 0]\n" + "--dgi Decimate geometry scene inputs by up to 2^x [default is 0]\n" + "--dgo Decimate scene geometry for output by 2^x [default is 0]\n" + "--oc Clip scene to output regions.\n" + "--no-oc Do not clip scene to output regions. [default]\n" "--fc Set front-clip to (0 < x < 1) [default is 0]\n" "--rc Set rear-clip to (1 < x < inf) [default is inf]\n" "--fx Set falloff exponent to [default is 0]\n" -- 2.11.4.GIT