# Figure 2-16. Creating a glow in Word Making Data Matrix 2d barcode in Word Figure 2-16. Creating a glow

Figure 2-16. Creating a glow
Encoding Data Matrix In None
Using Barcode maker for Microsoft Word Control to generate, create ECC200 image in Word applications.
www.OnBarcode.com
PDF 417 Generator In None
Using Barcode encoder for Microsoft Word Control to generate, create PDF 417 image in Office Word applications.
www.OnBarcode.com
How It Works
Printing Barcode In None
Using Barcode generation for Microsoft Word Control to generate, create Barcode image in Office Word applications.
www.OnBarcode.com
EAN / UCC - 13 Maker In None
Using Barcode drawer for Office Word Control to generate, create USS-128 image in Word applications.
www.OnBarcode.com
There are a few caveats, however. To get a nice blur, you need to average over a lot of pixels around the center pixel to get a nice result. A much better way would be to first blur the image horizontally by averaging over just a few pixels on the same row as the center pixel. Next, you would take the result and blur this result vertically by averaging over a few pixels on the same column as the center pixel. This would give you two 1D averages, instead of one 2D, which would require you to average over many more pixels to get a nice result. Second, you should decide over which pixels to average. You get the best results by giving the pixels close to the pixel of interest more importance than the pixels farther away. This is called giving them more weight. For your convenience, I have calculated some offsets and weights corresponding to a Gaussian, which corresponds to blurring as it happens in nature. Look at the following list, which contains the distances to pixels that will be taken into account. The first entry has 0 offset, meaning the color of the center pixel itself will be taken into account. The second entry has a 0.005 offset, which will result in the sampling of a pixel very close to the center pixel. To make things symmetrical, you will sample the two pixels that are 0.005 away both to the left and right from the center pixel, and you will give both colors a weight of 0.102 in the final color, as you can see in the second list. Next, you ll sample the left and right pixels that are 0.0117 away from the center pixel, and you ll give them a little less weight, 0.0936. You continue like this until you get pretty far away from the center pixel and thus also assign little weight to these outliers.
Draw EAN-13 Supplement 5 In None
Using Barcode maker for Office Word Control to generate, create EAN 13 image in Office Word applications.
www.OnBarcode.com
UPC A Creator In None
Using Barcode drawer for Word Control to generate, create GS1 - 12 image in Microsoft Word applications.
www.OnBarcode.com
CHAPTER 2 SE TTIN G UP DIFFER ENT CA MERA MODE S IN YOUR 3 D WORLD
Encode Code 39 In None
Using Barcode drawer for Microsoft Word Control to generate, create Code 3 of 9 image in Office Word applications.
www.OnBarcode.com
Creating Delivery Point Barcode (DPBC) In None
Using Barcode creation for Word Control to generate, create USPS POSTNET Barcode image in Office Word applications.
www.OnBarcode.com
float positions[] = { 0.0f, 0.005, 0.01166667, 0.01833333, 0.025, 0.03166667, 0.03833333, 0.045, }; float weights[] = { 0.0530577, 0.1028506, 0.09364651, 0.0801001, 0.06436224, 0.04858317, 0.03445063, 0.02294906, }; It s important to note that if you add the weights of all points you ll take into account together, their sum should equal 1. This makes sure no color gets lost or added in the image.
ECC200 Maker In Java
Using Barcode maker for Android Control to generate, create Data Matrix ECC200 image in Android applications.
www.OnBarcode.com
Data Matrix 2d Barcode Generation In None
Using Barcode drawer for Font Control to generate, create Data Matrix 2d barcode image in Font applications.
www.OnBarcode.com
Note The center pixel seems to have a small weight in comparison to the other pixels that are sampled.
Code 39 Full ASCII Maker In Visual Basic .NET
Using Barcode encoder for .NET framework Control to generate, create Code-39 image in Visual Studio .NET applications.
www.OnBarcode.com
UPC-A Creator In .NET
Using Barcode generation for ASP.NET Control to generate, create UPC-A Supplement 5 image in ASP.NET applications.
www.OnBarcode.com
However, because +0 and -0 are the same, the center pixel will be taken into account twice, effectively doubling its weight and making it the pixel that will have the most influence on the final result.
Encoding Matrix 2D Barcode In .NET
Using Barcode generation for .NET Control to generate, create Matrix 2D Barcode image in .NET framework applications.
www.OnBarcode.com
Encode Barcode In .NET Framework
Using Barcode generation for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
You will also be using an xBlurSize variable so you can tweak the width of the blurring effect from within your XNA application: float xBlurSize = 0.5f; You can already create the empty body for the HorBlur effect, based on the previous recipe: //------- PP Technique: HorBlur -------PPPixelToFrame HorBlurPS(PPVertexToPixel PSIn) : COLOR0 { PPPixelToFrame Output = (PPPixelToFrame)0; return Output; }
Data Matrix 2d Barcode Recognizer In Visual C#.NET
www.OnBarcode.com
PDF 417 Generation In None
Using Barcode encoder for Font Control to generate, create PDF417 image in Font applications.
www.OnBarcode.com
CHAPTER 2 SE TTIN G UP DIFFE RENT CA MERA MODE S IN YOUR 3 D WORLD
Draw PDF 417 In VB.NET
Using Barcode printer for Visual Studio .NET Control to generate, create PDF417 image in Visual Studio .NET applications.
www.OnBarcode.com
Decode Barcode In Visual Basic .NET
Using Barcode scanner for .NET Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
technique HorBlur { pass Pass0 { VertexShader = compile vs_1_1 DefaultVertexShader(); PixelShader = compile ps_2_0 HorBlurPS(); } } The actual effect is defined in the pixel shader. For each surrounding pixel from the list defined earlier, you will sample the color and multiply it with its weight. For symmetry, you will do this on both sides of the center pixel. Finally, you add all colors together. You find the locations of the surrounding pixels by starting from the TexCoord of the center pixel and adding the value from the positions array as the horizontal texture coordinate: PPPixelToFrame HorBlurPS(PPVertexToPixel PSIn) : COLOR0 { PPPixelToFrame Output = (PPPixelToFrame)0; for (int i = 0; i < 8; i++) { float4 samplePos = tex2D(textureSampler, PSIn.TexCoord + float2(positions[i], 0)*xBlurSize); samplePos *= weights[i]; float4 sampleNeg = tex2D(textureSampler, PSIn.TexCoord - float2(positions[i], 0)*xBlurSize); sampleNeg *= weights[i]; Output.Color += samplePos + sampleNeg; } return Output; } You can see that the xBlurSize variable can be used to increase/decrease the distance between the pixel of interest and its neighbors. Now inside your XNA application, you simply have to assign a value to this variable and activate the effect: List<string> ppEffectsList = new List<string>(); ppEffectsList.Add("HorBlur"); postProcessor.Parameters["xBlurSize"].SetValue(0.5f); postProcessor.PostProcess(ppEffectsList);
Scanning PDF 417 In VB.NET
Using Barcode scanner for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
Data Matrix Recognizer In VS .NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com