Class Multiplication


  • public class Multiplication
    extends java.lang.Object
    Given two images of equal dimension, it'll multiply pixel intensity values of each image ( pixel by pixel fashion ), and resulting image to be stored in a different buffered image
    • Constructor Summary

      Constructors 
      Constructor Description
      Multiplication()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.awt.Color[] extractRow​(int row, java.awt.image.BufferedImage img)
      Given a buffered image & row index, it'll extract out all pixel intensities present along that row
      protected boolean isEligible​(java.awt.image.BufferedImage operandOne, java.awt.image.BufferedImage operandTwo)
      Operand images on which we'll apply any arithmetic operation needs to be of same dimension
      java.awt.image.BufferedImage operate​(java.awt.image.BufferedImage operandOne, java.awt.image.BufferedImage operandTwo, boolean clip)
      Concurrently applies multiplication operator on two buffered images of same dimension, where each row gets processed in a different thread, making overall execution faster, leveraging power of multithreaed multicore CPUs
      java.awt.image.BufferedImage operate​(java.lang.String operandOne, java.lang.String operandTwo, boolean clip)
      Invokes previous implementation, after reading two operand images into buffered image object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Multiplication

        public Multiplication()
    • Method Detail

      • operate

        public java.awt.image.BufferedImage operate​(java.awt.image.BufferedImage operandOne,
                                                    java.awt.image.BufferedImage operandTwo,
                                                    boolean clip)
        Concurrently applies multiplication operator on two buffered images of same dimension, where each row gets processed in a different thread, making overall execution faster, leveraging power of multithreaed multicore CPUs

        Row extraction implementation on parent class `ArithmeticOps`

      • operate

        public java.awt.image.BufferedImage operate​(java.lang.String operandOne,
                                                    java.lang.String operandTwo,
                                                    boolean clip)
        Invokes previous implementation, after reading two operand images into buffered image object
      • extractRow

        protected java.awt.Color[] extractRow​(int row,
                                              java.awt.image.BufferedImage img)
        Given a buffered image & row index, it'll extract out all pixel intensities present along that row
      • isEligible

        protected boolean isEligible​(java.awt.image.BufferedImage operandOne,
                                     java.awt.image.BufferedImage operandTwo)
        Operand images on which we'll apply any arithmetic operation needs to be of same dimension