Search in sources :

Example 1 with TreCollectionImpl

use of org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl 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;
}
Also used : RGBColourImpl(org.codice.imaging.nitf.core.impl.RGBColourImpl) NitfHeader(org.codice.imaging.nitf.core.header.NitfHeader) TreCollectionImpl(org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl) FileSecurityMetadata(org.codice.imaging.nitf.core.security.FileSecurityMetadata) TreCollection(org.codice.imaging.nitf.core.tre.TreCollection)

Example 2 with TreCollectionImpl

use of org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl in project alliance by codice.

the class CatalogOutputAdapterTest method getImageSegment.

private ImageSegment getImageSegment(long originalWidth, long originalHeight, DateTime dateTime, ImageCoordinates imageCoordinates, SecurityMetadata imageSecurityMetadata) throws NitfFormatException {
    ImageSegment imageSegment = mock(ImageSegment.class);
    when(imageSegment.getImageCoordinates()).thenReturn(imageCoordinates);
    when(imageSegment.getNumberOfColumns()).thenReturn(originalWidth);
    when(imageSegment.getNumberOfRows()).thenReturn(originalHeight);
    when(imageSegment.getImageCategory()).thenReturn(ImageCategory.UNKNOWN);
    when(imageSegment.getImageComments()).thenReturn(Collections.singletonList("MyComment"));
    when(imageSegment.getIdentifier()).thenReturn("0123456789");
    when(imageSegment.getImageIdentifier2()).thenReturn("abc");
    when(imageSegment.getImageMagnification()).thenReturn("1.0 ");
    when(imageSegment.getImageTargetId()).thenReturn(new TargetIdImpl("                 "));
    when(imageSegment.getImageSource()).thenReturn("");
    when(imageSegment.getImageDateTime()).thenReturn(dateTime);
    when(imageSegment.getImageRepresentation()).thenReturn(ImageRepresentation.UNKNOWN);
    when(imageSegment.getSecurityMetadata()).thenReturn(imageSecurityMetadata);
    when(imageSegment.getTREsRawStructure()).thenReturn(new TreCollectionImpl());
    return imageSegment;
}
Also used : ImageSegment(org.codice.imaging.nitf.core.image.ImageSegment) TargetIdImpl(org.codice.imaging.nitf.core.image.impl.TargetIdImpl) TreCollectionImpl(org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl)

Example 3 with TreCollectionImpl

use of org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl in project alliance by codice.

the class CatalogOutputAdapterTest method getNitfHeader.

private NitfHeader getNitfHeader(FileSecurityMetadata fileSecurityMetadata, DateTime dateTime) {
    NitfHeader nitfHeader = mock(NitfHeader.class);
    when(nitfHeader.getFileTitle()).thenReturn("FileTitle");
    when(nitfHeader.getStandardType()).thenReturn("BF01");
    when(nitfHeader.getOriginatingStationId()).thenReturn("U21SOO90");
    when(nitfHeader.getFileBackgroundColour()).thenReturn(new RGBColourImpl((byte) 0, (byte) 0, (byte) 0));
    when(nitfHeader.getFileDateTime()).thenReturn(dateTime);
    when(nitfHeader.getFileSecurityMetadata()).thenReturn(fileSecurityMetadata);
    when(nitfHeader.getOriginatorsName()).thenReturn("W.TEMPEL");
    when(nitfHeader.getOriginatorsPhoneNumber()).thenReturn("44 1480 84 5611");
    when(nitfHeader.getTREsRawStructure()).thenReturn(new TreCollectionImpl());
    return nitfHeader;
}
Also used : RGBColourImpl(org.codice.imaging.nitf.core.impl.RGBColourImpl) NitfHeader(org.codice.imaging.nitf.core.header.NitfHeader) TreCollectionImpl(org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl)

Example 4 with TreCollectionImpl

use of org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl 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;
}
Also used : ImageSegment(org.codice.imaging.nitf.core.image.ImageSegment) ImageBand(org.codice.imaging.nitf.core.image.ImageBand) TargetIdImpl(org.codice.imaging.nitf.core.image.impl.TargetIdImpl) TreCollectionImpl(org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl) SecurityMetadata(org.codice.imaging.nitf.core.security.SecurityMetadata) FileSecurityMetadata(org.codice.imaging.nitf.core.security.FileSecurityMetadata) TreCollection(org.codice.imaging.nitf.core.tre.TreCollection)

Aggregations

TreCollectionImpl (org.codice.imaging.nitf.core.tre.impl.TreCollectionImpl)4 NitfHeader (org.codice.imaging.nitf.core.header.NitfHeader)2 ImageSegment (org.codice.imaging.nitf.core.image.ImageSegment)2 TargetIdImpl (org.codice.imaging.nitf.core.image.impl.TargetIdImpl)2 RGBColourImpl (org.codice.imaging.nitf.core.impl.RGBColourImpl)2 FileSecurityMetadata (org.codice.imaging.nitf.core.security.FileSecurityMetadata)2 TreCollection (org.codice.imaging.nitf.core.tre.TreCollection)2 ImageBand (org.codice.imaging.nitf.core.image.ImageBand)1 SecurityMetadata (org.codice.imaging.nitf.core.security.SecurityMetadata)1