www.raysolution.co.cc is Launching now....

Image Processing Previos Lab Review

import java.awt.*;
import java.applet.*;
import java.awt.image.*;

public class test2 extends Applet
{
Image pic, bwpic, greypic, redpic, greenpic, bluepic;

public void init()
{

pic = getImage(getDocumentBase(), "bear.gif");
MediaTracker t = new MediaTracker(this);
t.addImage(pic, 0);
try
{
t.waitForAll();
}
catch (Exception e)
{
}

ImageProducer p1 = pic.getSource();
BWFilter BnW = new BWFilter();
bwpic = createImage(new FilteredImageSource(p1, BnW));

ImageProducer p2 = pic.getSource();
GreyFilter grey = new GreyFilter();
greypic = createImage(new FilteredImageSource(p2, grey));

ImageProducer p3 = pic.getSource();
RedFilter red = new RedFilter();
redpic = createImage(new FilteredImageSource(p3, red));

ImageProducer p4 = pic.getSource();
GreenFilter green = new GreenFilter();
greenpic = createImage(new FilteredImageSource(p4, green));

ImageProducer p5 = pic.getSource();
BlueFilter blue = new BlueFilter();
bluepic = createImage(new FilteredImageSource(p5, blue));

}

public void paint(Graphics g)
{
g.drawImage(pic,0, 10, this);
g.drawImage(bwpic, 300, 10, this);
g.drawImage(greypic, 600, 10, this);
g.drawImage(redpic, 0, 400, this);
g.drawImage(greenpic, 300, 400, this);
g.drawImage(bluepic, 600, 400, this);
}
}


class BWFilter extends RGBImageFilter
{
public int filterRGB (int x, int y, int rgb)
{
int alpha = (rgb >> 24) & 0xff;
int red = (int) (((rgb >> 16) & 0xff) * 0.3f);
int green = (int) (((rgb >> 8) & 0xff) * 0.59f);
int blue = (int) (((rgb >> 0) & 0xff) * 0.11f);
int bws = red + green + blue;

if(bws > 127)
{
bws = 255;
}
else
{
bws = 0;
}
return ((alpha & 0xff) << 24) | ((bws & 0xff) << 16) | ((bws & 0xff) << 8) | ((bws & 0xff) << 0);
}
}

class GreyFilter extends RGBImageFilter
{

public int filterRGB (int x, int y, int rgb)
{
int alpha = (rgb >> 24) & 0xff;
int red = (int) (((rgb >> 16) & 0xff) * 0.3f);
int green = (int) (((rgb >> 8) & 0xff) * 0.59f);
int blue = (int) (((rgb >> 0) & 0xff) * 0.11f);
int bws = red + green + blue;
return ((alpha & 0xff) << 24) | ((bws & 0xff) << 16) | ((bws & 0xff) << 8) | ((bws & 0xff) << 0);
}
}

class RedFilter extends RGBImageFilter
{

public int filterRGB(int x, int y, int rgb)
{
return rgb & 0xffff0000;
}
}

class GreenFilter extends RGBImageFilter
{
public int filterRGB(int x, int y, int rgb)
{
return rgb & 0xff00ff00;
}
}

class BlueFilter extends RGBImageFilter
{

public int filterRGB(int x, int y, int rgb)
{
return rgb & 0xff0000ff;
}
}
Thanks to GCA and Siew Hao

3rd Sem Exam Time Table

Network Assigment

Step 1 :go spin dowload the CollectionOfJava.rar.

Step 2:Extract all the file into a new folder.

Step 3:compile the RecvTCP.java and SendTCP.java in command prompt.
(example: javac RecTCP.java)

Step 4: Run the RecTCP.java(as server) first then only run SendTCP.java(as client) in command prompt.
(**example:
java RecTCP 7000(at server cmd)
java SendTCP "" 7000 (at client cmd)

You will see the output like this

Server


Client

***For the RecvUDP and SendUDP also same as above step!

KOMUNIKASI DATA DAN TELEKOMUNIKASI Pass Year

I. Which of the following is not a characteristic of microwaves?

A. Microwaves can be used to send signal in all direction.

S. Very high frequency microwaves cannot penetrate walls.

C. Microwaves are used in cellular telephone networks, satellite networks and wireless LANS.

D. Microwaves support high data rate.

2. Which of the following application does not need line-of-sight for transmission?

A. TV remote control.

B. Satellite networks.

C. Cellular telephone base stations.

D. Maritime radio.

3. Data transfers amongst Bluetooth devices are conducted via

A. Radio waves

B. Micro waves

C. Terrestrial microwaves

D. Infrared waves

4. Which of the following protocol is not used in noisy channel?

A. Stop-and-Wait.

B. Stop-and-Wait ARQ

C. Go-back-N ARQ

D. Selective Repeat ARQ.

KOMUNIKASI DATA DAN TELEKOMUNIKASI Pass Year

I. Which of the following is not a characteristic of microwaves?

A. Microwaves can be used to send signal in all direction.

S. Very high frequency microwaves cannot penetrate walls.

C. Microwaves are used in cellular telephone networks, satellite networks and wireless LANS.

D. Microwaves support high data rate.

2. Which of the following application does not need line-of-sight for transmission?

A. TV remote control.

B. Satellite networks.

C. Cellular telephone base stations.

D. Maritime radio.

3. Data transfers amongst Bluetooth devices are conducted via

A. Radio waves

B. Micro waves

C. Terrestrial microwaves

D. Infrared waves

4. Which of the following protocol is not used in noisy channel?

A. Stop-and-Wait.

B. Stop-and-Wait ARQ

C. Go-back-N ARQ

D. Selective Repeat ARQ.

KOMUNIKASI DATA DAN TELEKOMUNIKASI Pass Year

I. Which of the following is not a characteristic of microwaves?

A. Microwaves can be used to send signal in all direction.

S. Very high frequency microwaves cannot penetrate walls.

C. Microwaves are used in cellular telephone networks, satellite networks and wireless LANS.

D. Microwaves support high data rate.

2. Which of the following application does not need line-of-sight for transmission?

A. TV remote control.

B. Satellite networks.

C. Cellular telephone base stations.

D. Maritime radio.

3. Data transfers amongst Bluetooth devices are conducted via

A. Radio waves

B. Micro waves

C. Terrestrial microwaves

D. Infrared waves

4. Which of the following protocol is not used in noisy channel?

A. Stop-and-Wait.

B. Stop-and-Wait ARQ

C. Go-back-N ARQ

D. Selective Repeat ARQ.

Related Posts with Thumbnails