use of org.codice.imaging.nitf.core.tre.TreCollection in project alliance by codice.
the class TreUtilityTest method createFileHeader.
public static NitfHeader createFileHeader(DateTime fileDateTime) {
TreCollection treCollection = new TreCollectionImpl();
FileSecurityMetadata securityMetadata = createSecurityMetadata();
NitfHeader nitfHeader = mock(NitfHeader.class);
when(nitfHeader.getFileTitle()).thenReturn("TEST NITF");
when(nitfHeader.getFileType()).thenReturn(FileType.NITF_TWO_ONE);
when(nitfHeader.getComplexityLevel()).thenReturn(1);
when(nitfHeader.getFileDateTime()).thenReturn(fileDateTime);
when(nitfHeader.getOriginatingStationId()).thenReturn("LOCALHOST");
when(nitfHeader.getStandardType()).thenReturn("BF01");
when(nitfHeader.getFileBackgroundColour()).thenReturn(new RGBColourImpl((byte) 0, (byte) 0, (byte) 0));
when(nitfHeader.getOriginatorsName()).thenReturn("");
when(nitfHeader.getOriginatorsPhoneNumber()).thenReturn("");
when(nitfHeader.getFileSecurityMetadata()).thenReturn(securityMetadata);
when(nitfHeader.getTREsRawStructure()).thenReturn(treCollection);
return nitfHeader;
}
use of org.codice.imaging.nitf.core.tre.TreCollection in project alliance by codice.
the class RoutingSlip method tresExist.
private Boolean tresExist(NitfHeader header) {
TreCollection treCollection = header.getTREsRawStructure();
List<Tre> mtirpbList = treCollection.getTREsWithName(MTIRPB);
return !mtirpbList.isEmpty();
}
use of org.codice.imaging.nitf.core.tre.TreCollection in project alliance by codice.
the class CatalogOutputAdapter method copySDEs.
private void copySDEs(TaggedRecordExtensionHandler in, TaggedRecordExtensionHandler out) {
TreCollection treCollection = out.getTREsRawStructure();
in.getTREsRawStructure().getTREs().stream().filter(this::isSdeTre).forEach(treCollection::add);
}
use of org.codice.imaging.nitf.core.tre.TreCollection in project alliance by codice.
the class TreUtilityTest method createImageSegment.
public static ImageSegment createImageSegment(DateTime imageDateTime) {
SecurityMetadata securityMetadata = createSecurityMetadata();
ImageBand imageBand = createImageBand();
ImageSegment imageSegment = mock(ImageSegment.class);
TreCollection treCollection = new TreCollectionImpl();
when(imageSegment.getFileType()).thenReturn(FileType.NITF_TWO_ONE);
when(imageSegment.getNumBands()).thenReturn(3);
when(imageSegment.getActualBitsPerPixelPerBand()).thenReturn(8);
when(imageSegment.getIdentifier()).thenReturn("12345");
when(imageSegment.getImageDateTime()).thenReturn(imageDateTime);
when(imageSegment.getImageTargetId()).thenReturn(new TargetIdImpl());
when(imageSegment.getImageIdentifier2()).thenReturn("");
when(imageSegment.getSecurityMetadata()).thenReturn(securityMetadata);
when(imageSegment.getImageSource()).thenReturn("");
when(imageSegment.getNumberOfRows()).thenReturn(2048L);
when(imageSegment.getNumberOfColumns()).thenReturn(2048L);
when(imageSegment.getPixelValueType()).thenReturn(PixelValueType.INTEGER);
when(imageSegment.getImageRepresentation()).thenReturn(ImageRepresentation.RGBTRUECOLOUR);
when(imageSegment.getImageCategory()).thenReturn(ImageCategory.MULTISPECTRAL);
when(imageSegment.getActualBitsPerPixelPerBand()).thenReturn(8);
when(imageSegment.getPixelJustification()).thenReturn(PixelJustification.LEFT);
when(imageSegment.getImageCoordinatesRepresentation()).thenReturn(ImageCoordinatesRepresentation.NONE);
when(imageSegment.getImageCompression()).thenReturn(ImageCompression.NOTCOMPRESSED);
when(imageSegment.getImageBandZeroBase(anyInt())).thenReturn(imageBand);
when(imageSegment.getImageMode()).thenReturn(ImageMode.BANDSEQUENTIAL);
when(imageSegment.getNumberOfBlocksPerRow()).thenReturn(4);
when(imageSegment.getNumberOfBlocksPerColumn()).thenReturn(4);
when(imageSegment.getNumberOfPixelsPerBlockHorizontal()).thenReturn(512L);
when(imageSegment.getNumberOfPixelsPerBlockVertical()).thenReturn(512L);
when(imageSegment.getImageDisplayLevel()).thenReturn(1);
when(imageSegment.getAttachmentLevel()).thenReturn(2);
when(imageSegment.getImageLocationRow()).thenReturn(0);
when(imageSegment.getImageLocationColumn()).thenReturn(0);
when(imageSegment.getImageMagnification()).thenReturn("1.00");
when(imageSegment.getTREsRawStructure()).thenReturn(treCollection);
return imageSegment;
}
use of org.codice.imaging.nitf.core.tre.TreCollection in project alliance by codice.
the class TreUtilityTest method createFileHeaderWithMtirpb.
public static NitfHeader createFileHeaderWithMtirpb() throws NitfFormatException {
NitfHeader nitfHeader = createFileHeader();
TreCollection treCollection = nitfHeader.getTREsRawStructure();
treCollection.add(createMtirpbTre());
return nitfHeader;
}
Aggregations