Ejemplo n.º 1
0
  /**
   * Reads a standard PNM file.
   *
   * <p>Creates a <code>ParameterBlockJAI</code> from all supplied arguments except <code>hints
   * </code> and invokes {@link JAI#create(String,ParameterBlock,RenderingHints)}.
   *
   * @see JAI
   * @see ParameterBlockJAI
   * @see RenderedOp
   * @param stream A SeekableStream representing the PNM file.
   * @param hints The <code>RenderingHints</code> to use. May be <code>null</code>.
   * @return The <code>RenderedOp</code> destination.
   * @throws IllegalArgumentException if <code>stream</code> is <code>null</code>.
   */
  public static RenderedOp create(SeekableStream stream, RenderingHints hints) {
    ParameterBlockJAI pb = new ParameterBlockJAI("PNM", RenderedRegistryMode.MODE_NAME);

    pb.setParameter("stream", stream);

    return JAI.create("PNM", pb, hints);
  }
  /**
   * Reflects an image in a specified direction or rotates an image in multiples of 90 degrees.
   *
   * <p>Creates a <code>ParameterBlockJAI</code> from all supplied arguments except <code>hints
   * </code> and invokes {@link JAI#create(String,ParameterBlock,RenderingHints)}.
   *
   * @see JAI
   * @see ParameterBlockJAI
   * @see RenderedOp
   * @param source0 <code>RenderedImage</code> source 0.
   * @param type The The type of flip operation to be performed.
   * @param hints The <code>RenderingHints</code> to use. May be <code>null</code>.
   * @return The <code>RenderedOp</code> destination.
   * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>.
   * @throws IllegalArgumentException if <code>type</code> is <code>null</code>.
   */
  public static RenderedOp create(RenderedImage source0, TransposeType type, RenderingHints hints) {
    ParameterBlockJAI pb = new ParameterBlockJAI("Transpose", RenderedRegistryMode.MODE_NAME);

    pb.setSource("source0", source0);

    pb.setParameter("type", type);

    return JAI.create("Transpose", pb, hints);
  }
  /**
   * Applies a piecewise pixel value mapping.
   *
   * <p>Creates a <code>ParameterBlockJAI</code> from all supplied arguments except <code>hints
   * </code> and invokes {@link JAI#createRenderable(String,ParameterBlock,RenderingHints)}.
   *
   * @see JAI
   * @see ParameterBlockJAI
   * @see RenderableOp
   * @param source0 <code>RenderableImage</code> source 0.
   * @param breakPoints The breakpoint array. May be <code>null</code>.
   * @param hints The <code>RenderingHints</code> to use. May be <code>null</code>.
   * @return The <code>RenderableOp</code> destination.
   * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>.
   */
  public static RenderableOp createRenderable(
      RenderableImage source0, float[][][] breakPoints, RenderingHints hints) {
    ParameterBlockJAI pb = new ParameterBlockJAI("Piecewise", RenderableRegistryMode.MODE_NAME);

    pb.setSource("source0", source0);

    pb.setParameter("breakPoints", breakPoints);

    return JAI.createRenderable("Piecewise", pb, hints);
  }