Creates an {@link ImageBorder} that returns the specified value always.

@see ImageBorderValue

@param image The image the border is being created for.
@param value The value which will be returned.
@return An {@link ImageBorder}
166842
public static <T extends ImageInterleaved<T>> ImageBorder<T> interleavedValue(T image, double value) {
		ImageBorder border = interleavedValue(image.getClass(), value);
		border.setImage(image);
		return border;
	}
1077402
public static Image getInstance(Image image) {
		if (image == null)
			return null;
		try {
			Class cs = image.getClass();
			Constructor constructor = cs
					.getDeclaredConstructor(new Class[] { Image.class });
			return (Image) constructor.newInstance(new Object[] { image });
		} catch (Exception e) {
			throw new ExceptionConverter(e);
		}
	}
1135431
public EmbedBuilder setImage(InputStream image, String fileType) {
        delegate.setImage(image, fileType);
        return this;
    }
75438
public BufferedImage createImage (int width, int height, int trans)
    {
        // DEBUG: override transparency for the moment on all images
        trans = Transparency.TRANSLUCENT;
        if (_gc != null) {
            return _gc.createCompatibleImage(width, height, trans);
        } else {
            // if we're running in headless mode, do everything in 24-bit
            return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        }
    }
337511
private BufferedImage create_BACKGROUND_Image(final int WIDTH, BufferedImage image) {
        if (WIDTH <= 0) {
            return null;
        }
        if (image == null) {
            image = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT);
        }
        final Graphics2D G2 = image.createGraphics();
        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        switch (getFrameType()) {
            case SQUARE:
                BACKGROUND_FACTORY.createLinearBackground(WIDTH, WIDTH, getBackgroundColor(), getCustomBackground(), getModel().getTextureColor(), image);
                break;
            case ROUND:

            default:
                BACKGROUND_FACTORY.createRadialBackground(WIDTH, getBackgroundColor(), getCustomBackground(), getModel().getTextureColor(), image);
                break;
        }
        G2.dispose();

        return image;
    }
654999
public static <T extends ImageBase<T>> InterpolatePixelMB<T>
	createPixelMB(double min, double max, InterpolationType type, BorderType borderType, ImageType<T> imageType )
	{
		switch (imageType.getFamily()) {

			case PLANAR:
				return (InterpolatePixelMB<T>) createPixelPL((InterpolatePixelS)createPixelS(min, max, type, borderType, imageType.getDataType()));

			case GRAY:{
				InterpolatePixelS interpS = createPixelS(min,max,type,borderType,imageType.getImageClass());
				return new InterpolatePixel_S_to_MB(interpS);
			}

			case INTERLEAVED:
				switch( type ) {
					case NEAREST_NEIGHBOR:
						return nearestNeighborPixelMB((ImageType) imageType, borderType);

					case BILINEAR:
						return bilinearPixelMB((ImageType)imageType,borderType);

					default:
						throw new IllegalArgumentException("Interpolate type not yet support for ImageInterleaved");
				}

			default:
				throw new IllegalArgumentException("Add type: "+type);
		}
	}
460518
public Object getImageIcon(Object value)
    {
        int index = 0;
        if (value instanceof Integer)
            index = ((Integer)value).intValue();
        else if (value != null)
        {
            try {
                index = Integer.parseInt(value.toString());
            } catch (NumberFormatException ex) {
            }
        }
        return this.getIcon(index);
    }
873845
public static Image makeActionImage (Image image, String tip, ClickHandler onClick)
    {
        if (tip != null) {
            image.setTitle(tip);
        }
        return makeActionable(image, onClick, null);
    }
