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.image
Class XBMFile

    java.lang.Object
      com.bbn.openmap.image.XBMFile

public class XBMFile
extends java.lang.Object

XBMFile is a class which reads in a bitmap file, and provides the parameters of the file. If called from the command line, it draws the bitmap to the command line using spaces and asterisks. It just needs a valid path to a bitmap file, either a .xbm or .bm format, or a File object for a bitmap file.

Field Summary
`byte[]` | `bits`
`java.io.File` | `f`
`short` | `height`
`int` | `paddedWidth`
`short` | `width`

Constructor Summary
`XBMFile(java.io.File fileObj)`
`XBMFile(short w, short h, byte[] b)` This method leaves all to the caller, by creating a bitmap from scratch.
`XBMFile(java.lang.String filename)`

Method Summary
`static void` | `main(java.lang.String[] args)` The main function just prints the bitmap to stdout.
`void` | `printout()` Prints the bitmap to stdout, using * and spaces
`void` | `setBits(java.lang.String tmpString)` Setting the bits based on a string of 0x00 numbers.

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

Field Detail

### f

    public java.io.File f

### width

    public short width

### height

    public short height

### bits

    public byte[] bits

### paddedWidth

    public int paddedWidth

Constructor Detail

### XBMFile

    public XBMFile(java.lang.String filename)

### XBMFile

    public XBMFile(java.io.File fileObj)

### XBMFile

    public XBMFile(short w,
                   short h,
                   byte[] b)

  This method leaves all to the caller, by creating a bitmap from scratch. Any modification to the bits must take into account the paddedWidth of the bitmap. The paddedWidth is only a factor of the width is is not an even multiple of eight. So, if you want to change the bits settings, you'll have to do the counting yourself, and remember it's little endian, and done by the byte.

Parameters:
  `h` - Height of bitmap.
  `w` - Width of bitmap.
  `b` - byte string representing the pixels.

Method Detail

### setBits

    public void setBits(java.lang.String tmpString)

  Setting the bits based on a string of 0x00 numbers. Assumes that the length of the tmpString is sufficient as dictated by the height and width settings.

### printout

    public void printout()

  Prints the bitmap to stdout, using * and spaces

### main

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

  The main function just prints the bitmap to stdout. parameters: args is the path to the file

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