12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "MetaDeg.h"
- /// Construction
- MetaDeg::MetaDeg()
- :MetaSpace()
- {
- //ctor
- }
- MetaDeg::~MetaDeg()
- {
- //dtor
- }
- /// Méthodes
- void MetaDeg::deform(Uint32 y, Uint32 x)
- {
- Uint32 k(127);
- for (Uint32 i(y-k); i < y+k; i++)
- for (Uint32 j(x-k); j < x+k; j++)
- if ( isInside(i, j) )
- {
- m_tab[i][j] += 255 - abs((int)j - (int)x) - abs((int)i - (int)y);
- if (m_tab[i][j] > 255)
- m_tab[i][j] = 255;
- }
- }
- #include <iostream>
- void MetaDeg::draw()
- {
- Uint32 val(0);
- for ( Uint32 i = 0; i < m_h; i++ )
- for ( Uint32 j = 0; j < m_w; j++ )
- {
- val = m_tab[i][j];
- pixelRGBA(m_buff, j, i, val, 0, 0, 255);
- }
- }
|