com.supermap.services.providers.aggregation

Class ImageTool

  • java.lang.Object
    • com.supermap.services.providers.aggregation.ImageTool


  • public final class ImageTool
    extends java.lang.Object
    

    Picture overlay tool.

    Used to handle the stacking of different images. Such as the two pictures will be combined to the specified format output into a new picture.

    • Constructor Summary

      Constructors 
      Constructor and Description
      ImageTool() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.io.InputStream getInputStream(java.lang.String sourceUri)
      Obtain the corresponding input stream object according to the file address.
      static void merge(java.awt.image.BufferedImage src, java.awt.image.BufferedImage baseImage, java.lang.String target, java.lang.String format)
      Image aggregation.
      static void merge(java.io.InputStream inputStream, java.io.InputStream baseInputStream, java.io.OutputStream os, java.lang.String format)
      After the image stream pointed to by the parameter inputStream is aggregated with the picture stream specified by the baseInputStream parameter, the new picture is output to the picture stream developed by the parameter os.
      static void merge(java.lang.String source, java.lang.String base, java.lang.String target, java.lang.String format)
      After the new source image pointed to by the parameter source is merged with the base picture pointed to by the parameter base, the new image is output to the file pointed to by the parameter target in the format set by the parameter format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageTool

        public ImageTool()
        
    • Method Detail

      • merge

        public static void merge(java.lang.String source,
                 java.lang.String base,
                 java.lang.String target,
                 java.lang.String format)
        

        After the new source image pointed to by the parameter source is merged with the base picture pointed to by the parameter base, the new image is output to the file pointed to by the parameter target in the format set by the parameter format.

        Parameters:
        source - New source image path.
        base - The path of the underlying picture.
        outputPath - The path of new image after overlays the map image.
        format - Image format. The default is PNG format.
      • merge

        public static void merge(java.io.InputStream inputStream,
                 java.io.InputStream baseInputStream,
                 java.io.OutputStream os,
                 java.lang.String format)
                          throws java.io.IOException
        

        After the image stream pointed to by the parameter inputStream is aggregated with the picture stream specified by the baseInputStream parameter, the new picture is output to the picture stream developed by the parameter os.

        Parameters:
        inputStream - New source image stream, aggregated at the top.
        inputStream - The base picture stream is aggregated at the bottom.
        os - Image output stream
        format - Image output format.
        Throws:
        java.io.IOException - IO Exception
      • merge

        public static void merge(java.awt.image.BufferedImage src,
                 java.awt.image.BufferedImage baseImage,
                 java.lang.String target,
                 java.lang.String format)
        

        Image aggregation.

        Parameters:
        src - New source picture, aggregated at the top layer.
        inputStream - Base picture, aggregated at the bottom layer.
        outputPath - The path of new image after overlays the map image.
        format - Image format.
      • getInputStream

        public static java.io.InputStream getInputStream(java.lang.String sourceUri)
        

        Obtain the corresponding input stream object according to the file address.

        Parameters:
        sourceUri - Document address.
        Returns:
        returns the input stream object. Returns null if the parameter sourceUri is empty.