media @ VU
[] readme course preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthoughts appendix references examples resources _

#### phl-sepia.phl

```
// sepia
float time=0;
float sampleDist = 1.0f/512.0f;  // distance one pixel in u/v
sampler2D image : register(s0);

```
----------------------------------------------------------------------------- // SepiaTone.psh // // Converts image to sepia tone by moving color into YIQ space first. // Algo: // 1) find Intensity // 2) load intensity into Y // 3) load 2 and 0 into I and Q respectively // 4) transform Intenty,2, 0.0 color back to RGB. // // // Marwan Y. Ansari - ATI Research, Inc. - 2002 -----------------------------------------------------------------------------// float4 main( float4 Pos : POSITION, float2 texCoord: TEXCOORD0) : COLOR { float4 c = .5; float4 currFrameSample; float4 currFrameSampleYIQ; float4x4 YIQMatrix = { 0.299, 0.587, 0.114,0, 0.596, -0.275, -0.321,0, 0.212, -0.523, 0.311,0, 0,0,0,1}; float4x4 inverseYIQ ={ 1.0000000000000000000, .95568806036115671171, .61985809445637075388, 0, 1.0000000000000000000, -.27158179694405859326, -.64687381613840131330, 0, 1.0000000000000000000, -1.1081773266826619523, 1.7050645599191817149, 0, 0,0,0,1 }; // get sample currFrameSample = tex2D( image, texCoord); // convert to YIQ space currFrameSampleYIQ = mul(YIQMatrix , currFrameSample); currFrameSampleYIQ.y = 0.2; // convert YIQ color to sepia tone currFrameSampleYIQ.z = 0.0; // convert back to RGB c = mul( inverseYIQ, currFrameSampleYIQ); return c; }
<phrase dir=b turn=0 id=_ level=_ right="haven t~nI seen this~nbefore?"/> <phrase dir=b turn=0 id=_ level=_ left="I am glad~nyou re paying~nattention!!"> <gesture dir=b id=_ level=_ right=0 pause=500/> <gesture dir=b id=_ level=_ left=0 pause=600/>
[] readme course preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthoughts appendix references examples resources _

(C) A. Eliëns 9/8/2006

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.