Skip to content

Commit

Permalink
Make default behavior follow previous implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Oct 3, 2015
1 parent 1dfbe9e commit f15d87c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions doc/stages/filters.colorization.rst
Expand Up @@ -44,8 +44,7 @@ dimensions
Either or both of band number and scale factor may be omitted as may ':'
separators if the data is not ambiguous. If not supplied, band numbers
begin at 1 and increment from the band number of the previous dimension.
If not supplied, the scaling factor is 1.0. If fewer than three dimensions
are supplied, the defaults are applied where appropriate.
If not supplied, the scaling factor is 1.0.
[Default: "Red:1:1.0, Green:2:1.0, Blue:3:1.0"]

.. _GDAL: http://gdal.org
13 changes: 7 additions & 6 deletions filters/colorization/ColorizationFilter.cpp
Expand Up @@ -149,19 +149,20 @@ void ColorizationFilter::processOptions(const Options& options)
throw pdal_error("Option 'dimension' no longer supported. Use "
"'dimensions' instead.");

StringList dims = options.getValueOrDefault<StringList>("dimensions");
StringList defaultDims;
defaultDims.push_back("Red");
defaultDims.push_back("Green");
defaultDims.push_back("Blue");

m_bands.emplace_back("Red", 1, 1.0);
m_bands.emplace_back("Green", 2, 1.0);
m_bands.emplace_back("Blue", 3, 1.0);
StringList dims =
options.getValueOrDefault<StringList>("dimensions", defaultDims);

size_t i = 0;
uint32_t defaultBand = 1;
for (std::string& dim : dims)
{
BandInfo bi = parseDim(dim, defaultBand);
defaultBand = bi.m_band + 1;
m_bands[i++] = bi;
m_bands.push_back(bi);
}
}

Expand Down

0 comments on commit f15d87c

Please sign in to comment.