Skip to content
Snippets Groups Projects
Pixel.cpp 394 B
#include "Pixel.h"
#include <cassert>
#include <iostream>

Pixel::Pixel()
{
    r = 0;
    g = 0;
    b = 0;
}

Pixel::Pixel(unsigned int x,unsigned int y, unsigned int z)
{
    assert(x>=0 && x<=255);
    assert(y>=0 && y<=255);
    assert(z>=0 && z<=255);
    r = x;
    g = y;
    b = z;
}

Pixel Pixel::operator=(Pixel p)
{
    r = p.r;
    g = p.g;
    b = p.b;

    return *this;
    
}