Write a method to do green or red chromakey

What will be an ideal response?


```
public void chromakeyGreen ( Pi c tur e newBg)
{
Pixel currPi xel = null;
Pixel newPixel = null;
// loop through the columns
for ( int x=0; x {
for ( int y=0; y f
// get the current pixel
currPixel = this . g e tPixel (x , y ) ;
/* i f the c o l o r at the cur r ent p i x e l i s mos t ly green
* ( green v a lue i s g r e a t e r than b l u e and red combined ) ,
* then use the new background c o l o r
*/
int combindedColor =
currPixel.getRed( ) + currPixel . getBlue ( ) ;
i f ( combindedColor < c u r rPi xel . getGreen ( ) )
{
newPixel = newBg . g e tPixel (x , y ) ;
currPixel . s e tColor ( newPixel . ge tColor ( ) ) ;
}
}
}
}
```

Computer Science & Information Technology

You might also like to view...

The operation ____ reinitializes the stack to an empty state.

A. alloc B. init C. initializeStack D. new

Computer Science & Information Technology

What is a digital certificate?

What will be an ideal response?

Computer Science & Information Technology

Why do some compilers automatically replace tail recursion with iteration?

What will be an ideal response?

Computer Science & Information Technology

MC The original structure of the Internet was sponsored by____________ (ARPA).

a) Advanced Research Protection Association b) Advanced Research Projects Agency c) Alternative Research Programming Agency d) None of the above

Computer Science & Information Technology