Skip to content

Commit 692d0d6

Browse files
naushirkbingham
authored andcommitted
ipa: rpi: awb: Add a const for the default colour temperature
A default CT of 4500K is used in a couple of places. Add a constexpr value for the default CT value and use it instead. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
1 parent 3513db6 commit 692d0d6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ipa/rpi/controller/rpi/awb.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ using namespace libcamera;
2121

2222
LOG_DEFINE_CATEGORY(RPiAwb)
2323

24+
constexpr double kDefaultCT = 4500.0;
25+
2426
#define NAME "rpi.awb"
2527

2628
/*
@@ -215,7 +217,7 @@ void Awb::initialise()
215217
syncResults_.gainB = 1.0 / config_.ctB.eval(syncResults_.temperatureK);
216218
} else {
217219
/* random values just to stop the world blowing up */
218-
syncResults_.temperatureK = 4500;
220+
syncResults_.temperatureK = kDefaultCT;
219221
syncResults_.gainR = syncResults_.gainG = syncResults_.gainB = 1.0;
220222
}
221223
prevSyncResults_ = syncResults_;
@@ -717,7 +719,11 @@ void Awb::awbGrey()
717719
sumR += *ri, sumB += *bi;
718720
double gainR = sumR.G / (sumR.R + 1),
719721
gainB = sumB.G / (sumB.B + 1);
720-
asyncResults_.temperatureK = 4500; /* don't know what it is */
722+
/*
723+
* The grey world model can't estimate the colour temperature, use a
724+
* default value.
725+
*/
726+
asyncResults_.temperatureK = kDefaultCT;
721727
asyncResults_.gainR = gainR;
722728
asyncResults_.gainG = 1.0;
723729
asyncResults_.gainB = gainB;

0 commit comments

Comments
 (0)