28.11.2012 Views

Procesamiento digital de video en tiempo real y - Maestría en ...

Procesamiento digital de video en tiempo real y - Maestría en ...

Procesamiento digital de video en tiempo real y - Maestría en ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Procesami<strong>en</strong>to</strong> <strong>digital</strong> <strong>de</strong> vi<strong>de</strong>o <strong>en</strong> <strong>tiempo</strong> <strong>real</strong> y “vi<strong>de</strong>o wall” con la PC 101<br />

colores);<br />

colores);<br />

}<br />

COLORREF colores = GetPixel(hMemDC, jPixel, iPixel);<br />

bmiColors[iPixel][jPixel].rgbBlue = GetBValue((DWORD)<br />

bmiColors[iPixel][jPixel].rgbGre<strong>en</strong> = GetGValue((DWORD)<br />

bmiColors[iPixel][jPixel].rgbRed = GetRValue((DWORD) colores);<br />

//Borra el dc <strong>de</strong> memoria y el mapa <strong>de</strong> bits<br />

::DeleteDC(hMemDC);<br />

::DeleteObject(hbitmap);<br />

::DeleteDC(hMemDC); //Curioso, pero su repeticion evita que la matriz bmicolors se<br />

vaya a blanco, ver pp251<br />

switch (m_effect)<br />

{<br />

case IDC_NONE: break;<br />

prgb++);<br />

255) {<br />

// Se eliminan las otras dos compon<strong>en</strong>tes <strong>de</strong> color para <strong>de</strong>jar solo<br />

// la roja, la ver<strong>de</strong> o la azul<br />

case IDC_RED:<br />

prgb = (RGBTRIPLE*) pData;<br />

for (iPixel=0; iPixel < numPixels; iPixel++, prgb++) {<br />

prgb->rgbtGre<strong>en</strong> = 0;<br />

prgb->rgbtBlue = 0;<br />

}<br />

break;<br />

case IDC_GREEN:<br />

prgb = (RGBTRIPLE*) pData;<br />

for (iPixel=0; iPixel < numPixels; iPixel++, prgb++) {<br />

if(!(rand() % 3)) {<br />

prgb->rgbtGre<strong>en</strong> = 255;<br />

prgb->rgbtBlue = 255;<br />

prgb->rgbtRed = 255;<br />

}<br />

}<br />

break;<br />

case IDC_BLUE:<br />

prgb = (RGBTRIPLE*) pData;<br />

bmiColors[iPixel][jPixel].rgbRed;<br />

bmiColors[iPixel][jPixel].rgbGre<strong>en</strong>;<br />

bmiColors[iPixel][jPixel].rgbBlue;<br />

prgb++);<br />

break;<br />

//offset <strong>de</strong> la imag<strong>en</strong> superpuesta<br />

for(i = 0; i < (int)((cyImage/25)*(1 + cxImage)); i++,<br />

for(iPixel = 0; iPixel < 60; iPixel++) {<br />

for(jPixel = 0; jPixel < 98; jPixel++, prgb++){<br />

if(bmiColors[iPixel][jPixel].rgbGre<strong>en</strong> !=<br />

}<br />

// Desplaza cada compon<strong>en</strong>te a la <strong>de</strong>recha 1 posicion<br />

// esto resulta <strong>en</strong> una imag<strong>en</strong> mas obscura<br />

case IDC_DARKEN:<br />

prgb->rgbtRed =<br />

prgb->rgbtGre<strong>en</strong> =<br />

prgb->rgbtBlue =<br />

}<br />

}<br />

for(jPixel = 98; jPixel < cxImage; jPixel++,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!