Create a movie that has the frames slowly becoming sepia-toned. The following is in the Picture class in the directory bookClassesFinal.
What will be an ideal response?
```
/**
* Modi fy the cur r ent p i c t u r e based on the d i s t anc e to the
* f i n a l p i c tur e , the cur r ent index , and the t o t a l d i s t anc e
* @param f i n a lPi c t the d e s i r e d f i n a l p i c t u r e
* @param inde x the cur r ent inde x
* @param d i s t the t o t a l d i s t anc e to the f i n a l p i c t u r e
*/
public void modifyTowards ( Pi c tur e f i n a lPi c t , int index , double d i s t )
{
Pix e l [ ] pixe lAr ray = this . g e tPi x e l s ( )
Pix e l [ ] f i n a lPi x e lAr r a y = f i n a lPi c t . g e tPi x e l s ( ) ;
Pix e l c u r rPi x e l = nul l ;
Pix e l f i n a l P i x e l = nul l ;
double redDi s t , blueDi s t , gr e enDi s t ;
Color pi c tCo l o r = nul l ;
// loop through the ar ray o f p i x e l s
for ( int i = 0 ; i < pixe lAr ray . l eng th ; i++)
{
c u r rPi x e l = pixe lAr ray [ i ] ;
f i n a l P i x e l = f i n a lPi x e lAr r a y [ i ] ;
r edDi s t = f i n a l P i x e l . getRed ( ) ¡ c u r rPi x e l . getRed ( ) ;
blueDi s t = f i n a l P i x e l . getBlue ( ) ¡ c u r rPi x e l . getBlue ( ) ;
gr e enDi s t = f i n a l P i x e l . getGreen ( ) ¡ c u r rPi x e l . getGreen ( ) ;
pi c tCo l o r = new Color ( ( int ) ( index / d i s t * r edDi s t + c u r rPi x e l . getRed ( ) ) ,
( int ) ( index / d i s t * gr e enDi s t + c u r rPi x e l . getGreen ( ) ) ,
( int ) ( index / d i s t * blueDi s t + c u r rPi x e l . getBlue ( ) ) ) ;
c u r rPi x e l . s e tCo l o r ( pi c tCo l o r ) ;
}
}
```
The following is from the MovieMaker class in the directory bookClassesFinal.
```
/**
* Method to c r e a t e a sepia¡toned movie
* @param p the p i c t u r e to use in the movie
* @param d i r e c t o r y the d i r e c t o r y to s t o r e the frames in
*/
public void makeSepiaMovie ( Pi c tur e p , St r ing d i r e c t o r y )
{
// make a copy of the p i c t u r e
Pi c tur e copyPict = nul l ;
Pi c tur e o r i gPi c t = new Pi c tur e (p ) ;
// make a s epia¡toned p i c t u r e
p . s epi aTint ( ) ;
// d e c l a r e o the r v a r i a b l e s
FrameSequencer f rameSequencer =
new FrameSequencer ( d i r e c t o r y ) ;
int f ramesPerSec = 3 0 ;
// loop c r e a t i n g the frames
for ( int i = 0 ; i < f ramesPerSec ; i++)
{
copyPict = new Pi c tur e ( o r i gPi c t ) ;
copyPict . modifyTowards (p , i , f ramesPerSec ) ;
f rameSequencer . addFrame ( copyPict ) ;
}
// p lay the movie
f rameSequencer . play ( f ramesPerSec ) ;
}
```
You might also like to view...
You should make sure all the parts of your app are working before
a. using the Decomposition Principle b. writing the JavaScript part of the app c. making the design look better d. building the functions
The ________ tab type is when the text is centered around the tab stop
A) center B) left C) decimal D) right
A switch statement contains the following components: the keyword switch, an expression, an opening brace, a case label, the executable statements, the keyword ____________________, a default label, and a closing brace.
Fill in the blank(s) with the appropriate word(s).
Files indexed using the upload input option get indexed _____.
A) Each time Splunk restarts. B) Every hour. C) On every search. D) Once.