App
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
mhr.appcore.pointops.LUT Class Reference

Public Member Functions

void dispose ()
 
long getAdress ()
 
int fillBrightnessLut (double bias) throws AlreadyDisposedException
 
int fillContrastLut (double bias) throws AlreadyDisposedException
 
int fillGammaLut (double gamma) throws AlreadyDisposedException
 
int fillCurvesLut (float[][] M, float[][]R, float[][]G, float[][]B, float[][]A) throws AlreadyDisposedException
 
int applyTo (NBitmap dst, Rect dstRect, double opacity) throws IllegalArgumentException, AlreadyDisposedException
 
int applyTo (NBitmap dst, NBitmap msk, Rect mskRect, int mskOrigX, int mskOrigY, double opacity) throws IllegalArgumentException, AlreadyDisposedException
 

Static Public Member Functions

static LUT createEmptyLut ()
 
static LUT getBrightnessLut (double bias) throws LUTAllocationException
 
static LUT getContrastLut (double bias) throws LUTAllocationException
 
static LUT getGammaLut (double gamma) throws LUTAllocationException
 
static LUT getCurvesLut (float[][] M, float[][]R, float[][]G, float[][]B, float[][]A) throws LUTAllocationException
 

Static Public Attributes

static final double opacityAsFul = 0.9999
 
static final double opacityAsNone = 0.0001
 

Protected Member Functions

void finalize () throws Throwable
 
 LUT ()
 

Static Protected Member Functions

static double[][] toDoubleArray (float[][] a)
 
static native long createLut ()
 
static native int disposeLut (long adress)
 
static native long createBrightnessLut (double bias)
 
static native long createContrastLut (double bias)
 
static native long createGammaLut (double gamma)
 
static native long createCurvesLut (double[] xM, double[] yM, int cM, double[] xR, double[] yR, int cR, double[] xG, double[] yG, int cG, double[] xB, double[] yB, int cB, double[] xA, double[] yA, int cA)
 
static native int fillBrightnessLut (long lutAdress, double bias)
 
static native int fillContrastLut (long lutAdress, double bias)
 
static native int fillGammaLut (long lutAdress, double gamma)
 
static native int fillCurvesLut (long lutAdress, double[] xM, double[] yM, int cM, double[] xR, double[] yR, int cR, double[] xG, double[] yG, int cG, double[] xB, double[] yB, int cB, double[] xA, double[] yA, int cA)
 
static native int applyTo (long lutAdress, long dstAdress, int dstTlx, int dstTly, int dstBrX, int dstBrY)
 
static native int applyTo (long lutAdress, long dstAdress, int dstTlx, int dstTly, int dstBrX, int dstBrY, double alpha)
 
static native int applyTo (long lutAdress, long dstAdress, long mskAdress, int mskTlx, int mskTly, int mskBrx, int mskBry, int mskOrigX, int mskOrigY)
 
static native int applyTo (long lutAdress, long dstAdress, long mskAdress, int mskTlx, int mskTly, int mskBrx, int mskBry, int mskOrigX, int mskOrigY, double alpha)
 

Protected Attributes

long adress = 0x0
 

Detailed Description

Definition at line 12 of file LUT.java.

Constructor & Destructor Documentation

mhr.appcore.pointops.LUT.LUT ( )
inlineprotected

Definition at line 34 of file LUT.java.

{
}

Member Function Documentation

static native int mhr.appcore.pointops.LUT.applyTo ( long  lutAdress,
long  dstAdress,
int  dstTlx,
int  dstTly,
int  dstBrX,
int  dstBrY 
)
staticprotected
static native int mhr.appcore.pointops.LUT.applyTo ( long  lutAdress,
long  dstAdress,
int  dstTlx,
int  dstTly,
int  dstBrX,
int  dstBrY,
double  alpha 
)
staticprotected
static native int mhr.appcore.pointops.LUT.applyTo ( long  lutAdress,
long  dstAdress,
long  mskAdress,
int  mskTlx,
int  mskTly,
int  mskBrx,
int  mskBry,
int  mskOrigX,
int  mskOrigY 
)
staticprotected
static native int mhr.appcore.pointops.LUT.applyTo ( long  lutAdress,
long  dstAdress,
long  mskAdress,
int  mskTlx,
int  mskTly,
int  mskBrx,
int  mskBry,
int  mskOrigX,
int  mskOrigY,
double  alpha 
)
staticprotected
int mhr.appcore.pointops.LUT.applyTo ( NBitmap  dst,
Rect  dstRect,
double  opacity 
) throws IllegalArgumentException, AlreadyDisposedException
inline

