Search in sources :

Example 21 with ImgFileReader

use of uk.me.parabola.imgfmt.app.ImgFileReader in project mkgmap by openstreetmap.

the class SrtFileReader method readSrt7.

private void readSrt7() {
    ImgFileReader reader = getReader();
    reader.position(tableHeader.getPosition() + srt7.getPosition());
    int block = 1;
    for (int i = 0; i < srt7.getNumItems(); i++) {
        int val = reader.getInt();
        if (val >= 0)
            offsetToBlock.put(val / srt8.getItemSize(), block);
        block++;
    }
}
Also used : ImgFileReader(uk.me.parabola.imgfmt.app.ImgFileReader) BufferedImgFileReader(uk.me.parabola.imgfmt.app.BufferedImgFileReader)

Example 22 with ImgFileReader

use of uk.me.parabola.imgfmt.app.ImgFileReader in project mkgmap by openstreetmap.

the class SrtFileReader method readSrt1.

private void readSrt1() {
    ImgFileReader reader = getReader();
    reader.position(header.getHeaderLength());
    description.readSectionInfo(reader, false);
    tableHeader.readSectionInfo(reader, false);
}
Also used : ImgFileReader(uk.me.parabola.imgfmt.app.ImgFileReader) BufferedImgFileReader(uk.me.parabola.imgfmt.app.BufferedImgFileReader)

Example 23 with ImgFileReader

use of uk.me.parabola.imgfmt.app.ImgFileReader in project mkgmap by openstreetmap.

the class SrtFileReader method readExpansions.

private void readExpansions() {
    ImgFileReader reader = getReader();
    int reclen = srt5.getItemSize();
    reader.position(tableHeader.getPosition() + srt5.getPosition());
    List<CodePosition> expansionList = new ArrayList<>(srt5.getNumItems());
    if (countExp != srt5.getNumItems()) {
        throw new RuntimeException("unexpected number of expansions " + srt5.getNumItems() + " expected: " + countExp);
    }
    for (int i = 0; i < srt5.getNumItems(); i++) {
        CodePosition cp = readCharPosition(reclen);
        expansionList.add(cp);
    }
    sort.setExpansions(expansionList);
}
Also used : ArrayList(java.util.ArrayList) ImgFileReader(uk.me.parabola.imgfmt.app.ImgFileReader) BufferedImgFileReader(uk.me.parabola.imgfmt.app.BufferedImgFileReader)

Aggregations

BufferedImgFileReader (uk.me.parabola.imgfmt.app.BufferedImgFileReader)23 ImgFileReader (uk.me.parabola.imgfmt.app.ImgFileReader)23 Label (uk.me.parabola.imgfmt.app.Label)7 ArrayList (java.util.ArrayList)6 IntArrayList (it.unimi.dsi.fastutil.ints.IntArrayList)2 POIRecord (uk.me.parabola.imgfmt.app.lbl.POIRecord)2 HashSet (java.util.HashSet)1 Section (uk.me.parabola.imgfmt.app.Section)1 CharacterDecoder (uk.me.parabola.imgfmt.app.labelenc.CharacterDecoder)1 CodeFunctions (uk.me.parabola.imgfmt.app.labelenc.CodeFunctions)1 DecodedText (uk.me.parabola.imgfmt.app.labelenc.DecodedText)1