ReprocessInfo.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Copyright (c) 2022, 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: Reprocessing Information API</b>
  31. *
  32. * @b Description: This file defines the ReprocessInfo.
  33. */
  34. #ifndef _ARGUS_REPROCESS_INFO_H
  35. #define _ARGUS_REPROCESS_INFO_H
  36. namespace Argus
  37. {
  38. /**
  39. * @class IReprocessInfo
  40. *
  41. * Interface used to access reprocess information.
  42. * ReprocessInfo are used to set and access the reprocessing information to run
  43. * camera using a user provided raw buffer instead of physical camera sensor.
  44. *
  45. * @ingroup ArgusCameraDevice ArgusExtReprocessInfo
  46. */
  47. DEFINE_UUID(InterfaceID, IID_REPROCESS_INFO, dbf2b0b0,7f71,11ec,bf44,08,00,20,0c,9a,66);
  48. class IReprocessInfo : public Interface
  49. {
  50. public:
  51. static const InterfaceID& id() { return IID_REPROCESS_INFO; }
  52. /**
  53. * Enable the libargus to run in resprocessing mode.
  54. * @param[in] enable The enable flag to set the reprocesisng mode.
  55. *
  56. * @returns success/status of the call.
  57. */
  58. virtual Status setReprocessingEnable(const bool enable) = 0;
  59. virtual bool getReprocessingEnable() const = 0;
  60. /**
  61. * Sets the resolution of reprocessing sensor mode.
  62. * @param[in] resolution The resolution of reprocessing sensor mode.
  63. *
  64. * @returns success/status of the call.
  65. */
  66. virtual Status setReprocessingModeResolution(const Size2D<uint32_t>& resolution) = 0;
  67. virtual Size2D<uint32_t> getReprocessingModeResolution() const = 0;
  68. /**
  69. * Sets the scaling for reprocessing sensor mode.
  70. * @param[in] scaling The scaling in x and y direction.
  71. *
  72. * @returns success/status of the call.
  73. */
  74. virtual Status setReprocessingModeScaling(const Point2D<float>& scaling) = 0;
  75. virtual Point2D<float> getReprocessingModeScaling() const = 0;
  76. /**
  77. * Sets the crop rectange for the reprocessing sensor mode.
  78. * @param[in] crop The crop rectange for the sensor mode, describing top, left, bottom, down
  79. * coordinates, origin is top left corner of the image.
  80. *
  81. * @returns success/status of the call.
  82. */
  83. virtual Status setReprocessingModeCrop(const Rectangle<float>& crop) = 0;
  84. virtual Rectangle<float> getReprocessingModeCrop() const = 0;
  85. /**
  86. * Sets the frame rate for the reprocessing sensor mode.
  87. * @param[in] framerate The framerate value that will be utilized to decide the output stream
  88. * framerate.
  89. *
  90. * @returns success/status of the call.
  91. */
  92. virtual Status setReprocessingModeFrameRate(const float framerate) = 0;
  93. virtual float getReprocessingModeFrameRate() const = 0;
  94. /**
  95. * Sets the bayer phase for the reprocessing sensor mode.
  96. * @param[in] phase The phase of the raw input data (see Argus::BayerPhase).
  97. *
  98. * @returns success/status of the call.
  99. */
  100. virtual Status setReprocessingModeColorFormat(const BayerPhase& phase) = 0;
  101. virtual BayerPhase getReprocessingModeColorFormat() const = 0;
  102. /**
  103. * Sets the pixel bit depth for the reprocessing sensor mode. This is the bit depth of raw byaer
  104. * data. For PWL HDR raw data it is the pixel bit depth of PWL companded raw data. For DOL raw
  105. * data, it the pixel bit depth of individual exposure plane.
  106. * @param[in] pixelBitDepth The pixelBitDepth is the number of bits used to represent a pixel.
  107. *
  108. * @returns success/status of the call.
  109. */
  110. virtual Status setReprocessingModePixelBitDepth(const uint32_t pixelBitDepth) = 0;
  111. virtual uint32_t getReprocessingModePixelBitDepth() const = 0;
  112. /**
  113. * Sets the total pixel total bit depth for the reprocessing sensor mode after
  114. * decompanding or merging of individual exposure planes incase of PWL HDR or DOL HDR raw data
  115. * respectively. In case of standard dynamic range raw data it will be equal to pixelBitDepth.
  116. *
  117. * @param[in] dynamicPixelBitDepth The dynamicPixelBitDepth of raw sensor data.
  118. *
  119. * @returns success/status of the call.
  120. */
  121. virtual Status setReprocessingModeDynamicPixelBitDepth(const uint32_t dynamicPixelBitDepth) = 0;
  122. virtual uint32_t getReprocessingModeDynamicPixelBitDepth() const = 0;
  123. protected:
  124. ~IReprocessInfo() {}
  125. };
  126. } // namespace Argus
  127. #endif // _ARGUS_REPROCESS_INFO_H