import cv2
import numpy as np
import requests
# from abc import ABC, abstractmethod


class IIIFAbstractManifest:
    """
    A class for handling IIIF manifests for further processing.
    """
    def __init__(self, manifest_url):
        self.manifest = requests.get(manifest_url).json()

    @property
    def manifest(self):
        return self._manifest

    @manifest.setter
    def manifest(self, man):
        self._manifest = man

    def get_image(self, index):
        image_uri = self.manifest['sequences']['canvases'][0]['images'][index]
        return requests.get(image_uri)


class IIIFColorizer(IIIFAbstractManifest):
    pass


class IIIFImageStitcher(IIIFAbstractManifest):
    pass