Search in sources :

Example 1 with ImageBand

use of org.codice.imaging.nitf.core.image.ImageBand in project alliance by codice.

the class TreUtilityTest method createImageBand.

public static ImageBand createImageBand() {
    ImageBand imageBand = mock(ImageBand.class);
    when(imageBand.getImageRepresentation()).thenReturn("RGB");
    when(imageBand.getSubCategory()).thenReturn("XXX");
    return imageBand;
}
Also used : ImageBand(org.codice.imaging.nitf.core.image.ImageBand)

Example 2 with ImageBand

use of org.codice.imaging.nitf.core.image.ImageBand 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

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