572536
private BufferedImage create_BACKGROUND_Image(final int WIDTH, BufferedImage image) {
        if (WIDTH <= 0) {
            return null;
        }
        if (image == null) {
            image = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT);
        }
        final Graphics2D G2 = image.createGraphics();
        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        //G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        //G2.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
        //G2.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
        //G2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        //G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        //G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        final int IMAGE_WIDTH = image.getWidth();
        final int IMAGE_HEIGHT = image.getHeight();

        final Ellipse2D E_GAUGE_BACKGROUND = new Ellipse2D.Double(IMAGE_WIDTH * 0.08411215245723724, IMAGE_HEIGHT * 0.08411215245723724, IMAGE_WIDTH * 0.8317756652832031, IMAGE_HEIGHT * 0.8317756652832031);
        final Point2D E_GAUGE_BACKGROUND_START = new Point2D.Double(0, E_GAUGE_BACKGROUND.getBounds2D().getMinY());
        final Point2D E_GAUGE_BACKGROUND_STOP = new Point2D.Double(0, E_GAUGE_BACKGROUND.getBounds2D().getMaxY());
        final float[] E_GAUGE_BACKGROUND_FRACTIONS = {
            0.0f,
            1.0f
        };
        final Color[] E_GAUGE_BACKGROUND_COLORS = {
            new Color(0x001F04),
            new Color(0x013505)
        };
        final LinearGradientPaint E_GAUGE_BACKGROUND_GRADIENT = new LinearGradientPaint(E_GAUGE_BACKGROUND_START, E_GAUGE_BACKGROUND_STOP, E_GAUGE_BACKGROUND_FRACTIONS, E_GAUGE_BACKGROUND_COLORS);
        G2.setPaint(E_GAUGE_BACKGROUND_GRADIENT);
        G2.fill(E_GAUGE_BACKGROUND);

        final Ellipse2D E_GAUGE_INNERSHADOW = new Ellipse2D.Double(IMAGE_WIDTH * 0.08411215245723724, IMAGE_HEIGHT * 0.08411215245723724, IMAGE_WIDTH * 0.8317756652832031, IMAGE_HEIGHT * 0.8317756652832031);
        final Point2D E_GAUGE_INNERSHADOW_CENTER = new Point2D.Double((0.5 * IMAGE_WIDTH), (0.5 * IMAGE_HEIGHT));
        final float[] E_GAUGE_INNERSHADOW_FRACTIONS = {
            0.0f,
            0.7f,
            0.71f,
            1.0f
        };
        final Color[] E_GAUGE_INNERSHADOW_COLORS = {
            new Color(0, 90, 40, 0),
            new Color(0, 90, 40, 0),
            new Color(0, 90, 40, 0),
            new Color(0, 90, 40, 76)
        };
        final RadialGradientPaint E_GAUGE_INNERSHADOW_GRADIENT = new RadialGradientPaint(E_GAUGE_INNERSHADOW_CENTER, (float) (0.4158878504672897 * IMAGE_WIDTH), E_GAUGE_INNERSHADOW_FRACTIONS, E_GAUGE_INNERSHADOW_COLORS);
        G2.setPaint(E_GAUGE_INNERSHADOW_GRADIENT);
        G2.fill(E_GAUGE_INNERSHADOW);

        G2.dispose();

        return image;
    }
1344319
public short getPixelValue(BufferedImage image, int x, int y) {
		validateImageType(image);
		WritableRaster raster = image.getRaster();
		short pixelValue = getPixelValue(raster, x, y);
		return pixelValue;
	}
428712
public JSONObject imageCensorUserDefined(String image, EImgType type, HashMap<String, String> options) {
        if (type == EImgType.FILE) {
            try {
                byte[] imgData = Util.readFileByBytes(image);
                return imageCensorUserDefined(imgData, options);
            } catch (IOException e) {
                return AipError.IMAGE_READ_ERROR.toJsonResult();
            }
        }

        // url
        AipRequest request = new AipRequest();

        request.addBody("imgUrl", image);

        return imageCensorUserDefinedHelper(request, options);
    }
1332033
public void setImage(T image ) {
		match.setInputImage(image);
		this.imageWidth = image.width;
		this.imageHeight = image.height;
	}
