ImageScience 3.0.0

imagescience.transform
Class Embed

java.lang.Object
  extended by imagescience.transform.Embed

public class Embed
extends java.lang.Object

Embeds an image into a larger image.


Field Summary
 double background
          The value used when the background filling is of type BACKGROUND.
static int BACKGROUND
          Background filling with the value of background.
static int CLAMP
          Background filling by clamping the values in the input image.
static int MAXIMUM
          Background filling with the maximum value in the input image.
 Messenger messenger
          The object used for message displaying.
static int MINIMUM
          Background filling with the minimum value in the input image.
static int MIRROR
          Background filling by mirroring the values in the input image.
 Progressor progressor
          The object used for progress displaying.
static int REPEAT
          Background filling by repeating the values in the input image.
static int ZERO
          Background filling with value 0.
 
Constructor Summary
Embed()
          Default constructor.
 
Method Summary
 Image run(Image image, Dimensions dims, Coordinates pos, int type)
          Embeds an image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO

public static final int ZERO
Background filling with value 0.

See Also:
Constant Field Values

MINIMUM

public static final int MINIMUM
Background filling with the minimum value in the input image.

See Also:
Constant Field Values

MAXIMUM

public static final int MAXIMUM
Background filling with the maximum value in the input image.

See Also:
Constant Field Values

BACKGROUND

public static final int BACKGROUND
Background filling with the value of background.

See Also:
Constant Field Values

REPEAT

public static final int REPEAT
Background filling by repeating the values in the input image.

See Also:
Constant Field Values

MIRROR

public static final int MIRROR
Background filling by mirroring the values in the input image.

See Also:
Constant Field Values

CLAMP

public static final int CLAMP
Background filling by clamping the values in the input image.

See Also:
Constant Field Values

background

public double background
The value used when the background filling is of type BACKGROUND. The default value is 0.


messenger

public final Messenger messenger
The object used for message displaying.


progressor

public final Progressor progressor
The object used for progress displaying.

Constructor Detail

Embed

public Embed()
Default constructor.

Method Detail

run

public Image run(Image image,
                 Dimensions dims,
                 Coordinates pos,
                 int type)
Embeds an image.

Parameters:
image - The image to be embedded.
dims - The dimensions of the new image in which the input image is embedded.
pos - The starting position of the input image in the new image.
type - The type of filling of background elements. Must be equal to one of the static fields of this class.
Returns:
A new image with the given dimensions containing a copy of the input image at the given starting position and with the background elements filled as specified. The returned image is of the same type as the input image.
Throws:
java.lang.IllegalArgumentException - If the starting position coordinates are such that the input image does not fit entirely in the new image, or if the specified type of background filling is not supported.
java.lang.NullPointerException - If any of the first three parameters is null.
java.lang.UnknownError - If for any reason the output image can not be created. In most cases this will be due to insufficient free memory.

ImageScience 3.0.0

Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.

IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.

IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.