Search in sources :

Example 1 with Section

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

the class MDRHeader method setItemSize.

public void setItemSize(int sectionNumber, int itemSize) {
    Section section = sections[sectionNumber];
    section.setItemSize((char) itemSize);
}
Also used : Section(uk.me.parabola.imgfmt.app.Section)

Example 2 with Section

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

the class TREFileReader method getCopyrights.

public String[] getCopyrights(LBLFileReader lblReader) {
    Section sect = header.getCopyrightSection();
    ImgFileReader reader = getReader();
    List<String> msgs = new ArrayList<>();
    long pos = sect.getPosition();
    while (pos < sect.getEndPos()) {
        reader.position(pos);
        int offset = reader.get3();
        Label label = lblReader.fetchLabel(offset);
        if (label != null) {
            msgs.add(label.getText());
        }
        pos += sect.getItemSize();
    }
    return msgs.toArray(new String[msgs.size()]);
}
Also used : ArrayList(java.util.ArrayList) Label(uk.me.parabola.imgfmt.app.Label) ImgFileReader(uk.me.parabola.imgfmt.app.ImgFileReader) BufferedImgFileReader(uk.me.parabola.imgfmt.app.BufferedImgFileReader) Section(uk.me.parabola.imgfmt.app.Section)

Example 3 with Section

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

the class TYPFile method zapZero.

private void zapZero(Section... sect) {
    for (Section s : sect) {
        if (s.getSize() == 0) {
            s.setPosition(0);
            s.setItemSize((char) 0);
        }
    }
}
Also used : Section(uk.me.parabola.imgfmt.app.Section)

Example 4 with Section

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

the class MDRHeader method setEnd.

public void setEnd(int sectionNumber, int position) {
    Section s = sections[sectionNumber];
    s.setSize(position - s.getPosition());
}
Also used : Section(uk.me.parabola.imgfmt.app.Section)

Example 5 with Section

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

the class MDRHeader method setExtraValue.

public void setExtraValue(int sectionNumber, int extraValue) {
    Section section = sections[sectionNumber];
    section.setExtraValue(extraValue);
}
Also used : Section(uk.me.parabola.imgfmt.app.Section)

Aggregations

Section (uk.me.parabola.imgfmt.app.Section)8 BufferedImgFileWriter (uk.me.parabola.imgfmt.app.BufferedImgFileWriter)2 ImgFileWriter (uk.me.parabola.imgfmt.app.ImgFileWriter)2 SectionWriter (uk.me.parabola.imgfmt.app.SectionWriter)2 ArrayList (java.util.ArrayList)1 BufferedImgFileReader (uk.me.parabola.imgfmt.app.BufferedImgFileReader)1 ImgFileReader (uk.me.parabola.imgfmt.app.ImgFileReader)1 Label (uk.me.parabola.imgfmt.app.Label)1