Skip to content

Commit

Permalink
Added methods for future DNGs rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
fkeglevich committed Jan 29, 2019
1 parent ff25cff commit 8eb81b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public int getPhase()
return phase;
}

public int[] getRedPosition()
{
return new int[]{ getR() % 2, getR() / 2 };
}

public BayerPattern invertVertically()
{
switch (this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,19 @@ public void disableRaw()
binningRawImageSizes = new RawImageSize[0];
}

public double[] getSimpleLinFactors()
{
// (x - black) / (white - black)
double delta = ((double) whiteLevel) - blackLevelInfo.defaultValues[0];

double aFactor = 1.0 / delta;
double bFactor = (-blackLevelInfo.defaultValues[0]) / delta;

return new double[] {aFactor, bFactor};
}

public int[] getRedPosition()
{
return bayerPattern.getRedPosition();
}
}

0 comments on commit 8eb81b2

Please sign in to comment.