991727
private BufferedImage create_POI_Image(final int WIDTH) {
        if (WIDTH <= 0) {
            return null;
        }

        final java.awt.image.BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, java.awt.Transparency.TRANSLUCENT);
        final java.awt.Graphics2D G2 = IMAGE.createGraphics();
        G2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON);
        //G2.setRenderingHint(java.awt.RenderingHints.KEY_RENDERING, java.awt.RenderingHints.VALUE_RENDER_QUALITY);
        //G2.setRenderingHint(java.awt.RenderingHints.KEY_DITHERING, java.awt.RenderingHints.VALUE_DITHER_ENABLE);
        //G2.setRenderingHint(java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, java.awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
        //G2.setRenderingHint(java.awt.RenderingHints.KEY_COLOR_RENDERING, java.awt.RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        G2.setRenderingHint(java.awt.RenderingHints.KEY_STROKE_CONTROL, java.awt.RenderingHints.VALUE_STROKE_NORMALIZE);
        //G2.setRenderingHint(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        final java.awt.geom.Ellipse2D BLIP = new java.awt.geom.Ellipse2D.Double(0, 0, WIDTH, WIDTH);
        final java.awt.geom.Point2D CENTER = new java.awt.geom.Point2D.Double(BLIP.getCenterX(), BLIP.getCenterY());
        final float[] FRACTIONS = {
            0.0f,
            1.0f
        };
        final Color[] COLORS = {
            new Color(1.0f, 1.0f, 1.0f, 0.9f),
            new Color(1.0f, 1.0f, 1.0f, 0.0f)
        };
        final java.awt.RadialGradientPaint GRADIENT = new java.awt.RadialGradientPaint(CENTER, (int) (WIDTH / 2.0), FRACTIONS, COLORS);
        G2.setPaint(GRADIENT);
        G2.fill(BLIP);

        G2.dispose();

        return IMAGE;
    }
879975
public void setImage(T image) {
		blur.reshape(image.width,image.height);
		filterBlur.process(image,blur);
		describe.setImage(image);
	}
1254178
protected static void borderAverageFlow( ImageFlow flow , ImageFlow averageFlow) {

		for( int y = 0; y < flow.height; y++ ) {
			computeBorder(flow,averageFlow, 0, y);
			computeBorder(flow,averageFlow, flow.width-1, y);
		}

		for( int x = 1; x < flow.width-1; x++ ) {
			computeBorder(flow,averageFlow, x, 0);
			computeBorder(flow,averageFlow, x, flow.height-1);
		}
	}
258180
public static boolean hasBorder(Element element) {

        String borderStyle = CmsDomUtil.getCurrentStyle(element, Style.borderStyle);
        if ((borderStyle == null) || borderStyle.equals(StyleValue.none.toString()) || (borderStyle.length() == 0)) {
            return false;
        }
        return true;

    }
486222
public String convert(BufferedImage image, boolean favicon) {
        // Reset statistics before anything
        statsArray = new int[12];
        // Begin the timer
        dStart = System.nanoTime();
        // Scale the image
        image = scale(image, favicon);
        // The +1 is for the newline characters
        StringBuilder sb = new StringBuilder((image.getWidth() + 1) * image.getHeight());

        for (int y = 0; y < image.getHeight(); y++) {
            // At the end of each line, add a newline character
            if (sb.length() != 0) sb.append("\n");
            for (int x = 0; x < image.getWidth(); x++) {
                //
                Color pixelColor = new Color(image.getRGB(x, y), true);
                int alpha = pixelColor.getAlpha();
                boolean isTransient = alpha < 0.1;
                double gValue = isTransient ? 250 : ((double) pixelColor.getRed() * 0.2989 + (double) pixelColor.getBlue() * 0.5870 + (double) pixelColor.getGreen() * 0.1140) / ((double)alpha / (double)250);
                final char s = gValue < 130 ? darkGrayScaleMap(gValue) : lightGrayScaleMap(gValue);
                sb.append(s);
            }
        }
        imgArray = sb.toString().toCharArray();
        dEnd = System.nanoTime();
        return sb.toString();
    }