view TaskManager/Test/test_render/task/DrawBack.cpp @ 203:1eba8570808c draft

fix CreateSpan::run
author gongo@localhost.localdomain
date Mon, 26 Jan 2009 18:30:35 +0900
parents 028ffc9c0375
children e2f29e912d0b
line wrap: on
line source

#include <stdlib.h>
#include <string.h>
#include "DrawBack.h"
#include "viewer_types.h"

SchedDefineTask(DrawBack);

void
DrawBack::linebuf_init(int *buf, int x, int rgb)
{
    for (int i = 0; i < x; i++) {
	buf[i] = rgb;
    }
}

int
DrawBack::run(void *rbuf, void *wbuf)
{
    int rgb          = smanager->get_param(0);
    int rangex_start = smanager->get_param(1);
    int rangex_end   = smanager->get_param(2);
    int rangey       = smanager->get_param(3);
    int rangex       = rangex_end - rangex_start + 1;
    int *linebuf;

    for (int i = 0; i < rangey; i++) {
	linebuf = (int*)smanager->get_output(i);
	linebuf_init(linebuf, rangex, rgb);
    }

    return 0;
}