Nested for loops - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Nested for loops

Description:

the BufferedImage class provides us with a method named getRGB() this method returns the colour value of a pixel as a single integer ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 8
Provided by: deptcompt
Category:
Tags: loops | named | nested

less

Transcript and Presenter's Notes

Title: Nested for loops


1
Nested for loops
2
Traversing each pixel
  • we know how to get the image width and the image
    height, now we want to access each pixel
  • (0, 0), (0, 1), (0, 2) ... (0, h - 1)
  • (1, 0), (1, 1), (1, 2) ... (1, h - 1)
  • (w - 1, 0) , (w - 1, 1) , (w - 1, 2) ... (w
    - 1, h - 1)

3
(No Transcript)
4
Getting colour values
  • the BufferedImage class provides us with a method
    named getRGB()
  • this method returns the colour value of a pixel
    as a single integer
  • however we want to access the red, green and blue
    value of each pixel
  • but the BufferedImage class does not provide us
    with a method to do this
  • Color class can rescue us this class provides
    us with methods to get the individual red, green
    and blue colour information
  • these methods are called getRed(), getGreen() and
    getBlue()

5
(No Transcript)
6
(No Transcript)
7





Write a Comment
User Comments (0)
About PowerShow.com