|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.jpeg.jj2000.j2k.image.ImgDataAdapter
ucar.jpeg.colorspace.ColorSpaceMapper
ucar.jpeg.colorspace.PalettizedColorSpaceMapper
public class PalettizedColorSpaceMapper
This class provides decoding of images with palettized colorspaces. Here each sample in the input is treated as an index into a color palette of triplet sRGB output values.
jj2000.j2k.colorspace.ColorSpace
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ucar.jpeg.colorspace.ColorSpaceMapper |
---|
ColorSpaceMapper.ComputedComponents |
Field Summary |
---|
Fields inherited from class ucar.jpeg.colorspace.ColorSpaceMapper |
---|
computed, csMap, dataFloat, dataInt, eol, fixedPtBitsArray, inFloat, inInt, maxValueArray, ncomps, OPT_PREFIX, pl, shiftValueArray, src, srcBlk, workDataFloat, workDataInt, workFloat, workInt |
Fields inherited from class ucar.jpeg.jj2000.j2k.image.ImgDataAdapter |
---|
imgdatasrc, tIdx |
Constructor Summary | |
---|---|
protected |
PalettizedColorSpaceMapper(BlkImgDataSrc src,
ColorSpace csMap)
Ctor which creates an ICCProfile for the image and initializes all data objects (input, working, and output). |
Method Summary | |
---|---|
static BlkImgDataSrc |
createInstance(BlkImgDataSrc src,
ColorSpace csMap)
Factory method for creating instances of this class. |
DataBlk |
getCompData(DataBlk out,
int c)
Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. |
int |
getCompImgHeight(int c)
Returns the number of bits, referred to as the "range bits", corresponding to the nominal range of the image data in the specified component. |
int |
getCompImgWidth(int c)
Returns the width in pixels of the specified component in the overall image. |
int |
getCompSubsX(int c)
Returns the component subsampling factor in the horizontal direction, for the specified component. |
int |
getCompSubsY(int c)
Returns the component subsampling factor in the vertical direction, for the specified component. |
int |
getCompULX(int c)
Returns the horizontal coordinate of the upper-left corner of the specified component in the current tile. |
int |
getCompULY(int c)
Returns the vertical coordinate of the upper-left corner of the specified component in the current tile. |
DataBlk |
getInternCompData(DataBlk out,
int c)
Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. |
int |
getNomRangeBits(int c)
Returns the number of bits, referred to as the "range bits", corresponding to the nominal range of the image data in the specified component. |
int |
getNumComps()
Returns the number of components in the image. |
int |
getTileCompHeight(int t,
int c)
Returns the height in pixels of the specified tile-component. |
int |
getTileCompWidth(int t,
int c)
Returns the width in pixels of the specified tile-component |
String |
toString()
Return a suitable String representation of the class instance, e.g. |
Methods inherited from class ucar.jpeg.colorspace.ColorSpaceMapper |
---|
copyGeometry, getFixedPoint, getParameterInfo, setInternalBuffer |
Methods inherited from class ucar.jpeg.jj2000.j2k.image.ImgDataAdapter |
---|
getImgHeight, getImgULX, getImgULY, getImgWidth, getNomTileHeight, getNomTileWidth, getNumTiles, getNumTiles, getTile, getTileHeight, getTileIdx, getTilePartULX, getTilePartULY, getTileWidth, nextTile, setTile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ucar.jpeg.jj2000.j2k.image.ImgData |
---|
getImgHeight, getImgULX, getImgULY, getImgWidth, getNomTileHeight, getNomTileWidth, getNumTiles, getNumTiles, getTile, getTileHeight, getTileIdx, getTilePartULX, getTilePartULY, getTileWidth, nextTile, setTile |
Constructor Detail |
---|
protected PalettizedColorSpaceMapper(BlkImgDataSrc src, ColorSpace csMap) throws ColorSpaceException
src
- -- Source of image datacsm
- -- provides colorspace info
ColorSpaceException
Method Detail |
---|
public static BlkImgDataSrc createInstance(BlkImgDataSrc src, ColorSpace csMap) throws ColorSpaceException
src
- -- source of image datacsMap
- -- provides colorspace info
ColorSpaceException
public DataBlk getCompData(DataBlk out, int c)
The rectangular area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument, relative to the current tile. These members are not modified by this method. The 'offset' of the returned data is 0, and the 'scanw' is the same as the block's width. See the 'DataBlk' class.
If the data array in 'blk' is 'null', then a new one is created. If the data array is not 'null' then it is reused, and it must be large enough to contain the block's data. Otherwise an 'ArrayStoreException' or an 'IndexOutOfBoundsException' is thrown by the Java system.
The returned data has its 'progressive' attribute set to that of the input data.
getCompData
in interface BlkImgDataSrc
getCompData
in class ColorSpaceMapper
blk
- Its coordinates and dimensions specify the area to
return. If it contains a non-null data array, then it must have the
correct dimensions. If it contains a null data array a new one is
created. The fields in this object are modified to return the data.c
- The index of the component from which to get the data. Only 0
and 3 are valid.
getInternCompData(ucar.jpeg.jj2000.j2k.image.DataBlk, int)
public String toString()
[PalettizedColorSpaceMapper ncomps= 3, scomp= 1, nentries= 1024 column=0, 7 bit signed entry column=1, 7 bit unsigned entry column=2, 7 bit signed entry]
toString
in class Object
public DataBlk getInternCompData(DataBlk out, int c)
The rectangular area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument, relative to the current tile. These members are not modified by this method. The 'offset' and 'scanw' of the returned data can be arbitrary. See the 'DataBlk' class.
This method, in general, is more efficient than the 'getCompData()' method since it may not copy the data. However if the array of returned data is to be modified by the caller then the other method is probably preferable.
If possible, the data in the returned 'DataBlk' should be the internal data itself, instead of a copy, in order to increase the data transfer efficiency. However, this depends on the particular implementation (it may be more convenient to just return a copy of the data). This is the reason why the returned data should not be modified.
If the data array in blk is null, then a new one is created if necessary. The implementation of this interface may choose to return the same array or a new one, depending on what is more efficient. Therefore, the data array in blk prior to the method call should not be considered to contain the returned data, a new array may have been created. Instead, get the array from blk after the method has returned.
The returned data may have its 'progressive' attribute set. In this case the returned data is only an approximation of the "final" data.
getInternCompData
in interface BlkImgDataSrc
getInternCompData
in class ColorSpaceMapper
blk
- Its coordinates and dimensions specify the area to return,
relative to the current tile. Some fields in this object are modified
to return the data.c
- The index of the component from which to get the data.
getCompData(ucar.jpeg.jj2000.j2k.image.DataBlk, int)
public int getNomRangeBits(int c)
getNomRangeBits
in interface ImgData
getNomRangeBits
in class ImgDataAdapter
c
- The index of the component.
public int getNumComps()
getNumComps
in interface ImgData
getNumComps
in class ImgDataAdapter
public int getCompSubsX(int c)
getCompSubsX
in interface ImgData
getCompSubsX
in class ImgDataAdapter
c
- The index of the component (between 0 and N-1)
jj2000.j2k.image.ImgData
public int getCompSubsY(int c)
getCompSubsY
in interface ImgData
getCompSubsY
in class ImgDataAdapter
c
- The index of the component (between 0 and N-1)
jj2000.j2k.image.ImgData
public int getTileCompWidth(int t, int c)
getTileCompWidth
in interface ImgData
getTileCompWidth
in class ImgDataAdapter
t
- Tile indexc
- The index of the component, from 0 to N-1.
public int getTileCompHeight(int t, int c)
getTileCompHeight
in interface ImgData
getTileCompHeight
in class ImgDataAdapter
t
- The tile index.c
- The index of the component, from 0 to N-1.
public int getCompImgWidth(int c)
getCompImgWidth
in interface ImgData
getCompImgWidth
in class ImgDataAdapter
c
- The index of the component, from 0 to N-1.
public int getCompImgHeight(int c)
getCompImgHeight
in interface ImgData
getCompImgHeight
in class ImgDataAdapter
c
- The index of the component.
public int getCompULX(int c)
getCompULX
in interface ImgData
getCompULX
in class ImgDataAdapter
c
- The index of the component.public int getCompULY(int c)
getCompULY
in interface ImgData
getCompULY
in class ImgDataAdapter
c
- The index of the component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |