| 54 | IE_CORE_DEFINERUNTIMETYPED( MedianCutSampler ); |
| 55 | |
| 56 | MedianCutSampler::MedianCutSampler() |
| 57 | : |
| 58 | Op( |
| 59 | "Performs importance sampling of an image.", |
| 60 | new ObjectParameter( "result", |
| 61 | "A CompoundObject containing a vector of areas which cover the image, and all of which " |
| 62 | "represent the same amount of energy, and a vector of weighted centroids of these areas.", |
| 63 | NullObject::defaultNullObject(), |
| 64 | CompoundObject::staticTypeId() |
| 65 | ) |
| 66 | ) |
| 67 | { |
| 68 | m_imageParameter = new ImagePrimitiveParameter( |
| 69 | "image", |
| 70 | "The image to sample from.", |
| 71 | new ImagePrimitive |
| 72 | ); |
| 73 | |
| 74 | m_channelNameParameter = new StringParameter( |
| 75 | "channelName", |
| 76 | "The name of a channel to use when computing the point distribution.", |
| 77 | "Y" |
| 78 | ); |
| 79 | |
| 80 | m_subdivisionDepthParameter = new IntParameter( |
| 81 | "subdivisionDepth", |
| 82 | "The number of times to subdivide the image. This controls how many " |
| 83 | "points will be created.", |
| 84 | 4 |
| 85 | ); |
| 86 | |
| 87 | IntParameter::PresetsContainer projectionPresets; |
| 88 | projectionPresets.push_back( IntParameter::Preset( "rectilinear", Rectilinear ) ); |
| 89 | projectionPresets.push_back( IntParameter::Preset( "latLong", LatLong ) ); |
| 90 | m_projectionParameter = new IntParameter( |
| 91 | "projection", |
| 92 | "The projection the image represents. When in latLong mode the " |
| 93 | "image intensities are weighted to account for pinching towards the ." |
| 94 | "poles, and the splitting criteria is also weighted to account for " |
| 95 | "changing box widths towards the poles.", |
| 96 | 2, |
| 97 | 1, |
| 98 | 2, |
| 99 | projectionPresets, |
| 100 | true |
| 101 | ); |
| 102 | |
| 103 | parameters()->addParameter( m_imageParameter ); |
| 104 | parameters()->addParameter( m_channelNameParameter ); |
| 105 | parameters()->addParameter( m_subdivisionDepthParameter ); |
| 106 | parameters()->addParameter( m_projectionParameter ); |
| 107 | |
| 108 | } |
| 109 | |
| 110 | MedianCutSampler::~MedianCutSampler() |
| 111 | { |