IImagesServiceFactory (Google App Engine API for Java)

com.google.appengine.api.images

Interface IImagesServiceFactory

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      ImagesService getImagesService()
      Creates an implementation of the ImagesService.
      Composite makeComposite(Image image, int xOffset, int yOffset, float opacity, Composite.Anchor anchor)
      Creates an image composition operation.
      CompositeTransform makeCompositeTransform()
      Creates a composite transform that can represent multiple transforms applied in series.
      CompositeTransform makeCompositeTransform(java.util.Collection<Transform> transforms)
      Creates a composite transform that can represent multiple transforms applied in series.
      Transform makeCrop(double leftX, double topY, double rightX, double bottomY)
      Creates a transform that will crop an image to fit within the bounding box specified.
      Transform makeCrop(float leftX, float topY, float rightX, float bottomY)
      Creates a transform that will crop an image to fit within the bounding box specified.
      Transform makeHorizontalFlip()
      Creates a transform that will horizontally flip an image.
      Image makeImage(byte[] imageData)
      Creates an image from the provided imageData.
      Image makeImageFromBlob(BlobKey blobKey)
      Create an image backed by the specified blobKey.
      Image makeImageFromFilename(java.lang.String filename)
      Create an image backed by the specified filename.
      Transform makeImFeelingLucky()
      Creates a transform that automatically adjust contrast and color levels.
      Transform makeResize(int width, int height)
      Creates a transform that will resize an image to fit within a box with width width and height height.
      Transform makeResize(int width, int height, boolean allowStretch)
      Creates a resize transform that will resize an image to fit within a box of width width and height height.
      Transform makeResize(int width, int height, double cropOffsetX, double cropOffsetY)
      Creates a transform that will resize an image to exactly fit a box with width width and height height by resizing to the less constraining dimension and cropping the other.
      Transform makeResize(int width, int height, float cropOffsetX, float cropOffsetY)
      Creates a transform that will resize an image to exactly fit a box with width width and height height by resizing to the less constraining dimension and cropping the other.
      Transform makeRotate(int degrees)
      Creates a transform that rotates an image by degrees degrees clockwise.
      Transform makeVerticalFlip()
      Creates a transform that will vertically flip an image.
    • Method Detail

      • getImagesService

        ImagesService getImagesService()
        Creates an implementation of the ImagesService.
        Returns:
        an images service
      • makeImage

        Image makeImage(byte[] imageData)
        Creates an image from the provided imageData.
        Parameters:
        imageData - image data to store in the image
        Returns:
        an Image containing the supplied image data
        Throws:
        java.lang.IllegalArgumentException - If imageData is null or empty.
      • makeImageFromBlob

        Image makeImageFromBlob(BlobKey blobKey)
        Create an image backed by the specified blobKey. Note that the returned Image object can be used with all ImagesService methods, but most of the methods on the Image itself will currently throw UnsupportedOperationException.
        Parameters:
        blobKey - referencing the image
        Returns:
        an Image that references the specified blob data
      • makeImageFromFilename

        Image makeImageFromFilename(java.lang.String filename)
        Create an image backed by the specified filename. Note that the returned Image object can be used with all ImagesService methods, but most of the methods on the Image itself will currently throw UnsupportedOperationException.
        Parameters:
        filename - referencing the image. Currently only Google Storage files in the format "/gs/bucket_name/object_name" are supported.
        Returns:
        an Image that references the specified blob data
        Throws:
        java.lang.IllegalArgumentException - If filename is not in the format "/gs/bucket_name/object_name".
        BlobstoreFailureException - If there is an error obtaining the Google Storage access token for the filename.
      • makeResize

        Transform makeResize(int width,
                             int height)
        Creates a transform that will resize an image to fit within a box with width width and height height.
        Parameters:
        width - width of the bounding box
        height - height of the bounding box
        Returns:
        a resize transform
        Throws:
        java.lang.IllegalArgumentException - If width or height are negative or greater than MAX_RESIZE_DIMENSIONS or if both width and height are 0.
      • makeResize

        Transform makeResize(int width,
                             int height,
                             boolean allowStretch)
        Creates a resize transform that will resize an image to fit within a box of width width and height height. If allowStretch is true, the aspect ratio of the original image will be ignored.
        Parameters:
        width - width of the bounding box
        height - height of the bounding box
        allowStretch - allow the image to be resized ignoring the aspect ratio
        Returns:
        a resize transform
        Throws:
        java.lang.IllegalArgumentException - If width or height are negative or greater than MAX_RESIZE_DIMENSIONS, if both width and height are 0 or if allowStretch is True and either width or height are 0.
      • makeResize

        Transform makeResize(int width,
                             int height,
                             float cropOffsetX,
                             float cropOffsetY)
        Creates a transform that will resize an image to exactly fit a box with width width and height height by resizing to the less constraining dimension and cropping the other. The center of the crop region is controlled by cropOffsetX and cropOffsetY.
        Parameters:
        width - width of the bounding box
        height - height of the bounding box
        cropOffsetX - the relative horizontal position of the center
        cropOffsetY - the relative vertical position of the center
        Returns:
        a resize transform
        Throws:
        java.lang.IllegalArgumentException - If width or height are negative or greater than MAX_RESIZE_DIMENSIONS, if either of width and height are 0 or if cropOffsetX or cropOffsetY are outside the range 0.0 to 1.0.
      • makeResize

        Transform makeResize(int width,
                             int height,
                             double cropOffsetX,
                             double cropOffsetY)
        Creates a transform that will resize an image to exactly fit a box with wid