|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.c3d.image.hips.HipsHeader
Read and write HIPS2 headers. Names have been kept the same as those in HIPS. All accessors are read-only. Parameters are stored as strings in a hash table, rather than there being different types.
The following methods are inherited by subclasses
public int[] rgbPixels(int imageIndex) throws HipsException;
public float[] getPixel(float x, float y, int imageIndex);
These allow images of any type to provide enough information for
display. and simple image querying.
If you want to use a HIPS image in a graphical application see the below-mentione classes
HipsProducer
,
HIPS
Field Summary | |
protected static int |
BUFSIZ
|
protected int |
cols_
|
protected int |
fcol_
|
protected int |
frow_
|
protected boolean |
isDataLoaded_
|
protected int |
num_frame_
|
protected int |
numcolor_
|
protected int |
numparam_
|
protected int |
ocols_
|
protected java.lang.String |
orig_date_
|
protected java.lang.String |
orig_name_
|
protected int |
orows_
|
protected java.util.Hashtable |
params_
|
protected static int |
PFAHC
adaptive hierarchical encoding |
protected static int |
PFAHC3
3-d adaptive hierarchical encoding |
protected static int |
PFASCII
ASCII rep, with linefeeds after each row |
protected static int |
PFBQ
binquad encoding |
protected static int |
PFBT
binary tree encoding |
protected static int |
PFBYTE
Bytes interpreted as unsigned integers |
protected static int |
PFCHAIN
Chain code encoding (Mimaging) |
protected static int |
PFCOLVEC
Set of RGB triplets defining colours |
protected static int |
PFCOMPLEX
2 Float's interpreted as (real,imaginary) |
protected static int |
PFDBLCOM
Double complex's (2 Double's) |
protected static int |
PFDOUBLE
Double's (8 byte floats) |
protected static int |
PFDVFFT2D
double complex 2D VFFT |
protected static int |
PFDVFFT3D
double complex 3D VFFT |
protected static int |
PFDVVFFT3D
double 3D VVFFT in separated planes |
protected static int |
PFFLOAT
Float's (4 bytes) |
protected static int |
PFFLOATPYR
float pyramid |
protected static int |
PFGEN
C3D template image |
protected static int |
PFGRLE
gray scale run-length encoding |
protected static int |
PFHIST
histogram of an image (using ints) |
protected static int |
PFINT
Integers (4 bytes) |
protected static int |
PFINTPYR
integer pyramid |
protected static int |
PFLSBF
packed, least-significant-bit first |
protected static int |
PFLUT
LUT format (uses Ints) (Mimaging) |
protected static int |
PFMIXED
multiple frames in different pixel formats |
protected static int |
PFMSBF
packed, most-significant-bit first |
protected static int |
PFOCT
oct-tree encoding |
protected static int |
PFPOLAR
rho-theta format (Mimaging) |
protected static int |
PFPOLYLINE
2D points |
protected static int |
PFQUAD
quad-tree encoding (Mimaging) |
protected static int |
PFQUAD1
quad-tree encoding |
protected static int |
PFRGB
RGBRGBRGB bytes |
protected static int |
PFRGBZ
RGB0RGB0RGB0 bytes |
protected static int |
PFRGISPLINE
2D points with regions and interfaces |
protected static int |
PFRGPLINE
2D points with regions |
protected static int |
PFRLEB
run-length encoding, line begins black |
protected static int |
PFRLED
run-length encoding |
protected static int |
PFRLEW
run-length encoding, line begins white |
protected static int |
PFSBYTE
signed bytes |
protected static int |
PFSHORT
Short integers (2 bytes) |
protected static int |
PFSPAN
spanning tree format |
protected static int |
PFSRLE
monochrome run-scale encoding |
protected static int |
PFSTEREO
Stereo sequence (l, r, l, r, ...) |
protected static int |
PFUINT
unsigned ints |
protected static int |
PFUKOOA
Data in standard UKOOA format |
protected static int |
PFUSHORT
unsigned shorts |
protected static int |
PFVFFT2D
float complex 2D virtual-very fast FT |
protected static int |
PFVFFT3D
float complex 3D virtual-very fast FT |
protected static int |
PFVVFFT3D
float 3D VFFT in separated planes |
protected int |
pixel_format_
|
protected static int |
PLOT3D
plot-3d format |
protected int |
rows_
|
protected java.lang.String |
seq_desc_
|
protected java.lang.String |
seq_history_
|
protected java.lang.String |
seq_name_
|
Constructor Summary | |
protected |
HipsHeader()
|
|
HipsHeader(java.io.DataInputStream in)
Read header from an input stream. |
|
HipsHeader(HipsHeader hdr)
Costruct a copy of a header. |
|
HipsHeader(int w,
int h,
int nImages,
int nFramesPerImage,
int type)
|
|
HipsHeader(java.lang.String fileName)
Read header from a file. |
Method Summary | |
protected static int |
b2i(byte b)
|
protected float |
bilinearInterp(float p00,
float p01,
float p10,
float p11,
float fracx,
float fracy)
|
protected static int[] |
byte2pixels(byte[] red)
|
protected static int[] |
byte2pixels(byte[] red,
byte[] green,
byte[] blue)
|
int |
cols()
The number of columns (x values) in the region of interest |
protected void |
copyFrom(HipsHeader hdr)
|
int |
fcol()
The first column in the region of interest (starting at 0) |
int |
frow()
The first row of the region of interest (starting at 0) |
java.lang.String |
getParam(java.lang.String paramName)
Get a parameter |
float[] |
getPixel(float x,
float y,
int imageIndex)
Return the pixel at the specified location and in the specified image in the sequence. |
float[] |
getPixel(int x,
int y,
int imageIndex)
Return the pixel at the specified location and in the specified image in the sequence. |
protected static int[] |
int2pixels(int[] red)
Convert a pixel array in the range 0-255 into ARGB pixels. |
protected static int[] |
int2pixels(int[] red,
int[] green,
int[] blue)
This only works for ints in the range 0-255, and is available as a utility for subclasses to use. |
boolean |
isDataLoaded()
Determine whether this header has image data associated with it. |
int |
num_frame()
The number of image frames in the image file |
int |
numcolor()
The number of color frames per image |
int |
numImage()
The number of images in the sequence |
int |
numparam()
The number of image parameters |
int |
numpix()
The number of pixels in an image frame |
int |
ocols()
The number of columns in the image (x values) |
java.lang.String |
orig_date()
The creation date of the image |
java.lang.String |
orig_name()
The name of the creator of the image |
int |
orows()
The number of rows in the image (y values) |
java.util.Hashtable |
params()
Hashtable containing the image parameters |
int |
pixel_format()
Integer code of hte pixel format |
protected void |
readFrame(byte[] data,
int sz,
java.io.InputStream in)
|
protected boolean |
readFromStream(java.io.DataInputStream in)
|
int[] |
rgbPixels(int imageIndex)
Get a java compatible pixel array in the default ARGB int model |
int |
rows()
The number of rows (y values) in the region of interest |
java.lang.String |
seq_desc()
The image description string |
java.lang.String |
seq_history()
The sequence history |
java.lang.String |
seq_name()
The name of theis image sequence |
int |
sizedesc()
The size in bytes of the image description |
int |
sizehist()
The length in bytes of the sequence history |
int |
sizeimage()
The size in bytes of an image frame |
int |
sizepix()
The size in bytes of an image pixel |
protected static void |
swab(byte[] buf,
int off)
|
protected void |
writeData(java.io.DataOutputStream out)
|
protected void |
writeLine(java.io.DataOutputStream out,
java.lang.String s)
|
void |
writeToFile(java.lang.String fileName)
Write the image to a file, given by fileName. |
void |
writeToStream(java.io.DataOutputStream out)
Write the image to a DataOutputStream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String orig_name_
protected java.lang.String seq_name_
protected int num_frame_
protected java.lang.String orig_date_
protected int orows_
protected int ocols_
protected int rows_
protected int cols_
protected int frow_
protected int fcol_
protected int pixel_format_
protected int numcolor_
protected java.lang.String seq_history_
protected java.lang.String seq_desc_
protected int numparam_
protected java.util.Hashtable params_
protected boolean isDataLoaded_
protected static final int PFBYTE
protected static final int PFSHORT
protected static final int PFINT
protected static final int PFFLOAT
protected static final int PFCOMPLEX
protected static final int PFASCII
protected static final int PFDOUBLE
protected static final int PFDBLCOM
protected static final int PFQUAD
protected static final int PFQUAD1
protected static final int PFHIST
protected static final int PFSPAN
protected static final int PLOT3D
protected static final int PFMSBF
protected static final int PFLSBF
protected static final int PFSBYTE
protected static final int PFUSHORT
protected static final int PFUINT
protected static final int PFRGB
protected static final int PFRGBZ
protected static final int PFMIXED
protected static final int PFINTPYR
protected static final int PFFLOATPYR
protected static final int PFPOLYLINE
protected static final int PFCOLVEC
protected static final int PFUKOOA
protected static final int PFSTEREO
protected static final int PFRGPLINE
protected static final int PFRGISPLINE
protected static final int PFCHAIN
protected static final int PFLUT
protected static final int PFAHC
protected static final int PFOCT
protected static final int PFBT
protected static final int PFAHC3
protected static final int PFBQ
protected static final int PFRLED
protected static final int PFRLEB
protected static final int PFRLEW
protected static final int PFPOLAR
protected static final int PFGRLE
protected static final int PFSRLE
protected static final int PFVFFT3D
protected static final int PFVFFT2D
protected static final int PFDVFFT3D
protected static final int PFDVFFT2D
protected static final int PFVVFFT3D
protected static final int PFDVVFFT3D
protected static final int PFGEN
protected static final int BUFSIZ
Constructor Detail |
public HipsHeader(java.io.DataInputStream in) throws HipsException
in
- The input data stream.public HipsHeader(java.lang.String fileName) throws HipsException, java.io.FileNotFoundException, java.io.IOException
fileName
- The input file name.public HipsHeader(HipsHeader hdr)
header
- The header to be copied from.public HipsHeader(int w, int h, int nImages, int nFramesPerImage, int type)
protected HipsHeader()
Method Detail |
protected void copyFrom(HipsHeader hdr)
protected static final int[] int2pixels(int[] red, int[] green, int[] blue)
protected static final int[] int2pixels(int[] red)
protected static final int[] byte2pixels(byte[] red, byte[] green, byte[] blue)
protected static final int[] byte2pixels(byte[] red)
public float[] getPixel(int x, int y, int imageIndex)
x
- The x-location (column) of the pixely
- The y-location (row) of the pixelimageIndex
- The index of the image in the sequence
(starting at 0) for which the pixel value is required.public float[] getPixel(float x, float y, int imageIndex)
Floating point numbers are returned in the case that a non-integral pixel location is chosen. In this case bilinear interpolation is used to obtain the value of the pixel.
x
- The x-location (column) of the pixely
- The y-location (row) of the pixelimageIndex
- The index of the image in the sequence
(starting at 0) for which the pixel value is required.protected float bilinearInterp(float p00, float p01, float p10, float p11, float fracx, float fracy)
protected static final int b2i(byte b)
public boolean isDataLoaded()
protected void readFrame(byte[] data, int sz, java.io.InputStream in) throws java.io.IOException
public java.lang.String orig_name()
public java.lang.String seq_name()
public int num_frame()
public java.lang.String orig_date()
public int orows()
public int ocols()
public int rows()
public int cols()
public int frow()
public int fcol()
public int pixel_format()
public int numcolor()
public int numImage()
public int numpix()
public int sizepix()
public int sizeimage()
public int sizehist()
public java.lang.String seq_history()
public int sizedesc()
public java.lang.String seq_desc()
public int numparam()
public java.util.Hashtable params()
public java.lang.String getParam(java.lang.String paramName)
public int[] rgbPixels(int imageIndex) throws HipsException
protected boolean readFromStream(java.io.DataInputStream in)
public void writeToFile(java.lang.String fileName) throws java.io.IOException
fileName
- A String representing the name
of the file in the local file systempublic void writeToStream(java.io.DataOutputStream out) throws java.io.IOException
fileName
- A String representing the name
of the file in the local file systemprotected void writeLine(java.io.DataOutputStream out, java.lang.String s) throws java.io.IOException
protected static final void swab(byte[] buf, int off)
protected void writeData(java.io.DataOutputStream out) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |