public class DataStoreTransparency extends java.lang.Object implements Transparency, Persistent
Esta clase contiene información de transparencia de un objeto. Los objetos pueden ser dataset, grid u otros. Cuando un usuario quiere añadir nueva información de transparencia crea un objeto de este tipo que debe ser mezclado (merge) con otros objetos de este tipo que existan para la misma fuente de datos.
Un multirasterdatset obtiene los distintos objetos transparency de todos los ficheros que los componen. Para realizar un solo objeto transparency se hará un merge de todos ellos.
Finalmente y antes de renderizar se necesita un objeto Transparency. Este estará compuesto con toda la información de transparencia aplicar, es decir, todos los objetos Transparency mezclados.Transparency con tiene el método de procesado de un pixel. Se le proporciona un pixel y devuelve este mismo pixel con la transparencia aplicada.
Una transparencia que se aplica a un buffer puede tener cuatro procedencias distintas:
| Modifier and Type | Field and Description |
|---|---|
protected ColorInterpretation |
colorInterpretation
Alpha source
|
static int |
MAX_OPACITY |
protected NoData |
noData
Valor de dato transparente.
|
protected int |
opacity
Grado de opacidad de todo el raster
|
protected Buffer |
originalData
Buffer con los datos originales (sin filtrar) correspondiente a la zona a renderizar.
|
protected java.util.List<TransparencyRange> |
transparencyRanges
Rangos de transparencia aplicados.
|
| Constructor and Description |
|---|
DataStoreTransparency() |
DataStoreTransparency(ColorInterpretation colorInterpretation)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
activeTransparency()
Comprueba si hay criterios para la aplicación de transparencia y la activa si es
así sino se desactiva.
|
void |
addPropertyListener(PropertyListener listener)
Asigna un listener a la lista que será informado cuando cambie una
propiedad visual en la renderización.
|
void |
clearListOfTransparencyRange()
Inicializa la lista de rangos de transparencia.
|
Transparency |
cloneTransparency()
Clones this object
|
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
boolean |
existAlphaBand()
Obtiene la información de si existe o no banda de transparencia cuando este
objeto va asociado a un dataset.
|
protected void |
finalize() |
int |
getAlphaBandNumber()
Obtiene la banda de transpareci si existe o -1 si no existe.
|
ColorInterpretation |
getColorInterpretation()
Gets the color interpretation
|
Buffer |
getDataBuffer()
Obtiene el área de datos
|
NoData |
getNoData()
Obtiene el valor noData
|
int |
getOpacity()
Obtiene el grado de opacidad de todo el raster
|
java.util.List<TransparencyRange> |
getTransparencyRange()
Obtiene los rangos de pixels que son transparentes en el raster.
|
protected boolean |
isNoData(int line,
int col)
Consulta si el valor de la posición (line, col) del buffer es considerado
NoData o no.
|
boolean |
isTransparencyActive()
Obtiene el flag de transparencia activa o desactivada.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
static void |
mergeBuffers(Buffer src1,
Buffer src2) |
int |
processRGB(int r,
int g,
int b,
int line,
int col,
Buffer buf)
Aplica las reglas de transparencia a un pixel RGB y devuelve el valor de ese
mismo pixel con la transparencia aplicada.
|
static void |
registerPersistence() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setColorInterpretation(ColorInterpretation colorInterpretation)
Sets the band color interpretation
|
void |
setDataBuffer(Buffer b)
Asigna el área de datos
|
void |
setNoData(NoData noData)
Asigna el valor noData
|
void |
setOpacity(int opacity)
Asigna el grado de opacidad de todo el raster
|
void |
setTransparencyActive(boolean transparencyActive)
Asigna el flag de transparencia activa o desactivada.
|
void |
setTransparencyBand(int alphaBandNumber)
Asigna la información de si existe o no banda de transparencia cuando este
objeto va asociado a un dataset.
|
void |
setTransparencyByPixelFromMetadata(DataStoreMetadata metadata)
Asigna la transparencia a partir de un objeto con los metadatos del raster.
|
void |
setTransparencyRange(TransparencyRange range)
Asigna un rango de pixels que son transparentes en el raster.
|
void |
setTransparencyRangeList(java.util.List<TransparencyRange> ranges)
Asigna la lista de rangos de transparencia
|
public static int MAX_OPACITY
protected ColorInterpretation colorInterpretation
protected Buffer originalData
protected NoData noData
protected java.util.List<TransparencyRange> transparencyRanges
protected int opacity
public DataStoreTransparency()
public DataStoreTransparency(ColorInterpretation colorInterpretation)
public void addPropertyListener(PropertyListener listener)
TransparencyaddPropertyListener in interface Transparencylistener - VisualPropertyListenerpublic boolean existAlphaBand()
TransparencyexistAlphaBand in interface Transparencypublic Buffer getDataBuffer()
getDataBuffer in interface Transparencypublic void setDataBuffer(Buffer b)
TransparencysetDataBuffer in interface Transparencypublic NoData getNoData()
getNoData in interface Transparencypublic void setNoData(NoData noData)
TransparencysetNoData in interface Transparencypublic java.util.List<TransparencyRange> getTransparencyRange()
getTransparencyRange in interface Transparencypublic void setTransparencyRange(TransparencyRange range)
TransparencysetTransparencyRange in interface Transparencypublic void setTransparencyRangeList(java.util.List<TransparencyRange> ranges)
setTransparencyRangeList in interface Transparencyranges - public void clearListOfTransparencyRange()
TransparencyclearListOfTransparencyRange in interface Transparencypublic int getOpacity()
getOpacity in interface Transparencypublic void setOpacity(int opacity)
TransparencysetOpacity in interface Transparencyopacity - valor del grado de opacidad.public void setTransparencyByPixelFromMetadata(DataStoreMetadata metadata)
metadata - public int getAlphaBandNumber()
getAlphaBandNumber in interface Transparencypublic void setTransparencyBand(int alphaBandNumber)
setTransparencyBand in interface Transparencytrue - si existe banda de transparencia y false si no lo es.protected boolean isNoData(int line,
int col)
line - Linea del buffercol - Columna del bufferpublic void activeTransparency()
TransparencyQue haya una mascara de transparencia.
Que exista un buffer de datos para la aplicación de nodata
Que hayan reglas sobre la aplicación de transparencia.
Que la opacidad sea distita de 255 (completamente opaco).
activeTransparency in interface Transparencypublic boolean isTransparencyActive()
TransparencyisTransparencyActive in interface Transparencypublic void setTransparencyActive(boolean transparencyActive)
setTransparencyActive in interface TransparencytransparencyActive - true activa la transparencia false la desactivapublic int processRGB(int r,
int g,
int b,
int line,
int col,
Buffer buf)
TransparencyprocessRGB in interface Transparencypublic void setColorInterpretation(ColorInterpretation colorInterpretation)
TransparencysetColorInterpretation in interface Transparencypublic Transparency cloneTransparency()
TransparencycloneTransparency in interface Transparencypublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentPersistenceExceptionpublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentPersistenceExceptionpublic static void registerPersistence()
public void dispose()
DisposableNOTE:After calling this method, the object may not be usable anymore.
dispose in interface Disposablepublic ColorInterpretation getColorInterpretation()
TransparencygetColorInterpretation in interface Transparencyprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable