OMRasterObject (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.omGraphics
Class OMRasterObject

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphicAdapter
              com.bbn.openmap.omGraphics.OMRasterObject

All Implemented Interfaces:
  OMGeometry, OMGraphic, OMGraphicConstants, java.awt.image.ImageObserver, java.io.Serializable, java.lang.Cloneable

Direct Known Subclasses:
  OMBitmap, OMRaster

    public abstract class OMRasterObject

extends OMGraphicAdapter
implements OMGraphic, java.awt.image.ImageObserver

The OMRasterObject is the parent class for OMRaster and OMBitmap objects. It manages some of the same functions that both classes require in order to create image pixel data from bytes or integers.

An ImageFilter may be applied to OMRasterObjects. These can be scale filters, color filters, or maybe (?hopefully?) projection filters. These filters won't change the original image data, and the original can be reconstructed by resetting the filter to null, and generating the object.

For all classes in the OMRasterObject family, a java.awt.Shape object is created for the border of the image. This Shape object is used for distance calculations. If the OMRasterObject is selected(), however, this Shape will be rendered with the OMGraphic parameters that are set in the OMGraphic.

See Also:
  Serialized Form

Nested Class Summary
`protected class` | `OMRasterObject.TrimScaleFilter` This is an effort to create an scaling ImageFilter that will trim off the unused pixels, lessoning the load on the display server.

Field Summary
`protected java.awt.Image` | `bitmap` The bitmap is drawn to the graphics.
`protected byte[]` | `bits` The byte info for the image.
`protected int` | `colorModel` colorModel helps figure out what kind of updates are necessary, by knowing what kind of image we're dealing with.
`static int` | `COLORMODEL_DIRECT` The direct colormodel, for OMRasters, means the integer values passed in as pixels, already reflect the RGB color values each pixel should display.
`static int` | `COLORMODEL_IMAGEICON` The ImageIcon colormodel means that the image is externally set, and we just want to to display the image at the given location.
`static int` | `COLORMODEL_INDEXED` The indexed colormodel, for OMRasters, means that the byte array passed in for the pixels has to be resolved with a colortable in order to create a integer array of RGB pixels.
`protected boolean` | `DEBUG`
`static int` | `FAST_SCALING` If scaling the image, use the faster, replicating/clipping algorithm.
`protected int` | `filteredHeight` The height of the image after scaling, if you want the image to be a different size than the source.
`protected int` | `filteredWidth` The width of the image after scaling, if you want the image to be a different size than the source.
`protected int` | `height` The height of the image, in pixels.
`protected java.awt.image.ImageFilter` | `imageFilter` The image filter to use on the constructed image.
`protected double` | `lat` The latitude of the upper left corner for the image, in decimal degrees.
`static java.util.logging.Logger` | `logger`
`protected double` | `lon` The longitude of the upper left corner for the image, in decimal degrees.
`protected boolean` | `needToReposition` Set if the projection has had attributes change that require a repositioning of the image, not a regeneration.
`protected int[]` | `pixels` The pixels are used for the image that is drawn on the window.
`protected java.awt.Point` | `point1` Projected window pixel location of the upper left corner of the image.
`protected java.awt.Point` | `point2` Projected window pixel location of the lower right corner of the image.
`protected java.lang.Double` | `renderRotationAngle` The angle, perhaps taking into account NO_ROTATE, that the image is rotated at render-time.
`protected double` | `rotationAngle` the angle by which the image is to be rotated, in radians
`static int` | `SMOOTH_SCALING` If scaling the image, use the slower, smoothing algorithm.
`protected int` | `width` The width of the image, in pixels.
`protected int` | `x` Horizontal location of the upper left corner of the image, or the x offset from the lon for that corner, in pixels.
`protected int` | `y` Vertical location of the upper left corner of the image, or the y offset from the lat for that corner, in pixels.

Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
`declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask`

Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`attributes, lineType, needToRegenerate, shape, visible`

Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
`ADD_GRAPHIC_MASK, APP_OBJECT, BASIC_STROKE, CHANGE_APPEARANCE, clear, DECIMAL_DEGREES, DECLUTTERTYPE_LINE, DECLUTTERTYPE_MOVE, DECLUTTERTYPE_NONE, DECLUTTERTYPE_SPACE, DEFAULT_ROTATIONANGLE, DELETE_GRAPHIC_MASK, DESELECT_GRAPHIC_MASK, DESELECTALL_GRAPHIC_MASK, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, INDEX, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, NO_ROTATE, OMGRAPHIC_ELT, OMGRAPHIC_TYPE_ATTR, RADIANS, RAISE_GRAPHIC_MASK, RAISE_TO_TOP_GRAPHIC_MASK, REMOVABLE, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, SELECT_GRAPHIC_MASK, SORT_GRAPHICS_MASK, TOOLTIP, UPDATE_GRAPHIC_MASK, UPDATED`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`OMRasterObject()` A Constructor that sets the graphic type to raster, render type to unknown, line type to unknown, and the declutter type to none.
`OMRasterObject(int rType, int lType, int dcType)` A Constructor that sets the graphic type, render type, line type and the declutter type to the values you pass in.

Method Summary
`protected java.awt.geom.GeneralPath` | `adjustShapeForRotation(java.awt.geom.GeneralPath projectedShape, double anchorX, double anchorY)` Internally evaluates renderRotationAngle and if necessary, applies the rotation to the shape.
`protected abstract int[]` | `computePixels(byte[] bits)` Compute the raster objects pixels, based on the color model and the byte values.
`protected java.awt.Image` | `filterImage(java.awt.Image image)` A method used to manipulate the image according to the parameters set by the imageFilter in the OMRasterObject.
`byte[]` | `getBits()` Get the byte values for indexed color model images and OMBitmaps.
`int` | `getColorModel()` Get the color model type of the image.
`int` | `getFilteredHeight()` Get the height of image after a filter was applied.
`int` | `getFilteredWidth()` Get width of image, after a filter is applied.
`int` | `getHeight()` Get the height of image.
`java.awt.Image` | `getImage()` Get the image that will be put on the window.
`java.awt.image.ImageFilter` | `getImageFilter()` Return the image filter used on the image.
`double` | `getLat()` Get the latitude.
`double` | `getLon()` Get the longitude.
`java.awt.Point` | `getMapLocation()` Return the map location of the image, after generation.
`boolean` | `getNeedToReposition()` Return the reposition status.
`int[]` | `getPixels()` Return the pixels used for the image.
`double` | `getRotationAngle()` Get the current rotation of the image.
`int` | `getWidth()` Get width of image.
`int` | `getX()` Returns the x attribute.
`int` | `getY()` Return the y attribute.
`boolean` | `hasLineTypeChoice()` Used by the GraphicAttributes object to provide a choice on whether the line type choice can be changed.
`boolean` | `imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)` From the Image Observer Interface.
`protected boolean` | `position(Projection proj)` Since the image doesn't necessarily need to be regenerated when it is merely moved, raster objects have this function, called from generate() and when a placement attribute is changed.
`boolean` | `regenerate(Projection proj)` Overrides OMGraphicAdapter version to handle OMRasterObject getNeedToReposition.
`void` | `render(java.awt.Graphics graphics)` Render the raster on the java.awt.Graphics
`protected void` | `renderImage(java.awt.Graphics g, java.awt.Image image, java.awt.Point loc)` Render the image at the given pixel location.
`void` | `restore(OMGeometry source)` Takes the generic OMGraphic settings from another OMGraphic and pushes them to this one.
`protected void` | `rotate(java.awt.Graphics2D g)` Called from within render().
`void` | `scaleTo(int w, int h, int algorithmType)` Convenience function to scale the Image to the xy size.
`void` | `setBits(byte[] values)` Set the bytes used to create the pixels used to create the image.
`protected void` | `setColorModel(int cm)` The color model is set based on the constructor.
`void` | `setHeight(int value)` Set the height of the image, in pixels.
`void` | `setImage(java.awt.Image ii)` Set the image to be drawn, if the color model is COLORMODEL_IMAGEICON.
`void` | `setImageFilter(java.awt.image.ImageFilter filter)` Set a filter to be used on the constructed image.
`void` | `setLat(double value)` Change the latitude attribute, which matters only if the render type is RENDERTYPE_LATLON or RENDERTYPE_OFFSET.
`void` | `setLon(double value)` Change the longitude attribute, which matters only if the render type is RENDERTYPE_LATLON or RENDERTYPE_OFFSET.
`void` | `setNeedToReposition(boolean value)` Set the flag for the object that lets the render method (which draws the object) know that the object needs to be repositioned first.
`void` | `setPixels(int[] values)` Set the pixels for the image for direct color model images.
`void` | `setRotationAngle(double angle)` Set the angle by which the image is to rotated.
`void` | `setShape()` Set the rectangle, based on the location and size of the image.
`void` | `setWidth(int value)` Set width of image.
`void` | `setX(int value)` Change the x attribute, which matters only if the render type is RENDERTYPE_XY or RENDERTYPE_OFFSET.
`void` | `setY(int value)` Change the y attribute, which matters only if the render type is RENDERTYPE_XY or RENDERTYPE_OFFSET.
`boolean` | `shouldRenderFill()` Always true for images, affects distance measurements.

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
`clone, deselect, distance, generate, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, readTextureMask, renderLabel, renderShape, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, writeStroke, writeTextureMask`

Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible`

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

Methods inherited from interface com.bbn.openmap.omGraphics.OMGraphic
`clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, isMatted, isSelected, normalizeDistanceForLineWidth, renderLabel, select, setDeclutterType, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge`

Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
`clearAttributes, contains, distance, distanceToEdge, draw, draw, fill, fill, generate, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible`

Field Detail

### COLORMODEL_DIRECT

    public static final int COLORMODEL_DIRECT

  The direct colormodel, for OMRasters, means the integer values passed in as pixels, already reflect the RGB color values each pixel should display.

  See Also:
    Constant Field Values

### COLORMODEL_INDEXED

    public static final int COLORMODEL_INDEXED

  The indexed colormodel, for OMRasters, means that the byte array passed in for the pixels has to be resolved with a colortable in order to create a integer array of RGB pixels.

  See Also:
    Constant Field Values

### COLORMODEL_IMAGEICON

    public static final int COLORMODEL_IMAGEICON

  The ImageIcon colormodel means that the image is externally set, and we just want to to display the image at the given location.

  See Also:
    Constant Field Values

### SMOOTH_SCALING

    public static final int SMOOTH_SCALING

  If scaling the image, use the slower, smoothing algorithm.

  See Also:
    Constant Field Values

### FAST_SCALING

    public static final int FAST_SCALING

  If scaling the image, use the faster, replicating/clipping algorithm.

  See Also:
    Constant Field Values

### colorModel

    protected int colorModel

  colorModel helps figure out what kind of updates are necessary, by knowing what kind of image we're dealing with. For the images created with a ImageIcon, the attribute updates that don't relate to position will not take affect.

### pixels

    protected int[] pixels

  The pixels are used for the image that is drawn on the window. The pixels are either passed in as an int[] in some constructors of the OMRaster, or it is constructed in the OMBitmap and in OMRasters that have a colortable.

### x

    protected int x

  Horizontal location of the upper left corner of the image, or the x offset from the lon for that corner, in pixels.

### y

    protected int y

  Vertical location of the upper left corner of the image, or the y offset from the lat for that corner, in pixels.

### lat

    protected double lat

  The latitude of the upper left corner for the image, in decimal degrees.

### lon

    protected double lon

  The longitude of the upper left corner for the image, in decimal degrees.

### width

    protected int width

  The width of the image, in pixels. This always reflects the width of the original image, even if a filter is applied to the image.

### height

    protected int height

  The height of the image, in pixels. This always reflects the height of the original image, even if a filter is applied to the image.

### bits

    protected byte[] bits

  The byte info for the image. OMBitmaps use each bit as an indication to use the lineColor or the fillColor for each pixel (like a XBitmap). OMRasters only use the bits when the image being created follows the indexed colormodel. Then, the bits hold the colortable indexes that each pixel needs to have a color substituted in later.

### bitmap

    protected transient java.awt.Image bitmap

  The bitmap is drawn to the graphics.

### point1

    protected transient java.awt.Point point1

  Projected window pixel location of the upper left corner of the image.

### point2

    protected transient java.awt.Point point2

  Projected window pixel location of the lower right corner of the image.

### filteredWidth

    protected int filteredWidth

  The width of the image after scaling, if you want the image to be a different size than the source.

### filteredHeight

    protected int filteredHeight

  The height of the image after scaling, if you want the image to be a different size than the source.

### imageFilter

    protected java.awt.image.ImageFilter imageFilter

  The image filter to use on the constructed image.

### needToReposition

    protected boolean needToReposition

  Set if the projection has had attributes change that require a repositioning of the image, not a regeneration.

### rotationAngle

    protected double rotationAngle

  the angle by which the image is to be rotated, in radians

### renderRotationAngle

    protected java.lang.Double renderRotationAngle

  The angle, perhaps taking into account NO_ROTATE, that the image is rotated at render-time.

### logger

    public static java.util.logging.Logger logger

### DEBUG

    protected transient boolean DEBUG

Constructor Detail

### OMRasterObject

    public OMRasterObject()

  A Constructor that sets the graphic type to raster, render type to unknown, line type to unknown, and the declutter type to none.

### OMRasterObject

    public OMRasterObject(int rType,
                          int lType,
                          int dcType)

  A Constructor that sets the graphic type, render type, line type and the declutter type to the values you pass in. See OMGraphic for the definitions of these attributes.

  Parameters:
    `rType` - render type
    `lType` - line type
    `dcType` - declutter type

Method Detail

### setColorModel

    protected void setColorModel(int cm)

  The color model is set based on the constructor. This setting controls what parameter changes are possible for different models of images.

  Parameters:
    `cm` - the colormode that describes how the colors are being set - COLORMODEL_DIRECT, COLORMODEL_INDEXED, or COLORMODEL_IMAGEICON.

### getColorModel

    public int getColorModel()

  Get the color model type of the image.

  Returns:
    COLORMODEL_DIRECT, COLORMODEL_INDEXED, or COLORMODEL_IMAGEICON.

### setNeedToReposition

    public void setNeedToReposition(boolean value)

  Set the flag for the object that lets the render method (which draws the object) know that the object needs to be repositioned first.

### getNeedToReposition

    public boolean getNeedToReposition()

  Return the reposition status.

### setRotationAngle

    public void setRotationAngle(double angle)

  Set the angle by which the image is to rotated.

  Parameters:
    `angle` - the number of radians the image is to be rotated. Measured clockwise from horizontal.

### getRotationAngle

    public double getRotationAngle()

  Get the current rotation of the image.

  Returns:
    the image rotation.

### computePixels

    protected abstract int[] computePixels(byte[] bits)

  Compute the raster objects pixels, based on the color model and the byte values.

  Returns:
    int[] where things are OK (height*width = pixel.length), null if there is a problem.

### rotate

    protected void rotate(java.awt.Graphics2D g)

  Called from within render(). This method should call rotate() on the provided Graphics2D object, setting the rotation angle and the rotation point. By default, the rotation angle is whatever is set in the OMRasterObject, and the rotation point is the offset point plus half the image width in the horizontal direction, and half the image in the vertical direction.

### render

    public void render(java.awt.Graphics graphics)

  Render the raster on the java.awt.Graphics

  Specified by:
    `render` in interface `OMGeometry`
  Overrides:
    `render` in class `OMGraphicAdapter`
  Parameters:
    `graphics` - java.awt.Graphics to draw the image on.

### renderImage

    protected void renderImage(java.awt.Graphics g,
                               java.awt.Image image,
                               java.awt.Point loc)

  Render the image at the given pixel location. This method should be overridden for special Image handling.

  Parameters:
    `g` - the Graphics object to render the image into. Assumes this is a derivative of the Graphics passed into the OMGraphic, and can be modified without worrying about passing settings on to other OMGraphics.
    `loc` - the pixel location of the image.

### setShape

    public void setShape()

  Set the rectangle, based on the location and size of the image.

### adjustShapeForRotation

    protected java.awt.geom.GeneralPath adjustShapeForRotation(java.awt.geom.GeneralPath projectedShape,
                                                               double anchorX,
                                                               double anchorY)

  Internally evaluates renderRotationAngle and if necessary, applies the rotation to the shape. If no rotation modifications are needed, the gp is returned as is.

  Parameters:
    `projectedShape` - The GeneralPath to rotate, if necessary.
    `anchorX` - the x coordinate of the rotation point.
    `anchorY` - the y coordinate of the rotation point.
  Returns:
    A rotated path if renderRotationAngle is not null, gp otherwise.

### position

    protected boolean position(Projection proj)

  Since the image doesn't necessarily need to be regenerated when it is merely moved, raster objects have this function, called from generate() and when a placement attribute is changed.

  Parameters:
    `proj` - projection of window.
  Returns:
    true if enough information is in the object for proper placement.

### setImage

    public void setImage(java.awt.Image ii)

  Set the image to be drawn, if the color model is COLORMODEL_IMAGEICON.

  Parameters:
    `ii` - the image icon to use.

### regenerate

    public boolean regenerate(Projection proj)

  Overrides OMGraphicAdapter version to handle OMRasterObject getNeedToReposition.

  Specified by:
    `regenerate` in interface `OMGeometry`
  Specified by:
    `regenerate` in interface `OMGraphic`
  Overrides:
    `regenerate` in class `OMGraphicAdapter`
  Parameters:
    `proj` - the Projection
  Returns:
    true if generated, false if didn't do it (maybe a problem).
  See Also:
    `OMGraphicAdapter.generate(com.bbn.openmap.proj.Projection)`

### getImage

    public java.awt.Image getImage()

  Get the image that will be put on the window.

  Returns:
    the Image created by computePixels and generate().

### shouldRenderFill

    public boolean shouldRenderFill()

  Always true for images, affects distance measurements. Forces the omGraphics package to treat the OMRasterObject as a filled shape.

  Specified by:
    `shouldRenderFill` in interface `OMGraphic`
  Overrides:
    `shouldRenderFill` in class `OMGraphicAdapter`

### setPixels

    public void setPixels(int[] values)

  Set the pixels for the image for direct color model images. Checks to see of the length matches the height * width, but doesn't do anything if they don't match. Make sure it does.

  Parameters:
    `values` - the pixel values.

### getPixels

    public int[] getPixels()

  Return the pixels used for the image.

  Returns:
    the integer array of ints used as integer colors for each pixel of the image.

### setX

    public void setX(int value)

  Change the x attribute, which matters only if the render type is RENDERTYPE_XY or RENDERTYPE_OFFSET.

  Parameters:
    `value` - the x location in pixels.

### getX

    public int getX()

  Returns the x attribute.

  Returns:
    the x value, pixels from left of window or image origin.

### setY

    public void setY(int value)

  Change the y attribute, which matters only if the render type is RENDERTYPE_XY or RENDERTYPE_OFFSET.

  Parameters:
    `value` - the y location in pixels

### getY

    public int getY()

  Return the y attribute.

  Returns:
    the y value, pixels from top or image origin.

### getMapLocation

    public java.awt.Point getMapLocation()

  Return the map location of the image, after generation.

  Returns:
    Point, null if not projected yet.

### setLat

    public void setLat(double value)

  Change the latitude attribute, which matters only if the render type is RENDERTYPE_LATLON or RENDERTYPE_OFFSET.

  Parameters:
    `value` - latitude in decimal degrees.

### getLat

    public double getLat()

  Get the latitude.

  Returns:
    the latitude in decimal degrees.

### setLon

    public void setLon(double value)

  Change the longitude attribute, which matters only if the render type is RENDERTYPE_LATLON or RENDERTYPE_OFFSET.

  Parameters:
    `value` - the longitude in decimal degrees.

### getLon

    public double getLon()

  Get the longitude.

  Returns:
    longitude in decimal degrees.

### setHeight

    public void setHeight(int value)

  Set the height of the image, in pixels.

  Parameters:
    `value` - height in pixels.

### getHeight

    public int getHeight()

  Get the height of image.

  Returns:
    height in pixels.

### getFilteredHeight

    public int getFilteredHeight()

  Get the height of image after a filter was applied.

  Returns:
    filteredHeight in pixels.

### setWidth

    public void setWidth(int value)

  Set width of image.

  Parameters:
    `value` - width in pixels.

### getWidth

    public int getWidth()

  Get width of image.

  Returns:
    width of image in pixels.

### getFilteredWidth

    public int getFilteredWidth()

  Get width of image, after a filter is applied.

  Returns:
    filteredWidth of image in pixels.

### setBits

    public void setBits(byte[] values)

  Set the bytes used to create the pixels used to create the image. Used for indexed color model images in OMRaster, and OMBitmaps.

  Parameters:
    `values` - byte values

### getBits

    public byte[] getBits()

  Get the byte values for indexed color model images and OMBitmaps.

  Returns:
    the bytes used to create the pixels.

### setImageFilter

    public void setImageFilter(java.awt.image.ImageFilter filter)

  Set a filter to be used on the constructed image. Applied at generate().

  Parameters:
    `filter` - Image filter to apply to constructed raster.

### getImageFilter

    public java.awt.image.ImageFilter getImageFilter()

  Return the image filter used on the image.

  Returns:
    imagefilter, null if one wasn't set.

### scaleTo

    public void scaleTo(int w,
                        int h,
                        int algorithmType)

  Convenience function to scale the Image to the xy size. Sets the imageFilter to a ReplicateScaleFilter or AreaAveragingScaleFilter, depending on the algorithm type.

  Parameters:
    `w` - width to scale to, in pixels
    `h` - height to scale to, in pixels
    `algorithmType` - OMRasterObject parameter describing which scaling algorithm to use.

### filterImage

    protected java.awt.Image filterImage(java.awt.Image image)

  A method used to manipulate the image according to the parameters set by the imageFilter in the OMRasterObject. Called from generate() if the filteredWidth and filteredHeight differ from width and height.

  Parameters:
    `image` - the Image to filter
  Returns:
    the filtered image.

### imageUpdate

    public boolean imageUpdate(java.awt.Image img,
                               int infoflags,
                               int x,
                               int y,
                               int width,
                               int height)

  From the Image Observer Interface. Called when the image bits have arrived, and therefore calls setImage() to reset all the OMRasterObject parameters.
  Don't call this method!

  Specified by:
    `imageUpdate` in interface `java.awt.image.ImageObserver`

### hasLineTypeChoice

    public boolean hasLineTypeChoice()

  Description copied from class: `OMGraphicAdapter`
  Used by the GraphicAttributes object to provide a choice on whether the line type choice can be changed.

  Specified by:
    `hasLineTypeChoice` in interface `OMGraphic`
  Overrides:
    `hasLineTypeChoice` in class `OMGraphicAdapter`

### restore

    public void restore(OMGeometry source)

  Description copied from class: `OMGraphicAdapter`
  Takes the generic OMGraphic settings from another OMGraphic and pushes them to this one.

  Specified by:
    `restore` in interface `OMGeometry`
  Overrides:
    `restore` in class `OMGraphicAdapter`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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