#include "MetaBin.h"

/// Construction
MetaBin::MetaBin()
:MetaSpace(), m_seuil(128)
{
    //ctor
}

MetaBin::MetaBin(Uint32 seuil)
:MetaSpace(), m_seuil(seuil)
{
    //ctor
}

MetaBin::~MetaBin()
{
    //dtor
}

/// Méthodes
void MetaBin::deform(Uint32 y, Uint32 x)
{
    for ( Uint32 k(0); k < 50; k++)
        for (Uint32 i(y-k); i < y+k; i++)
            for (Uint32 j(x-k); j < x+k; j++)
                m_tab[i][j] += 140 - k;
}

void MetaBin::draw()
{
    for ( Uint32 i = 0; i < m_h; i++ )
        for ( Uint32 j = 0; j < m_w; j++ )
        {
            if ( m_tab[i][j] > m_seuil )
                pixelColor(m_buff, j, i, 0xffffff);
        }
}

/// Acesseurs
void MetaBin::setSeuil(Uint32 seuil)
{
    m_seuil = seuil;
}

Uint32 MetaBin::getSeuil()
{
    return m_seuil;
}



