class ImageGeometryBuilder implements GeometryBuilder {

    @Override
    public Pair<List<Geometry>, List<Geometry>> buildGeometries(PlatformMetadata model, DataTypeInfo uavDataType,
            DataTypeInfo videoLayer)
    {
        String typeKey = videoLayer.getTypeKey();
        if (!myImageManagers.containsKey(typeKey))
        {
            myImageManagers.put(typeKey, new ImageManager(typeKey, null));
        }

        ImageManager imageManager = myImageManagers.get(typeKey);

        boolean isNewGeom = false;
        if (!myGeometries.containsKey(typeKey))
        {
            isNewGeom = true;
            myGeometries.put(typeKey, createGeometry(model, imageManager, videoLayer));
        }

        TileGeometry geometry = myGeometries.get(typeKey);
        List<Geometry> removeGeoms = New.list();
        if (!geometry.getBounds().equals(model.getFootprint()))
        {
            removeGeoms.add(geometry);
            isNewGeom = true;
            geometry = createGeometry(model, imageManager, videoLayer);
            myGeometries.put(typeKey, geometry);
        }
        geometry.getRenderProperties().setOpacity(
                videoLayer.getBasicVisualizationInfo().getTypeOpacity() / (float)ColorUtilities.COLOR_COMPONENT_MAX_VALUE);

        List<Geometry> geometries = New.list();

        if (model instanceof PlatformMetadataAndImage)
        {           
            ByteArrayInputStream stream = new ByteArrayInputStream(((PlatformMetadataAndImage)model).getImageBytes().array());
            try
            {
                ImageIOImage image = ImageIOImage.read(stream);
                image = convertToArgb(image.getAWTImage());
                imageManager.addDirtyRegions(New.list(new ImageManager.DirtyRegion(0, image.getWidth(), 0, image.getHeight())));
                imageManager.setImageData(image);

                if (isNewGeom)
                {
                    geometries.add(geometry);
                }
            }
            catch (IOException e)
            {
                LOGGER.error(e, e);
            }
        }

        return new Pair<>(geometries, removeGeoms);
    }

    public  ImageGeometryBuilder(OrderManagerRegistry orderRegistry);

}