java.lang.Object
com.port80.eclipse.util.XPMFile
- public class XPMFile
- extends java.lang.Object
Straightforward XPM file parser, which is unusually strict, but
serves its purpose for most XPM files.
HISTORY:
. Switch back to use transparentPixel.
alphaData is 10 times slower than maskData in SWT GC.drawImage() !
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
private static final java.lang.String NAME
- See Also:
- Constant Field Values
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
fFilename
private java.lang.String fFilename
fReader
private java.io.BufferedReader fReader
fRows
private int fRows
fColumns
private int fColumns
fColors
private int fColors
fColorChars
private int fColorChars
fColorTable
private com.port80.util.struct.IntValueHashMap fColorTable
fTransparentSymbol
private java.lang.String fTransparentSymbol
fTransparent
private int fTransparent
fData
private int[] fData
XPMFile
public XPMFile(java.lang.String filename)
XPMFile
public XPMFile(java.net.URL url)
getFilename
public java.lang.String getFilename()
getData
public int[] getData()
getRowCount
public int getRowCount()
getColumnCount
public int getColumnCount()
getTransparentColor
public int getTransparentColor()
openFile
private void openFile(java.lang.String filename)
loadFile
private boolean loadFile(java.net.URL url)
loadFile
private boolean loadFile(java.lang.String filename)
parseFile
private void parseFile()
throws java.io.IOException
readMetaData
private void readMetaData(java.lang.String line)
throws java.io.IOException
readColor
private void readColor()
throws java.io.IOException
- Read a color row and remember it in the color table.
readImageRow
private void readImageRow(int row)
throws java.io.IOException
convertColorString
private int convertColorString(java.lang.String colString)
main
public static void main(java.lang.String[] args)
throws java.io.IOException