use of uk.me.parabola.imgfmt.app.typ.TypPoint in project mkgmap by openstreetmap.
the class TypTextReaderTest method testZeroColourBug.
@Test
public void testZeroColourBug() {
String s = "[_point]\n" + "Type=0x01e\n" + "SubType=0x00\n" + "String1=0x04,island\n" + "DayXpm=\"5 5 1 1\" Colormode=32\n" + "\"! c #000000\" canalalpha=15\n" + "\"!!!!!\"\n" + "\"!!!!!\"\n" + "\"!!!!!\"\n" + "\"!!!!!\"\n" + "\"!!!!!\"\n" + "[end]";
tr = makeTyp(s);
TypData data = tr.getData();
TypPoint point = data.getPoints().get(0);
ArrayImgWriter w = new ArrayImgWriter();
point.write(w, data.getEncoder());
byte[] out = w.getBytes();
assertEquals("width", 5, out[1]);
assertEquals("height", 5, out[2]);
assertEquals("number of colours", 1, out[3]);
}
use of uk.me.parabola.imgfmt.app.typ.TypPoint in project mkgmap by openstreetmap.
the class TypTextReaderTest method testPointWithAlpha.
@Test
public void testPointWithAlpha() {
TestUtils.registerFile("hello");
TypTextReader tr = makeTyp("[_point]\n" + "Type=0x12\n" + "SubType=0x01\n" + ";23E6\n" + ";size: 45\n" + "String1=0x4,Mini round\n" + "String2=0x1,Mini rond-point\n" + "ExtendedLabels=N\n" + "DayXpm=\"9 9 10 1\"\n" + "\"$ c none\"\n" + "\"% c #808080\" alpha=14\n" + "\"& c #808080\"\n" + "\"' c #808080\" alpha=15\n" + "\"( c #808080\" alpha=8\n" + "\") c #F0F7FF\"\n" + "\"* c #808080\" alpha=4\n" + "\"+ c #808080\" alpha=11\n" + "\", c #808080\" alpha=12\n" + "\"- c #808080\" alpha=13\n" + "\"$%&&&&&'$\"\n" + "\"(&&&)&&&*\"\n" + "\"&&)))))&&\"\n" + "\"&&)&&&)&&\"\n" + "\"&))&)&))&\"\n" + "\"&&)&&&)&&\"\n" + "\"&&)))))&&\"\n" + "\"+&&&)&&&,\"\n" + "\"$-&&&&&-$\"\n" + "[end]");
TypData data = tr.getData();
TypPoint point = data.getPoints().get(0);
ArrayImgWriter w = new ArrayImgWriter();
point.write(w, data.getEncoder());
System.out.println("size " + w.getSize());
try (OutputStream os = new FileOutputStream("hello")) {
os.write(w.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
assertEquals(115, w.getBytes().length);
}
Aggregations