.. oe:namespace:: OESystem


.. meta::
   :keywords: OELogarithmicColorGradient, LogarithmicColorGradient


.. _OESystem_OELogarithmicColorGradient:

.. oe:class:: OELogarithmicColorGradient

   .. oe:api::

      class OELogarithmicColorGradient : public OEColorGradientBase

   The :ref:`OELogarithmicColorGradient <OESystem_OELogarithmicColorGradient>` class interpolates
   between colors that are defined by using the OEColorStop class.
   The :oe:meth:`OESystem::OELogarithmicColorGradient::TransformValue` method
   defines the transformation that is performed before returning an
   interpolated color associated with a floating point value.
   The :ref:`Figure: Example of linear and logarithmic color gradients
   <figure_OELogarithmicColorGradient>`
   illustrates the difference between a linear and a logarithmic colors
   gradients constructed with the same color stops.

   .. _figure_OELogarithmicColorGradient:

   .. figure:: ../images/OELogarithmicAndLinearColorGradient.*
      :align:  center

      **Example of linear and logarithmic color gradients** generated with (-4.0, OERed), (0.0,
      OEWhite) and (+4.0, OEBlue) color stops

   .. seealso::

      * :ref:`OEColorStop <OESystem_OEColorStop>` class
      * :ref:`OEExponentColorGradient <OESystem_OEExponentColorGradient>` class
      * :ref:`OEExponentialColorGradient <OESystem_OEExponentialColorGradient>` class
      * :ref:`OELinearColorGradient <OESystem_OELinearColorGradient>` class

   This class represents `OELogarithmicColorGradient`.

   The following methods are publicly inherited from :ref:`OEColorGradientBase <OESystem_OEColorGradientBase>`:

   ======================================================================= ======================================================================= ========================================================================
   :oe:meth:`operator=<OESystem::OEColorGradientBase::operator=>`          :oe:meth:`GetMaxColor<OESystem::OEColorGradientBase::GetMaxColor>`      :oe:meth:`GetStops<OESystem::OEColorGradientBase::GetStops>`            
   :oe:meth:`AddStop<OESystem::OEColorGradientBase::AddStop>`              :oe:meth:`GetMaxValue<OESystem::OEColorGradientBase::GetMaxValue>`      :oe:meth:`IsEmpty<OESystem::OEColorGradientBase::IsEmpty>`              
   :oe:meth:`DeleteStop<OESystem::OEColorGradientBase::DeleteStop>`        :oe:meth:`GetMinColor<OESystem::OEColorGradientBase::GetMinColor>`      :oe:meth:`NumStops<OESystem::OEColorGradientBase::NumStops>`            
   :oe:meth:`GetColorAt<OESystem::OEColorGradientBase::GetColorAt>`        :oe:meth:`GetMinValue<OESystem::OEColorGradientBase::GetMinValue>`      :oe:meth:`TransformValue<OESystem::OEColorGradientBase::TransformValue>`
   ======================================================================= ======================================================================= ========================================================================

   .. ################################################################
      # Constructors
      ################################################################

   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OELogarithmicColorGradient()

      .. oe:language:: python

         .. oe:api:: python

            OELogarithmicColorGradient() -> OELogarithmicColorGradient


      Default constructor that creates an "empty" color gradient.

      .. note::

         An "empty" color gradient always returns the :oe:const:`OEBlack<OESystem::OESystem::OEBlack>`
         color, when calling the :oe:meth:`OESystem::OEColorGradientBase::GetColorAt`,
         the :oe:meth:`OESystem::OEColorGradientBase::GetMinColor` or
         the :oe:meth:`OESystem::OEColorGradientBase::GetMaxColor` methods.


      .. oe:language:: c++ java csharp

         .. oe:api::

            OELogarithmicColorGradient(const OEColorStop& oneStop)

      .. oe:language:: python

         .. oe:api:: python

            OELogarithmicColorGradient(oneStop: OEColorStop) -> OELogarithmicColorGradient

      Creates an :ref:`OELogarithmicColorGradient <OESystem_OELogarithmicColorGradient>` object with
      one color stop. An :ref:`OELogarithmicColorGradient <OESystem_OELogarithmicColorGradient>`
      object that has only one color stop will always return that
      color when calling the
      :oe:meth:`OESystem::OEColorGradientBase::GetColorAt` method.


      .. oe:language:: c++ java csharp

         .. oe:api::

            OELogarithmicColorGradient(const OEColorStop& bgnStop,
                                       const OEColorStop& endStop)

      .. oe:language:: python

         .. oe:api:: python

            OELogarithmicColorGradient(bgnStop: OEColorStop,
                                       endStop: OEColorStop) -> OELogarithmicColorGradient

      Creates an :ref:`OELogarithmicColorGradient <OESystem_OELogarithmicColorGradient>` object with
      interpolation range between the two specified color stops.


      .. oe:language:: c++ java csharp

         .. oe:api::

            OELogarithmicColorGradient(const OELogarithmicColorGradient& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OELogarithmicColorGradient(rhs: OELogarithmicColorGradient) -> OELogarithmicColorGradient

      Copy constructor.


   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OELogarithmicColorGradient &operator=(const OELogarithmicColorGradient &rhs)

      Assignment operator.


   .. oe:method:: TransformValue

      .. oe:language:: c++ java csharp

         .. oe:api::

            double TransformValue(double value) const

      .. oe:language:: python

         .. oe:api:: python

            TransformValue(value: float) -> float

      Performs a
      :math:`f(x) = -log(-x+1.0)` transformation when x is less than 0.0 and
      :math:`f(x) =  log(x+1.0)` transformation when x is greater than 0.0.
      This method is called by :oe:meth:`OESystem::OEColorGradientBase::GetColorAt`
      method to transform a value before performing color interpolation.
