ImageService

com.j0h1.contour.admin.client.service

## Interface ImageService

- All Superinterfaces:
    com.google.gwt.user.client.rpc.RemoteService
  All Known Implementing Classes:
    ImageServiceImpl

      @RemoteServiceRelativePath(value="images")
      public interface ImageService
      extends com.google.gwt.user.client.rpc.RemoteService

  Remote service interface, defining methods to handle RPC calls from the client, concerning Image objects.
  Author:
    Johannes Riedmann

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(int imageId)` Calls DAOImage to delete an image.
    `java.util.ArrayList<Image>` | `findAll()` Returns all non-deleted images (deleted flag not set) persisted on database.
    `java.lang.String` | `generateEdgeImage(java.lang.String originalImage, java.lang.String fileEnding, int threshold)` Generates base64 encoded edge image content, based on an input image and a threshold using OpenCV.
    `void` | `persist(java.lang.String titleEN, java.lang.String titleDE, java.lang.String originalImage, java.lang.String edgeImage)` Calls DAOImage to persist an image, along with its edge image to the database.

- - ### Method Detail

    - #### persist

          void persist(java.lang.String titleEN,
                       java.lang.String titleDE,
                       java.lang.String originalImage,
                       java.lang.String edgeImage)
                throws DAOImageException

      Calls DAOImage to persist an image, along with its edge image to the database.
      Parameters:
        `titleEN` - English title of image.
        `titleDE` - German title of image.
        `originalImage` - Content of the original image (pre-images-processing).
        `edgeImage` - Content of edge image.
      Throws:
        `DAOImageException` - If persistence fails to write images to database, provide specific feedback.

    - #### delete

          void delete(int imageId)
               throws DAOImageException

      Calls DAOImage to delete an image.
      Parameters:
        `imageId` - ID of image to be deleted.
      Throws:
        `DAOImageException` - If deletion of image fails (provides specific feedback).

    - #### generateEdgeImage

          java.lang.String generateEdgeImage(java.lang.String originalImage,
                                             java.lang.String fileEnding,
                                             int threshold)

      Generates base64 encoded edge image content, based on an input image and a threshold using OpenCV.
      Parameters:
        `originalImage` - Content data of original image (pre-image-processing).
        `fileEnding` - Type of image file (jpg/png) needed for OpenCV image encoding.
        `threshold` - Lower threshold used by OpenCV's edge detection algorithm.
      Returns:
        Base64 encoded content data of edge image.

    - #### findAll

          java.util.ArrayList<Image> findAll()
                                      throws DAOImageException

      Returns all non-deleted images (deleted flag not set) persisted on database.
      Returns:
        List of non-deleted Image objects
      Throws:
        `DAOImageException` - if DAOImage fails to receive information from database