PwlWdrSensorMode.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of NVIDIA CORPORATION nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  20. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  24. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  26. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. /**
  29. * @file
  30. * <b>Libargus Extension: Piecewise Linear Compression for WDR Sensor Modes</b>
  31. *
  32. * @b Description: Adds extra functionalities for the
  33. * Piecewise Linear (PWL) compressed Wide Dynamic Range (WDR) sensor mode type.
  34. */
  35. #ifndef _ARGUS_EXT_PWL_WDR_SENSOR_MODE_H
  36. #define _ARGUS_EXT_PWL_WDR_SENSOR_MODE_H
  37. namespace Argus
  38. {
  39. /**
  40. * Adds extra functionalities for the Piecewise Linear (PWL) Wide Dynamic
  41. * Range (WDR) sensor mode type. It introduces one new interface:
  42. * - Ext::IPwlWdrSensorMode; returns a list of normalized float coordinates (x,y) that define
  43. * the PWL compression curve used in the PWL WDR mode. This PWL compression
  44. * curve is used by the sensor to compress WDR pixel values before sending
  45. * them over CSI. This is done to save bandwidth for data transmission over
  46. * VI-CSI. The compression converts the WDR pixel values from InputBitDepth
  47. * space to OutputBitDepth space.The coordinates of the PWL compression
  48. * curve can be un-normalized by scaling x-axis and y-axis values
  49. * by InputBitDepth and OutputBitDepth respectively. The Bit depths can be
  50. * obtained by using the respective methods in the ISensorMode interface.
  51. * @see ISensorMode
  52. *
  53. * @defgroup ArgusExtPwlWdrSensorMode Ext::PwlWdrSensorMode
  54. * @ingroup ArgusExtensions
  55. */
  56. DEFINE_UUID(ExtensionName, EXT_PWL_WDR_SENSOR_MODE, 7f510b90,582b,11e6,bbb5,40,16,7e,ab,86,92);
  57. namespace Ext
  58. {
  59. /**
  60. * @class IPwlWdrSensorMode
  61. *
  62. * Interface to the properties of a PWL WDR device.
  63. *
  64. * Returns a list of normalized float coordinates (x,y) that define
  65. * the Piecewise Linear (PWL) compression curve used in the PWL Wide Dynamic Range (WDR) mode.
  66. * The coordinates are returned in a Point2D tuple. The coordinates
  67. * can be un-normalized by scaling x-axis and y-axis values by InputBitDepth
  68. * and OutputBitDepth respectively. The Bit depths can be obtained by using
  69. * the respective methods in the ISensorMode interface.
  70. * @see ISensorMode
  71. *
  72. * @ingroup ArgusSensorMode ArgusExtPwlWdrSensorMode
  73. */
  74. DEFINE_UUID(InterfaceID, IID_PWL_WDR_SENSOR_MODE, 7f5acea0,582b,11e6,9414,40,16,7e,ab,86,92);
  75. class IPwlWdrSensorMode : public Interface
  76. {
  77. public:
  78. static const InterfaceID& id() { return IID_PWL_WDR_SENSOR_MODE; }
  79. /**
  80. * Returns the number of control points coordinates in the Piecewise Linear compression
  81. * curve.
  82. */
  83. virtual uint32_t getControlPointCount() const = 0;
  84. /**
  85. * Returns the Piecewise Linear (PWL) compression curve coordinates.
  86. *
  87. * @param[out] points The output vector to store the PWL compression curve coordinates.
  88. * Upon successful return, this vector will filled in with
  89. * getControlPointCount() count values, each containing a coordinates of
  90. * PWL compression curve within a Point2D tuple.
  91. */
  92. virtual Status getControlPoints(std::vector< Point2D<float> >* points) const = 0;
  93. protected:
  94. ~IPwlWdrSensorMode() {}
  95. };
  96. } // namespace Ext
  97. } // namespace Argus
  98. #endif // _ARGUS_EXT_PWL_WDR_SENSOR_MODE_H