|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.stanford.hci.r3.pattern.PatternPackage
public class PatternPackage
Represents a set of pattern files. One can tile these files, and create Postscript and PDF files out of them. This package can load specific pattern files into byte[][] so that you can index them for drawing on screen or into little graphics that represent pattern buttons.
All interaction with the specific pattern files should go in this class. This class also contains the mapping between Streamed Pattern Coordinates and Batched Coordinates (from docking the pen). This mapping is read from the XML file, and determined experimentally, by the Calibration classes.
This software is distributed under the BSD License.
Constructor Summary | |
---|---|
PatternPackage(java.io.File location)
|
Method Summary | |
---|---|
static java.util.Map<java.lang.String,PatternPackage> |
getAvailablePatternPackages(java.io.File patternLocation)
|
PatternDots |
getMinPatternX()
|
PatternDots |
getMinPatternY()
|
java.lang.String |
getName()
|
double |
getNumDotsHorizontalBetweenPages()
|
double |
getNumDotsVerticalBetweenPages()
|
int |
getNumPatternColsPerFile()
|
int |
getNumPatternRowsPerFile()
|
StreamedPatternCoordinates |
getPatternCoordinateOfOriginOfFile(int patternFileNumber)
Given a starting pattern file, we can determine the origin (top left corner) based on our knowledge of the origin of the first file, and the distance between each file. |
java.lang.String[] |
readPatternFromFile(int numPatternFile,
Units originX,
Units originY,
Units width,
Units height)
We verify that numDotsX and numDotsY do not exceed the amount of dots in one file. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PatternPackage(java.io.File location)
location
- this directory contains .pattern files (text files that contain the pattern as
described by Anoto) and a config.xml file, which describes the physical
coordinates, among other things.Method Detail |
---|
public static java.util.Map<java.lang.String,PatternPackage> getAvailablePatternPackages(java.io.File patternLocation)
public PatternDots getMinPatternX()
public PatternDots getMinPatternY()
public java.lang.String getName()
public double getNumDotsHorizontalBetweenPages()
public double getNumDotsVerticalBetweenPages()
public int getNumPatternColsPerFile()
public int getNumPatternRowsPerFile()
public StreamedPatternCoordinates getPatternCoordinateOfOriginOfFile(int patternFileNumber)
patternFileNumber
-
public java.lang.String[] readPatternFromFile(int numPatternFile, Units originX, Units originY, Units width, Units height)
numPatternFile
- The number of the pattern file (numPatternFile.pattern).originX
- Which column of pattern to start from (0 dots is the leftmost column)originY
- Which row of pattern to start reading from (0 dots is the topmost column)width
- How many dots across do we need? (in whatever Units is most convenient for you)height
- How many dots down do we need?
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
Copyright 2006 Stanford University | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |