#include <amscppimglib4/amscppimglib4.hpp>

namespace ams
{

amspixel::amspixel()
{
    R = 0; G = 0; B = 0; A = 0;
    return;
}

amspixel::amspixel(uint8_t _R ,uint8_t _G, uint8_t _B, uint8_t _A)
{
    R = _R; G = _G; B = _B; A = _A;
    return;
}

uint8_t& amspixel::operator[](const int ind)
{
    if(ind==0) return R;
    if(ind==1) return G;
    if(ind==2) return B;
    if(ind==3) return A;
    return A;
}

const uint8_t& amspixel::operator[](const int ind) const
{
    if(ind==0) return R;
    if(ind==1) return G;
    if(ind==2) return B;
    if(ind==3) return A;
    return A;
}

amsfloatpixel::amsfloatpixel()
{
    R = 0.0;
    G = 0.0;
    B = 0.0;
    A = 0.0;
    return;
}

amsfloatpixel::amsfloatpixel(float _R ,float _G, float _B, float _A)
{
    R = _R; G = _G; B = _B; A = _A;
    return;
}

float& amsfloatpixel::operator[](const int ind)
{
    if(ind==0) return R;
    if(ind==1) return G;
    if(ind==2) return B;
    if(ind==3) return A;
    return A;
}

const float& amsfloatpixel::operator[](const int ind) const
{
    if(ind==0) return R;
    if(ind==1) return G;
    if(ind==2) return B;
    if(ind==3) return A;
    return A;
}

amsfloatpixel amsfloatpixel::operator+(amsfloatpixel rhs)
{
    amsfloatpixel ret;
    ret.R = R + rhs.R;
    ret.G = G + rhs.G;
    ret.B = B + rhs.B;
    ret.A = A + rhs.A;
    return ret;
}

amsfloatpixel amsfloatpixel::operator-(amsfloatpixel rhs)
{
    amsfloatpixel ret;
    ret.R = R - rhs.R;
    ret.G = G - rhs.G;
    ret.B = B - rhs.B;
    ret.A = A - rhs.A;
    return ret;
}

amsfloatpixel amsfloatpixel::operator*(float rhs)
{
    amsfloatpixel ret;
    ret.R = R*rhs;
    ret.G = G*rhs;
    ret.B = B*rhs;
    ret.A = A*rhs;

    return ret;
}

amsfloatpixel amsfloatpixel::operator/(float rhs)
{
    amsfloatpixel ret;
    ret.R = R/rhs;
    ret.G = G/rhs;
    ret.B = B/rhs;
    ret.A = A/rhs;

    return ret;
}


};