|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.data.images.BlendComposite.BlendingContext
protected class BlendComposite.BlendingContext
Abstract blending context that takes care of color space conversion and pixel iteration. The base class does simple replacing.
Field Summary | |
---|---|
protected double |
alpha
Opacity factor |
private ColorModel |
dstColorModel
Destination color model |
protected double |
ialpha
Additive inverse of alpha value. |
private ColorModel |
srcColorModel
Source color model |
Constructor Summary | |
---|---|
protected |
BlendComposite.BlendingContext(ColorModel srcColorModel,
ColorModel dstColorModel,
double alpha)
Constructor. |
Method Summary | |
---|---|
protected int |
blend(int sA,
int sR,
int sG,
int sB,
int dA,
int dR,
int dG,
int dB)
The actual blending function for two colors. |
void |
compose(Raster src,
Raster dstIn,
WritableRaster dstOut)
Compose a raster image (source) and a background (destination) to a result raster. |
void |
dispose()
|
protected int |
mixAlpha(int nA,
int nR,
int nG,
int nB,
int dA,
int dR,
int dG,
int dB)
Mix the new values with the original values taking the alpha value into account. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ColorModel srcColorModel
private ColorModel dstColorModel
protected double alpha
protected double ialpha
Constructor Detail |
---|
protected BlendComposite.BlendingContext(ColorModel srcColorModel, ColorModel dstColorModel, double alpha)
srcColorModel
- source color modeldstColorModel
- destination color modelalpha
- Alpha (opacity) factorMethod Detail |
---|
public void dispose()
dispose
in interface CompositeContext
public void compose(Raster src, Raster dstIn, WritableRaster dstOut)
compose
in interface CompositeContext
protected int blend(int sA, int sR, int sG, int sB, int dA, int dR, int dG, int dB)
sA
- source alpha component (0-255)sR
- source red component (0-255)sG
- source green component (0-255)sB
- source blue component (0-255)dA
- destination alpha component (0-255)dR
- destination red component (0-255)dG
- destination green component (0-255)dB
- destination blues component (0-255)
BlendComposite.combineComponents(int, int, int, int)
and mixAlpha(int, int, int, int, int, int, int, int)
helper functions)protected int mixAlpha(int nA, int nR, int nG, int nB, int dA, int dR, int dG, int dB)
nA
- new alpha component (0-255)nR
- new red component (0-255)nG
- new green component (0-255)nB
- new blue component (0-255)dA
- old alpha component (0-255)dR
- old red component (0-255)dG
- old green component (0-255)dB
- old blue component (0-255)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |