## com.bbn.openmap.layer.rpf
Class RpfFrame

    java.lang.Object
      com.bbn.openmap.layer.rpf.RpfFrame

public class RpfFrame
extends java.lang.Object

The object that organizes the information found within the RPF frame file. The RpfFrame handles reading through the different sections, and holds on to the compressed subframe data. The cache handler gets the compressed subframe data and decompresses it before storing the uncompressed subframe in the cache.

Nested Class Summary
`static class` `RpfFrame.Compression`
`static class` `RpfFrame.Image`
`static class` `RpfFrame.LookupTable`

Field Summary
`protected RpfAttributes` `attributes`
`protected RpfColortable` `colortable`
`protected RpfFileSections.RpfCoverageSection` `coverage`
`protected boolean` `DEBUG_RPFDETAIL`
`protected boolean` `DEBUG_RPFFRAME`
`protected RpfFileSections` `fileSections`
`protected RpfHeader` `header`
`protected NitfHeader` `nitfHeader`

Constructor Summary
`RpfFrame(RpfFrameEntry rfe)` Loads the RpfFrame, given the RpfFrameEntry that the RpfCacheHandler got from the RpfTocHandler.
`RpfFrame(java.lang.String framePath)` Loads the RpfFrame, given a complete path to the file.

Method Summary
`byte[]` `decompressSubframe(int x, int y)` Decompress a subframe into an array of bytes suitable for in indexed color model image.
`int[]` `decompressSubframe(int x, int y, RpfColortable colortable)` Decompress a subframe into an array of ints suitable for a direct color model image.
`RpfSubframe` `decompressSubframe(int x, int y, RpfSubframe subframe, RpfColortable colortable, RpfViewAttributes viewAttributes)` Decompress a subframe into a cache entry OMRaster (RpfSubframe).
`RpfAttributes` `getAttributes()` Get the attributes for the RpfFrame.
`java.awt.Color[]` `getColors(BinaryFile binFile, RpfColortable ct)` The only reason to call this is to read the colortable that is within the frame file, and set the colors that you will be using for all the frames accordingly.
`static java.awt.Color[]` `getColors(java.lang.String framePath, RpfColortable ct)` Load the colortable with the colors from a particular frame file.
`RpfColortable` `getColortable()` Get the colortable stored inside this RpfFrame.
`RpfFileSections.RpfCoverageSection` `getCoverage()` Get the coverage section.
`RpfFileSections` `getFileSections()` Get the different file sections.
`RpfHeader` `getHeader()` Get the RpfFrame header.
`NitfHeader` `getNitfHeader()` Get the NitfFile header.
`java.lang.String` `getReport(int x, int y, RpfFrameEntry entry, boolean Cib)` Get the attribute text to display on the screen.
`protected boolean` `initFile(java.lang.String framePath)`
`boolean` `isValid()`
`static void` `main(java.lang.String[] argv)`
`boolean` `read(BinaryFile binFile)` Read the RPF frame.
`protected void` `setReport(boolean Cib)` Create the screen text used on a subframe.
`void` `view()` A quick hack to pop up a window that displays the entire frame image.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### nitfHeader

    protected NitfHeader nitfHeader

### header

    protected RpfHeader header

### fileSections

    protected RpfFileSections fileSections

### attributes

    protected RpfAttributes attributes

### coverage

    protected RpfFileSections.RpfCoverageSection coverage

### colortable

    protected RpfColortable colortable

### DEBUG_RPFDETAIL

    protected boolean DEBUG_RPFDETAIL

### DEBUG_RPFFRAME

    protected boolean DEBUG_RPFFRAME

Constructor Detail

### RpfFrame

    public RpfFrame(java.lang.String framePath)

  Loads the RpfFrame, given a complete path to the file.

### RpfFrame

    public RpfFrame(RpfFrameEntry rfe)

  Loads the RpfFrame, given the RpfFrameEntry that the RpfCacheHandler got from the RpfTocHandler.

Method Detail

### initFile

    protected boolean initFile(java.lang.String framePath)

### isValid

    public boolean isValid()

### setReport

    protected void setReport(boolean Cib)

  Create the screen text used on a subframe. The internal string is set.

  Parameters:
    `Cib` - whether the frame is a Cib frame. The report is different if it is.

### getReport

    public java.lang.String getReport(int x,
                                      int y,
                                      RpfFrameEntry entry,
                                      boolean Cib)

  Get the attribute text to display on the screen. This goes to the RpfSubframe object. The RpfCacheHandler knows about the four variables.

  Parameters:
    `x` - subframe index within the array from the TocEntry.
    `y` - subframe index within the array from the TocEntry
    `entry` - the RpfFrameEntry describing the frame.
    `Cib` - whether the frame is an imagery frame.

### getNitfHeader

    public NitfHeader getNitfHeader()

  Get the NitfFile header.

### getHeader

    public RpfHeader getHeader()

  Get the RpfFrame header.

### getFileSections

    public RpfFileSections getFileSections()

  Get the different file sections.

### getAttributes

    public RpfAttributes getAttributes()

  Get the attributes for the RpfFrame.

### getCoverage

    public RpfFileSections.RpfCoverageSection getCoverage()

  Get the coverage section.

### getColors

    public java.awt.Color[] getColors(BinaryFile binFile,
                                      RpfColortable ct)

  The only reason to call this is to read the colortable that is within the frame file, and set the colors that you will be using for all the frames accordingly. The RpfColortable is passed in so you can set the opaqueness, number of colors, and other colortable variables inside your own colortable object, and then read the color conversion tables as they apply (inside the frame file). Since the frame file is read when the RpfFrame is created, the fileSections object will (should) be valid.

### getColors

    public static java.awt.Color[] getColors(java.lang.String framePath,
                                             RpfColortable ct)

  Load the colortable with the colors from a particular frame file. Not needed, really, since the frame file is now loading it's own colortable at loadtime.

### getColortable

    public RpfColortable getColortable()

  Get the colortable stored inside this RpfFrame.

  Returns:
    RpfColortable

### read

    public boolean read(BinaryFile binFile)

  Read the RPF frame.

### decompressSubframe

    public RpfSubframe decompressSubframe(int x,
                                          int y,
                                          RpfSubframe subframe,
                                          RpfColortable colortable,
                                          RpfViewAttributes viewAttributes)

  Decompress a subframe into a cache entry OMRaster (RpfSubframe). The RpfSubframe is returned, too, to emphasize what's happening.

  Parameters:
    `x` - the x coord for the subframe
    `y` - the y coord for the subframe
    `subframe` - the subframe to create the image for. The resulting image will be loaded into the RpfSubframe. If null, a new RpfSubframe will be created.
    `colortable` - the colortable to use with this image. If null, the colortable from this RpfFrame will be used.
    `viewAttributes` - our image generation parameters.
  Returns:
    RpfSubframe containing the image data.

### decompressSubframe

    public byte[] decompressSubframe(int x,
                                     int y)

  Decompress a subframe into an array of bytes suitable for in indexed color model image.

  Parameters:
    `x` - the x coord for the subframe
    `y` - the y coord for the subframe

### decompressSubframe

    public int[] decompressSubframe(int x,
                                    int y,
                                    RpfColortable colortable)

  Decompress a subframe into an array of ints suitable for a direct color model image. (argb format)

  Parameters:
    `x` - the x coord for the subframe
    `y` - the y coord for the subframe
    `colortable` - the colortable to use with this image. If null, the RpfColortable from the frame will be used.

### main

    public static void main(java.lang.String[] argv)

### view

    public void view()

  A quick hack to pop up a window that displays the entire frame image.

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details