|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Client.ClientLogicalTarget.ClientLogicalTarget
CADI.Client.ClientLogicalTarget.JPEG2000.JPEG2KLogicalTarget
public class JPEG2KLogicalTarget
This class implements a JPEG2000 decoder.
NOTE: this class will be implemented as a thread.
| Field Summary | |
|---|---|
private int[] |
blockHeights
Definition in CODParameters.blockHeights |
private int[][] |
blocksPerPrecinctHeights
Definition in GenerateImageStructure.blocksPerPrecinctHeights. |
private int[][] |
blocksPerPrecinctWidths
Definition in GenerateImageStructure.blocksPerPrecinctWidths. |
private int[] |
blockWidths
Definition in CODParameters.blockWidths |
private java.awt.image.BufferedImage |
bufferedImage
Definition in ImageData.bufImage. |
private ClientCacheManagement |
clientCache
Is a reference to the client cache object for the actual logical target. |
private float[] |
fImagePixels
|
private float[][][] |
imageSamplesFloat
Definition in ImageData.imageSamplesFloat. |
private BufferedDataInputStream |
in
Temporal buffer. |
private long |
initStageTime
Used for verbose information (time for stage). |
private long |
initTime
Used for verbose information (total time). |
private boolean |
isMainHeaderDecoded
Indicates if the main header has been decoded. |
private JPCParameters |
jpcParameters
It is the JPEG2000 image parameters. |
private JPEG2KDecoder |
jpeg2kDecoder
This object is used to decode a JPEG2000 codestream. |
private int |
maxLayer
Is the highest quality layer |
private PacketHeadersDecoder |
packetHeadersDecoder
Definition in PacketHeadersDecoder |
private int[][] |
precinctHeights
Definition in CODParameters.precinctHeights |
private java.util.Hashtable<java.lang.Long,ByteStream[][][][]> |
precinctsByteStreams
Is a table where byte arrays of coding passes will be record after being read from the cache to be passed to the decompression module |
private int[][] |
precinctWidths
Definition in CODParameters.precinctWidths |
private int |
TileXSize
Definition in SIZParameters.XTsize |
private int |
TileYSize
Definition in SIZParameters.YTsize |
private ViewWindowField |
viewWindow
Contains the last view window of the image decompressed. |
private int[] |
WTLevels
Definition in CODParameters.WTLevels |
private int[] |
WTTypes
Definition in CODParameters.WTTypes |
private int |
XOsize
Definition in SIZParameters.XOsize |
private int |
YOsize
Definition in SIZParameters.YOsize |
private java.util.Hashtable<java.lang.Long,int[][][]> |
zeroBitPlanes
Is a table where will be record the number of zero bit planes por each block |
| Fields inherited from class CADI.Client.ClientLogicalTarget.ClientLogicalTarget |
|---|
components, imageData, imageDataType, initialized, log, logicalTargetType, maxComponents, target, tid, xSize, ySize, zSize |
| Constructor Summary | |
|---|---|
JPEG2KLogicalTarget(ImageData imageData)
Constructor. |
|
| Method Summary | |
|---|---|
private ViewWindowField |
calculateWOIToDecode(ViewWindowField requestViewWindow,
ViewWindowField responseViewWindow)
This function calculates the view window which will be decoded taken into account the requested view window (provided by the user application) and the response view window (sent by the server). |
void |
decode(ViewWindowField requestViewWindow,
ImageData dstImageData)
This method must implement the decode engine of the logical target. |
void |
decode(ViewWindowField requestViewWindow,
ViewWindowField responseViewWindow,
ImageData dstImageData)
This method must implement the decode engine of the logical target. |
private boolean |
decodeMainHeader()
Decodes the image main header. |
int[] |
getFrameSize(int resolutionLevel)
Returns the frame size of the resolution level specified. |
int[][] |
getFrameSizes()
Returns all available frame sizes. |
JPCParameters |
getJPCParameters()
Returns the JPC parameters. |
java.lang.String |
getLogicalTargetDescription()
This method gets a description of the logical target. |
int |
getMaxLayers()
Returns the maximum number of layers. |
int |
getMaxResolutionLevels()
Returns the maximum number of resolution levels. |
int[][] |
getRelevantComponents(int[][] comps)
Calculates which are the necessary components to invert a multiple component transformation. |
private java.awt.image.BufferedImage |
imageSamplesToBufferedImage(float[][][] imageSamplesFloat)
NOTE: this is a temporary method to convert from a three dimensional array representation to a bufferered image representation. |
boolean |
isMultiComponentTransform()
Check if the logical target has a multiple component transformation. |
void |
list(java.io.PrintStream out)
Prints this JPEG2KLogicaltarget's fields to the specified output stream. |
private static void |
printByteArray(BufferedDataInputStream in,
long iniPos,
long finalPos)
|
private static void |
printByteStream(ByteStream byteStream)
Useful method for printing out a ByteStream. |
private void |
printPrecinctsByteStreams(java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams)
|
private void |
readRelevantPrecincts(java.util.ArrayList<java.lang.Long> relevantPrecincts)
Reads the data from the relevant precincts. |
void |
setCache(ClientCacheManagement clientCache)
Sets the client cache for this logical target. |
private void |
showTimeMemory(java.lang.String stage)
Show some time and memory usage statisticals. |
java.lang.String |
toString()
|
| Methods inherited from class CADI.Client.ClientLogicalTarget.ClientLogicalTarget |
|---|
getHeight, getImageData, getLogicalTargetType, getMaxComponents, getTarget, getTID, getWidth, isInitialized, setLog, setLogicalTargetType, setTarget, setTID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private ViewWindowField viewWindow
private ClientCacheManagement clientCache
private JPCParameters jpcParameters
private int YOsize
SIZParameters.YOsize
private int XOsize
SIZParameters.XOsize
private int TileYSize
SIZParameters.YTsize
private int TileXSize
SIZParameters.XTsize
private int[] WTTypes
CODParameters.WTTypes
private int[] WTLevels
CODParameters.WTLevels
private int[] blockHeights
CODParameters.blockHeights
private int[] blockWidths
CODParameters.blockWidths
private int[][] precinctHeights
CODParameters.precinctHeights
private int[][] precinctWidths
CODParameters.precinctWidths
private java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams
JPIPMessageHeader.inClassIdentifier).
- The value for each hash-table entry is a multi-array of ByteStreams
where indices mean:
private java.util.Hashtable<java.lang.Long,int[][][]> zeroBitPlanes
JPIPMessageHeader.inClassIdentifier).
- The value for each hash-table entry is a multi-dimensional array of
integer values. Indexes mean:
private int[][] blocksPerPrecinctWidths
GenerateImageStructure.blocksPerPrecinctWidths.
private int[][] blocksPerPrecinctHeights
GenerateImageStructure.blocksPerPrecinctHeights.
private PacketHeadersDecoder packetHeadersDecoder
PacketHeadersDecoder
private boolean isMainHeaderDecoded
private int maxLayer
private JPEG2KDecoder jpeg2kDecoder
private float[][][] imageSamplesFloat
ImageData.imageSamplesFloat.
Temporal structure.
private BufferedDataInputStream in
private java.awt.image.BufferedImage bufferedImage
ImageData.bufImage.
Temporal structure.
private float[] fImagePixels
private long initStageTime
0 is initial time.
private long initTime
0 is initial time.
| Constructor Detail |
|---|
public JPEG2KLogicalTarget(ImageData imageData)
imageData - | Method Detail |
|---|
public void setCache(ClientCacheManagement clientCache)
ClientLogicalTarget
setCache in class ClientLogicalTargetclientCache - the client cache.
public void decode(ViewWindowField requestViewWindow,
ImageData dstImageData)
throws ErrorException
ClientLogicalTarget
decode in class ClientLogicalTargetrequestViewWindow - the Window Of Interest to decode.dstImageData - an object where the decode image must be saved.
ErrorException - if the Window Of Interest cannot be decoded.
public void decode(ViewWindowField requestViewWindow,
ViewWindowField responseViewWindow,
ImageData dstImageData)
throws ErrorException
ClientLogicalTargetClientLogicalTarget.decode(ViewWindowField, ImageData) method.
decode in class ClientLogicalTargetrequestViewWindow - the Window Of Interest which the user is
requesting for.responseViewWindow - the Window Of Interest which the server has
sent.dstImageData - an object where the decode image must be saved.
ErrorException - if the Window Of Interest cannot be decoded.public int[] getFrameSize(int resolutionLevel)
ClientLogicalTarget
getFrameSize in class ClientLogicalTargetresolutionLevel - the resolution level.
public int[][] getFrameSizes()
ClientLogicalTarget
getFrameSizes in class ClientLogicalTarget0 for width and 1 for the height.public int getMaxResolutionLevels()
ClientLogicalTarget
getMaxResolutionLevels in class ClientLogicalTargetpublic int getMaxLayers()
ClientLogicalTarget
getMaxLayers in class ClientLogicalTargetpublic java.lang.String getLogicalTargetDescription()
ClientLogicalTarget
getLogicalTargetDescription in class ClientLogicalTargetpublic JPCParameters getJPCParameters()
public boolean isMultiComponentTransform()
true if the logical target is spectrally
transformed. Otherwise, returns false.
public int[][] getRelevantComponents(int[][] comps)
throws ErrorException
compsRanges input
parameter.
ErrorExceptionpublic java.lang.String toString()
toString in class ClientLogicalTargetpublic void list(java.io.PrintStream out)
list in class ClientLogicalTargetout - an output stream.
private boolean decodeMainHeader()
throws ErrorException
WarningException
ErrorException
private void readRelevantPrecincts(java.util.ArrayList<java.lang.Long> relevantPrecincts)
throws ErrorException
ErrorExceptionprivate java.awt.image.BufferedImage imageSamplesToBufferedImage(float[][][] imageSamplesFloat)
imageSamplesFloat - a three-dimensional array with the image
samples
private ViewWindowField calculateWOIToDecode(ViewWindowField requestViewWindow,
ViewWindowField responseViewWindow)
requestViewWindow - responseViewWindow -
private void showTimeMemory(java.lang.String stage)
stage - string that will be displayedprivate void printPrecinctsByteStreams(java.util.Hashtable<java.lang.Long,ByteStream[][][][]> precinctsByteStreams)
precinctsByteStreams - private static void printByteStream(ByteStream byteStream)
buffer - the byte array to be printed.
private static void printByteArray(BufferedDataInputStream in,
long iniPos,
long finalPos)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||