Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca222320 authored by Sam Hasinoff's avatar Sam Hasinoff Committed by android-build-merger
Browse files

Merge "Fix sample spacing in lens shading map saved to DNG" into pi-dev

am: 40c43221

Change-Id: Ica595b0d636779991c5148011e6b8261aef68a5f
parents 2c4019fa 40c43221
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <inttypes.h>

#include <algorithm>
#include <vector>
#include <math.h>

@@ -61,8 +62,8 @@ status_t OpcodeListBuilder::addGainMapsForMetadata(uint32_t lsmWidth,
                                                   const float* lensShadingMap) {
    uint32_t activeAreaWidth = activeAreaRight - activeAreaLeft;
    uint32_t activeAreaHeight = activeAreaBottom - activeAreaTop;
    double spacingV = 1.0 / lsmHeight;
    double spacingH = 1.0 / lsmWidth;
    double spacingV = 1.0 / std::max(1u, lsmHeight - 1);
    double spacingH = 1.0 / std::max(1u, lsmWidth - 1);

    std::vector<float> redMapVector(lsmWidth * lsmHeight);
    float *redMap = redMapVector.data();