Definition at line 186 of file LUT.java.

{
if (opacity < opacityAsNone) {
return 0;
}
if (adress == 0) {
throw new AlreadyDisposedException("LUT was already disposed");
}
BitmapInfo dstInfo = dst.getInfo();
if (dstInfo.channelCount == ChannelCount.FOUR_CHANNEL) {
if (opacity < opacityAsFul) {
return applyTo(adress, dst.getAdress(), dstRect.tlx, dstRect.tly, dstRect.brx, dstRect.bry, opacity);
} else {
return applyTo(adress, dst.getAdress(), dstRect.tlx, dstRect.tly, dstRect.brx, dstRect.bry);
}
} else {
throw new IllegalArgumentException("Operation is not applicable to supplied bitmap.");
}
}
int mhr.appcore.pointops.LUT.applyTo ( NBitmap  dst,
NBitmap  msk,
Rect  mskRect,
int  mskOrigX,
int  mskOrigY,
double  opacity 
) throws IllegalArgumentException, AlreadyDisposedException
inline

Definition at line 205 of file LUT.java.

{
if (opacity < opacityAsNone) {
return 0;
}
if (adress == 0) {
throw new AlreadyDisposedException("LUT was already disposed");
}
BitmapInfo dstInfo = dst.getInfo();
BitmapInfo mskInfo = msk.getInfo();
if (dstInfo.channelCount == ChannelCount.FOUR_CHANNEL && mskInfo.channelCount == ChannelCount.SINGLE_CHANNEL) {
if (opacity < opacityAsFul) {
return applyTo(adress, dst.getAdress(), msk.getAdress(), mskRect.tlx, mskRect.tly, mskRect.brx, mskRect.bry, mskOrigX, mskOrigY, opacity);
} else {
return applyTo(adress, dst.getAdress(), msk.getAdress(), mskRect.tlx, mskRect.tly, mskRect.brx, mskRect.bry, mskOrigX, mskOrigY);
}
} else {
throw new IllegalArgumentException("Operation is not applicable to supplied bitmap.");
}
}
static native long mhr.appcore.pointops.LUT.createBrightnessLut ( double  bias)
staticprotected
static native long mhr.appcore.pointops.LUT.createContrastLut ( double  bias)
staticprotected
static native long mhr.appcore.pointops.LUT.createCurvesLut ( double[]  xM,
double[]  yM,
int  cM,
double[]  xR,
double[]  yR,
int  cR,
double[]  xG,
double[]  yG,
int  cG,
double[]  xB,
double[]  yB,
int  cB,
double[]  xA,
double[]  yA,
int  cA 
)
staticprotected
static LUT mhr.appcore.pointops.LUT.createEmptyLut ( )
inlinestatic

Definition at line 40 of file LUT.java.

{
LUT retVal = new LUT();
retVal.adress = createLut();
if (retVal.adress == 0) {
throw new LUTAllocationException("Could not allocate LUT");
}
return retVal;
}
static native long mhr.appcore.pointops.LUT.createGammaLut ( double  gamma)
staticprotected
static native long mhr.appcore.pointops.LUT.createLut ( )
staticprotected
void mhr.appcore.pointops.LUT.dispose ( )
inline

Definition at line 96 of file LUT.java.

{
if (adress != 0) {
adress = 0;
}
}
static native int mhr.appcore.pointops.LUT.disposeLut ( long  adress)
staticprotected
static native int mhr.appcore.pointops.LUT.fillBrightnessLut ( long  lutAdress,
double  bias 
)
staticprotected
int mhr.appcore.pointops.LUT.fillBrightnessLut ( double  bias) throws AlreadyDisposedException
inline

Definition at line 148 of file LUT.java.

{
if (adress == 0) {
throw new AlreadyDisposedException("LUT was already disposed");
}
return fillBrightnessLut(adress, bias);
}
static native int mhr.appcore.pointops.LUT.fillContrastLut ( long  lutAdress,
double  bias 
)
staticprotected
int mhr.appcore.pointops.LUT.fillContrastLut ( double  bias) throws AlreadyDisposedException
inline

Definition at line 155 of file LUT.java.

