cubic B - spline6 width resizer, ebook

[ Pobierz całość w formacie PDF ]
// (C) 2011 Jan-Willem Krans (janwillem32 <at> hotmail.com)// This file is part of Video pixel shader pack.// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.// cubic B-spline6 width resizer// This shader should be run as a screen space pixel shader if you are up-scaling.// This shader should not be run as a screen space pixel shader if you are down-scaling.// If possible, avoid compiling with the software emulation modes (ps_?_sw). Pixel shaders require a lot of processing power to run in real-time software mode.// This shader is meant to work with linear RGB input and output. Regular R'G'B' with a video gamma encoding will have to be converted with the linear gamma shaders to work properly.// Use this shader to scale the width of an image by cubic B-spline6 interpolation.// fractions, either decimal or not, are allowed// set the magnification factor#define Magnify (4/3.)sampler s0;float c0;float c1;#define sp(a, b) float4 a = tex2D(s0, float2(coord+b*fx*c1, tex.y));float4 main(float2 tex : TEXCOORD0) : COLOR{float coord = (tex.x/Magnify+.5-.5/Magnify)*c0;// assign the output position, normalized to texture width in pixelsfloat t = frac(coord);// calculate the difference between the output pixel and the original surrounding two pixels// adjust sampling matrix to put the ouput pixel in the interval [Q2, Q2+.5]float fx;if(t > .5) {coord = (coord-t+1.5)*c1; t = 1.-t; fx = -1;}else {coord = (coord-t+.5)*c1; fx = 1;}t *= 4;// compensate for the two iterationssp(Q0, -2) sp(Q1, -1) sp(Q2, 0) sp(Q3, 1) sp(Q4, 2)// original pixelsif(t <= 1) return (((Q2*29/288.-Q0*13/6912.-Q1*167/3456.-Q3*169/3456.-Q4*11/6912.)*t+(Q0+Q4)/192.+(Q1+Q3)*13/96.-Q2*9/32.)*t+(Q3-Q1)*133/1152.+(Q4-Q0)*11/2304.)*t+(Q0+Q4)/576.+(Q1+Q3)*13/288.+Q2*29/32.;// output interpolated value for the interval [Q2, Q2+.25]sp(Q5, 3)// sample an additional pixelt -= 1.;return ((((Q0*3+Q1*17+Q3*78+Q5-Q2*70-Q4*29)*t+Q2*288+(Q4-Q0)*6-Q1*132-Q3*156)*t+(Q1+Q4)*144+Q3*3312-Q2*3600)*t+Q0*4+Q1*232+Q2*10032+Q3*3416+Q4*140)/13824.;// output interpolated value for the interval (Q2+.25, Q2+.5]} [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • cocksparrer.xlx.pl
  • Strona Główna
  • ebook Odpowiedzi na pytania ksiegowych, ksiegowosc pytania odpowiedzi
  • ebook-psychologia-osiagniec, Książki MLM, Ksiazki MLM, Książki MLM
  • ebook-google-adwords, ebooks, ebooks komputerowe, Google
  • efachowiec 3-2010, eBOOK, CZASOPISMA BUDOWLANE, eFachowiec, 2010
  • eBook.PL.Lowmianski Henryk Prusy-Litwa-Krzyzacy.- mauka.historta.książka.książki, ►►► Zakon Krzyzacki, ♣ Literatura
  • eBook - Martial Arts - Fitness Training, fitness
  • ebook O'Reilly Java Servlet Programming, java
  • ebook digital photography proffesional techniques, Fotografia, Fotografia 1
  • eBook - Martial Arts - Fitness Training, Wasze Pliczki, e-booki, ćwiczenia fizyczne, fitness
  • eBook dlaczego postanowilem czekac, czystosc, Wszystko o czystoÅ›ci, czyli jak utrzymać piÄ™kno swojej duszy
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • loko1482.xlx.pl