Source Code

Matte ID (Special Buffer)

Fills area of images with selected object value.

[source code] [compiled]
//-----------------------------------------
// LScript Image Filter - www.StephenCulley.co.uk - Matte ID (Special Buffer)
//

@version 2.5
@warnings
@script image

ID;

create
{

    ID = 0;
    setdesc("www.StephenCulley.co.uk - Matte ID (Special Buffer) : " + ID);

}

process: ifo
{

    moninit(ifo.height) unless runningUnder() == SCREAMERNET;

    for(i = 1;i <= ifo.height;++i)
    {
        for(j = 1;j <= ifo.width;++j)
        {
            if(ifo.special[j,i] != ID)
            {  
                ifo.red[j,i] = 0;
                ifo.green[j,i] = 0;
                ifo.blue[j,i] = 0;
                ifo.alpha[j,i] = 0;

            }
                
         }

            if(runningUnder() != SCREAMERNET)
            {
                return if monstep();
            }        
    }

    monend() unless runningUnder() == SCREAMERNET;
}

load: what,io
{
    if(what == SCENEMODE)
    {
        ID = number(io.read());
        setdesc("www.StephenCulley.co.uk - Matte ID (Special Buffer) : " + ID);
    }
}

save: what,io
{
    if(what == SCENEMODE)
    {
        io.writeln(ID);
    }
}

options
{
    reqbegin("Matte ID (Special Buffer)");
    c1 = ctlnumber("ID",ID);
    return if !reqpost();
    ID = getvalue(c1);
    setdesc("www.StephenCulley.co.uk - Matte ID (Special Buffer) : " + ID);
    reqend();
}