{
if (adress == 0) {
throw new AlreadyDisposedException("LUT was already disposed");
}
return fillContrastLut(adress, bias);
}
static native int mhr.appcore.pointops.LUT.fillCurvesLut ( long  lutAdress,
double[]  xM,
double[]  yM,
int  cM,
double[]  xR,
double[]  yR,
int  cR,
double[]  xG,
double[]  yG,
int  cG,
double[]  xB,
double[]  yB,
int  cB,
double[]  xA,
double[]  yA,
int  cA 
)
staticprotected
int mhr.appcore.pointops.LUT.fillCurvesLut ( float  M[][],
floatR  [][],
floatG  [][],
floatB  [][],
floatA  [][] 
) throws AlreadyDisposedException
inline

Definition at line 168 of file LUT.java.

{
if (adress == 0) {
throw new AlreadyDisposedException("LUT was already disposed");
}
double[][] MM = toDoubleArray(M);
double[][] RR = toDoubleArray(R);
double[][] GG = toDoubleArray(G);
double[][] BB = toDoubleArray(B);
double[][] AA = toDoubleArray(A);
MM[0], MM[1], MM[0].length,
RR[0], RR[1], RR[0].length,
GG[0], GG[1], GG[0].length,
BB[0], BB[1], BB[0].length,
AA[0], AA[1], AA[0].length);
}
static native int mhr.appcore.pointops.LUT.fillGammaLut ( long  lutAdress,
double  gamma 
)
staticprotected
int mhr.appcore.pointops.LUT.fillGammaLut ( double  gamma) throws AlreadyDisposedException
inline

Definition at line 161 of file LUT.java.

{
if (adress == 0) {
throw new AlreadyDisposedException("LUT was already disposed");
}
return fillGammaLut(adress, gamma);
}
void mhr.appcore.pointops.LUT.finalize ( ) throws Throwable
inlineprotected

Definition at line 29 of file LUT.java.

{
super.finalize();
}
long mhr.appcore.pointops.LUT.getAdress ( )
inline

Definition at line 143 of file LUT.java.

{
return adress;
}
static LUT mhr.appcore.pointops.LUT.getBrightnessLut ( double  bias) throws LUTAllocationException
inlinestatic

Definition at line 49 of file LUT.java.

{
LUT retVal = new LUT();
retVal.adress = createBrightnessLut(bias);
if (retVal.adress == 0) {
throw new LUTAllocationException("Could not allocate LUT");
}
return retVal;
}
static LUT mhr.appcore.pointops.LUT.getContrastLut ( double  bias) throws LUTAllocationException
inlinestatic

Definition at line 58 of file LUT.java.

{
LUT retVal = new LUT();
retVal.adress = createContrastLut(bias);
if (retVal.adress == 0) {
throw new LUTAllocationException("Could not allocate LUT");
}
return retVal;
}
static LUT mhr.appcore.pointops.LUT.getCurvesLut ( float  M[][],
floatR  [][],
floatG  [][],
floatB  [][],
floatA  [][] 
) throws LUTAllocationException
inlinestatic

Definition at line 76 of file LUT.java.

{
LUT retVal = new LUT();
double[][] MM = toDoubleArray(M);
double[][] RR = toDoubleArray(R);
double[][] GG = toDoubleArray(G);
double[][] BB = toDoubleArray(B);
double[][] AA = toDoubleArray(A);
retVal.adress = createCurvesLut(
MM[0], MM[1], MM[0].length,
RR[0], RR[1], RR[0].length,
GG[0], GG[1], GG[0].length,
BB[0], BB[1], BB[0].length,
AA[0], AA[1], AA[0].length);
if (retVal.adress == 0) {
throw new LUTAllocationException("Could not allocate LUT");
}
return retVal;
}
static LUT mhr.appcore.pointops.LUT.getGammaLut ( double  gamma) throws LUTAllocationException
inlinestatic

Definition at line 67 of file LUT.java.

{
LUT retVal = new LUT();
retVal.adress = createGammaLut(gamma);
if (retVal.adress == 0) {
throw new LUTAllocationException("Could not allocate LUT");
}
return retVal;
}
static double [][] mhr.appcore.pointops.LUT.toDoubleArray ( float  a[][])
inlinestaticprotected

Definition at line 105 of file LUT.java.

{
double[][] r = new double[2][a[0].length];
for (int i = 0; i < a[0].length; i++) {
r[0][i] = a[0][i];
r[1][i] = a[1][i];
}
return r;
}

Member Data Documentation

long mhr.appcore.pointops.LUT.adress = 0x0
protected

Definition at line 20 of file LUT.java.

final double mhr.appcore.pointops.LUT.opacityAsFul = 0.9999
static

Definition at line 22 of file LUT.java.

final double mhr.appcore.pointops.LUT.opacityAsNone = 0.0001
static

Definition at line 23 of file LUT.java.


The documentation for this class was generated from the following file: