package mypackage;

/**
 *
 * @author Yusuf Shakeel
 * @version 1.0
 * Date: 26-01-2014 sun
 * 
 * File: ImageProject.java
 * 
 * Description:
 * This is a test file.
 * 
 */

import java.io.IOException;
import imageX.ImageFX;

public class ImageProject {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)throws IOException {
        
        /** Create ImageFX object */
        ImageFX iObj = new ImageFX();
        
        /** Read Image File by passing the file path */
        String filePath = "D:\\LogoJava.jpg";
        iObj.readImage(filePath);
        
        /** Display the dimension of the image */
        int width = iObj.getImageWidth();
        int height = iObj.getImageHeight();
        System.out.println("Dimension: "+width+"x"+height);
        
        /** Write the image file to an output file */
        String fname = "D:\\Output.png";
        String ftype = "png";
        iObj.writeImage(fname, ftype);
        System.out.println("iObj image written to file");
        
        /** create a new image object */
        String fname2 = "D:\\Output2.jpg";
        String ftype2 = "jpg";
        int picWidth = 10;
        int picHeight = 10;
        ImageFX iObj2 = new ImageFX(picWidth, picHeight);
        iObj2.writeImage(fname2, ftype2);
        
        System.out.println("iObj2 image written to file");
        
        /** create a new ImageFX object and initialize pixels */
        ImageFX iObj3 = iObj2;
        iObj3.initPixelArray();
        
        System.out.println("iObj3=iObj2");
        System.out.println("iObj3 get ARGB value");
        /** get the value of 1st pixel at coordinate (0,0) */
        System.out.println(iObj3.getAlpha(0, 0));
        System.out.println(iObj3.getRed(0, 0));
        System.out.println(iObj3.getGreen(0, 0));
        System.out.println(iObj3.getBlue(0, 0));
        System.out.println(iObj3.getPixel(0, 0));
        
        System.out.println("iObj3 set and get ARGB value");
        /** set the value of the 1st pixel at coordinate (0,0) and print the value */
        iObj3.setPixel(0, 0, 255, 255, 255, 255);
        System.out.println(iObj3.getAlpha(0, 0));
        System.out.println(iObj3.getRed(0, 0));
        System.out.println(iObj3.getGreen(0, 0));
        System.out.println(iObj3.getBlue(0, 0));
        System.out.println(iObj3.getPixel(0, 0));
        
        System.out.println("iObj3 image written to file");
        iObj3.writeImage("D:\\Output3.png", "png");
        
        /** create a random image and write (save) it to a file */
        ImageFX iObj4 = new ImageFX(100,100);
        iObj4.initPixelArray();
        iObj4.createRandomImage();
        iObj4.writeImage("D:\\Output4.png", "png");
        
        /** threshold image */
        ImageFX iObj5 = new ImageFX();
        iObj5.readImage("D:\\City.jpg");
        iObj5.initPixelArray();
        iObj5.thresholdImageGrayscale(50);
        iObj5.writeImage("D:\\City1.png", "png");
        
    }//main() ends here
}//class ImageProject ends here

@@ -19,16 +19,44 @@
 %0A%0A/**%0A *
+ File: ImageProject.java%0A * 
 %0A * @aut
@@ -117,38 +117,8 @@
 sun%0A
- * %0A * File: ImageProject.java
 %0A * 
@@ -167,16 +167,34 @@
 * %0A */%0A%0A
+import imageFX.*;%0A
 import j
@@ -216,31 +216,8 @@
 ion;
-%0Aimport imageX.ImageFX;
 %0A%0Apu
@@ -418,31 +418,31 @@
  */%0A        
+My
 Image
-FX
  iObj = new 
@@ -437,31 +437,31 @@
  iObj = new 
+My
 Image
-FX
 ();%0A        
@@ -1216,31 +1216,31 @@
 10;%0A        
+My
 Image
-FX
  iObj2 = new
@@ -1240,23 +1240,23 @@
 2 = new 
+My
 Image
-FX
 (picWidt
@@ -1458,31 +1458,31 @@
  */%0A        
+My
 Image
-FX
  iObj3 = iOb
@@ -2582,31 +2582,31 @@
  */%0A        
+My
 Image
-FX
  iObj4 = new
@@ -2606,23 +2606,23 @@
 4 = new 
+My
 Image
-FX
 (100,100
@@ -2791,23 +2791,23 @@
         
+My
 Image
-FX
  iObj5 =
@@ -2811,23 +2811,23 @@
 5 = new 
+My
 Image
-FX
 ();%0A    
@@ -2851,20 +2851,20 @@
 ge(%22D:%5C%5C
-City
+lena
 .jpg%22);%0A
@@ -2907,15 +2907,9 @@
     
-iObj5.t
+T
 hres
@@ -2921,17 +2921,18 @@
 mage
-G
+.g
 rayscale
 (50)
@@ -2931,11 +2931,25 @@
 cale
-(50
+_Simple(80, iObj5
 );%0A 
@@ -2981,23 +2981,23 @@
 D:%5C%5C
-City1.pn
+lean1.jp
 g%22, %22
+j
 p
-n
 g%22);
@@ -3053,17 +3053,16 @@
 roject ends here
-%0A

Update ImageProject.java