From: wolf Date: Fri, 24 Aug 2001 14:34:18 +0000 (+0000) Subject: reverse_grey_scale_color_function X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bad4969ce2ef3170e77f3886503823952cf2d88;p=dealii-svn.git reverse_grey_scale_color_function git-svn-id: https://svn.dealii.org/trunk@4911 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/data_out_base.h b/deal.II/base/include/base/data_out_base.h index 1d9ff22c20..32840acbdc 100644 --- a/deal.II/base/include/base/data_out_base.h +++ b/deal.II/base/include/base/data_out_base.h @@ -890,6 +890,24 @@ class DataOutBase const double min_value, const double max_value); + /** + * This is one more + * alternative color function + * producing a grey scale + * between white (lowest + * values) and black (highest + * values), i.e. the scale is + * reversed to the previous + * one. You may use it by + * setting the + * @p{color_function} + * variable to the address of + * this function. + */ + static RgbValues reverse_grey_scale_color_function (const double value, + const double min_value, + const double max_value); + /** * Constructor. */ diff --git a/deal.II/base/source/data_out_base.all_dimensions.cc b/deal.II/base/source/data_out_base.all_dimensions.cc index 395f2970fe..4604412c0b 100644 --- a/deal.II/base/source/data_out_base.all_dimensions.cc +++ b/deal.II/base/source/data_out_base.all_dimensions.cc @@ -222,6 +222,7 @@ DataOutBase::EpsFlags::default_color_function (const double x, }; + DataOutBase::EpsFlags::RgbValues DataOutBase::EpsFlags::grey_scale_color_function (const double x, const double xmin, @@ -235,6 +236,19 @@ DataOutBase::EpsFlags::grey_scale_color_function (const double x, +DataOutBase::EpsFlags::RgbValues +DataOutBase::EpsFlags::reverse_grey_scale_color_function (const double x, + const double xmin, + const double xmax) +{ + DataOutBase::EpsFlags::RgbValues rgb_values; + rgb_values.red = rgb_values.blue = rgb_values.green + = 1-(x-xmin)/(xmax-xmin); + return rgb_values; +}; + + + bool DataOutBase::EpsCell2d::operator < (const EpsCell2d &e) const { // note the "wrong" order in diff --git a/deal.II/doc/news/2001/c-3-1.html b/deal.II/doc/news/2001/c-3-1.html index ef7d213ef1..f4963f8afd 100644 --- a/deal.II/doc/news/2001/c-3-1.html +++ b/deal.II/doc/news/2001/c-3-1.html @@ -158,6 +158,12 @@ documentation, etc.

base

    +
  1. + New: Color function DataOutBase::EpsFlags::reverse_grey_scale_color_function. +
    + (WB 2001/08/24) +

  2. New: Function QProjector::project_to_child generates quadrature formulae which act on the area which a @@ -200,7 +206,6 @@ documentation, etc.
    (GK 2001/05/17) -

  3. New: There is now a new AutoDerivativeFunction class that