예제 #1
0
    def convert(self, image_container):
        """
        :param image_container: The image container with image data to convert
        :type image_container: ImageContainer

        :return: A new ImageContainer with the converted underlying data
        :rtype: ImageContainer

        """
        ci_convert = self.MAPTK_LIB["maptk_algorithm_convert_image_convert"]
        ci_convert.argtypes = [self.C_TYPE_PTR, ImageContainer.C_TYPE_PTR, MaptkErrorHandle.C_TYPE_PTR]
        ci_convert.restype = ImageContainer.C_TYPE_PTR
        with MaptkErrorHandle() as eh:
            return ImageContainer.from_c_pointer(ci_convert(self, image_container, eh))
예제 #2
0
    def convert(self, image_container):
        """
        :param image_container: The image container with image data to convert
        :type image_container: ImageContainer

        :return: A new ImageContainer with the converted underlying data
        :rtype: ImageContainer

        """
        ci_convert = self.MAPTK_LIB['maptk_algorithm_convert_image_convert']
        ci_convert.argtypes = [self.C_TYPE_PTR, ImageContainer.C_TYPE_PTR,
                               MaptkErrorHandle.C_TYPE_PTR]
        ci_convert.restype = ImageContainer.C_TYPE_PTR
        with MaptkErrorHandle() as eh:
            return ImageContainer.from_c_pointer(
                ci_convert(self, image_container, eh)
            )
예제 #3
0
    def load(self, filepath):
        """
        Load an image into a ImageContainer

        :param filepath: Path to the image to load
        :type filepath: str

        :return: New ImageContainer containing the loaded image
        :rtype: ImageContainer

        """
        iio_load = self.MAPTK_LIB.maptk_algorithm_image_io_load
        iio_load.argtypes = [self.C_TYPE_PTR, ctypes.c_char_p,
                             MaptkErrorHandle.C_TYPE_PTR]
        iio_load.restype = ImageContainer.C_TYPE_PTR
        with MaptkErrorHandle() as eh:
            ic_ptr = iio_load(self, filepath, eh)
        return ImageContainer.from_c_pointer(ic_ptr)