Module imp3d

Class ImageTool

java.lang.Object
de.grogra.imp3d.anaglyph.ImageTool
Direct Known Subclasses:
StereoImage

public class ImageTool extends Object
Samlung von Methoden fuer Verarbeitung von Bilder

Lizenz:
Diese Klasse wird kostenfrei verbreitet und darf geaendert werden.

Copyright:
by Aleksej Tokarev 2011

Date:
05.11.2011
Version:
1.2
Author:
Aleksej Tokarev
{@link http://atoks.bplaced.net}
  • Field Details

    • ANAGLYPH_RAD_CYAN_COLOR

      public static final int ANAGLYPH_RAD_CYAN_COLOR
      See Also:
    • ANAGLYPH_RAD_CYAN_GRAY

      public static final int ANAGLYPH_RAD_CYAN_GRAY
      See Also:
    • ANAGLYPH_RAD_GREEN_COLOR

      public static final int ANAGLYPH_RAD_GREEN_COLOR
      See Also:
    • ANAGLYPH_RAD_GREEN_GRAY

      public static final int ANAGLYPH_RAD_GREEN_GRAY
      See Also:
    • ANAGLYPH_RAD_BLUE_COLOR

      public static final int ANAGLYPH_RAD_BLUE_COLOR
      See Also:
    • ANAGLYPH_RAD_BLUE_GRAY

      public static final int ANAGLYPH_RAD_BLUE_GRAY
      See Also:
    • ANAGLYPH_YELLOW_BLUE_COLOR

      public static final int ANAGLYPH_YELLOW_BLUE_COLOR
      See Also:
    • ANAGLYPH_YELLOW_BLUE_GRAY

      public static final int ANAGLYPH_YELLOW_BLUE_GRAY
      See Also:
    • ANAGLYPH_LIST

      public static final int[] ANAGLYPH_LIST
  • Constructor Details

    • ImageTool

      public ImageTool()
  • Method Details

    • inverseColor

      public static BufferedImage inverseColor(BufferedImage img)
      Methode kehrt Ausgangsfarbenwerte um
      Parameters:
      img - Bildquelle
      Returns:
      Ergebnisbild mit umgekehrten Farben
    • replaceColor

      public static BufferedImage replaceColor(BufferedImage img, Color mask, Color replacement, double digression)
      Methode ersetzt Farben
      Parameters:
      img - Bildquelle
      mask - Welche Farbe ersetzt werden muss
      replacement - Mit welche Farbe ersetzt werden muss
      digression - Abweichung in % Diference zu "mask"
      Returns:
      Ergebnissbild
    • getBufferedImage

      public static BufferedImage getBufferedImage(InputStream is) throws ImageToolException
      Methode gibt eine BufferedImage aus InputStream
      Parameters:
      is - InputStream mit Image
      Returns:
      BufferedImage
      Throws:
      ImageToolException
    • getBufferedImage

      public static BufferedImage getBufferedImage(URL url) throws ImageToolException
      Methode gibt eine BufferedImage aus URL
      Parameters:
      url - URL mit Image
      Returns:
      BufferedImage
      Throws:
      ImageToolException
    • getBufferedImage

      public static BufferedImage getBufferedImage(String str) throws ImageToolException
      Methode gibt eine BufferedImage aus String adresse. Benutzt new File(str)
      Parameters:
      str - String welche wird als Parameter fuer File genomen
      Returns:
      BufferedImage
      Throws:
      ImageToolException
    • getAnaglyphImage

      public static BufferedImage getAnaglyphImage(BufferedImage left, BufferedImage right, int anaglyph_type)
      Methode erstelt eine Anaglyphbild
      Parameters:
      left - Linkebild
      right - Rechtebild
      anaglyph_type - Typ von Anaglyphbild
      Moegliche Typen:
      ANAGLYPH_RAD_CYAN_COLOR (defined in ImageTool)
      ANAGLYPH_RAD_CYAN_GRAY (defined in ImageTool)
      ANAGLYPH_RAD_GREEN_COLOR (defined in ImageTool)
      ANAGLYPH_RAD_GREEN_GRAY (defined in ImageTool)
      ANAGLYPH_RAD_BLUE_COLOR (defined in ImageTool)
      ANAGLYPH_RAD_BLUE_GRAY (defined in ImageTool)
      ANAGLYPH_YELLOW_BLUE_COLOR (defined in ImageTool)
      ANAGLYPH_YELLOW_BLUE_GRAY (defined in ImageTool)
      Returns:
      Zusammen gesetzte Anaglyphbild
    • getAnaglyphImage

      public static BufferedImage getAnaglyphImage(BufferedImage left, BufferedImage right, double[][] leftMatrix, double[][] rightMatrix) throws ImageToolException
      Methode erstelt eine Anaglyphbild
      Parameters:
      left - Linkebild
      right - Rechtebild
      leftMatrix - Multiplexer fuer linke Bild
      rightMatrix - Multiplexer fuer rechte Bild
      Returns:
      Zusammen gesetzte Anaglyphbild
      Throws:
      ImageToolException
    • getGrayImage

      public static BufferedImage getGrayImage(BufferedImage img)
      Methode wandelt Bild in graue Stuffen
      Parameters:
      img - Bildquelle
      Returns:
      Schwarzweise Bild
    • resizeImage

      public static BufferedImage resizeImage(BufferedImage img, int width, int height)
      Methode Aendert bild Groesse
      Parameters:
      img - Bildquelle
      width - Neue Breite
      height - Neue Hoehe
      Returns:
      Skalierte Bild
    • adaptImage

      public static BufferedImage adaptImage(BufferedImage img, int width, int height) throws ImageToolException
      Methode Aendert bild Groesse so das Proportionen werde beibechalten
      Parameters:
      img - Bildquelle
      width - Breite an welche Bild adaptiert werden muss
      height - Hoehe an welche Bild adaptiert werden muss
      Returns:
      Skalierte (Adaptierte) Bild
      Throws:
      ImageToolException
    • cutPartOfImage

      public static BufferedImage cutPartOfImage(BufferedImage img, int x, int y, int width, int height)
      Methode schneidet eine Teil von Bild aus
      Parameters:
      img - Bildquelle
      x - Startposition X
      y - Startposition Y
      width - Breite von Ausschnit
      height - Hoehe von Ausschnit
      Returns:
      Ausgeschnitene Bild
    • rotateImage

      public static BufferedImage rotateImage(BufferedImage img, double degree)
      Methode dreht Bild in degree Grad rum
      Parameters:
      img - Bildquelle
      degree - Rotationsgrad
      Returns:
      Gedrate Bild
    • addWatermarkToImage

      public static BufferedImage addWatermarkToImage(BufferedImage img, BufferedImage watermark, int x, int y, float transperancy)
      Methode fuegt ein Wasserzeichen zu Hauptbild
      Parameters:
      img - Hauptbildquelle
      watermark - Wasserzeichenquelle
      x - X-Position an welche mus Wasserzeichen gesetzt werden
      y - Y-Position an welche mus Wasserzeichen gesetzt werden
      transperancy - Duersichtlichkeit von Wasserzeichen
      Returns:
      Origenalbild mit Wasserzeichen
    • reflectHorizontalImage

      public static BufferedImage reflectHorizontalImage(BufferedImage img)
      Methode spigeld Bild Horizontal
      Parameters:
      img - Bildquelle
      Returns:
      Horizontal gespiegelte Bild
    • reflectVerticalImage

      public static BufferedImage reflectVerticalImage(BufferedImage img)
      Methode spigeld Bild Vertikal
      Parameters:
      img - Bildquelle
      Returns:
      Vertikal gespiegelte Bild
    • makeTransparentImage

      public static BufferedImage makeTransparentImage(BufferedImage img, float transperancy)
      Methode macht Bild duerchsichtig
      Parameters:
      img - Bildquelle
      transperancy - Duersichtigkeitstaerke
      Returns:
      Duersichtige Bild