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

Commit 40c43221 authored by Sam Hasinoff's avatar Sam Hasinoff Committed by Android (Google) Code Review
Browse files

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

parents 4354cf89 4d76f123
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();