Exemplo n.º 1
0
void colormap_apply( VJFrame *frame, int width, int height, int r, int g, int b)
{
    int i;
    int len = (width * height);
    uint8_t *Y = frame->data[0];
    uint8_t *Cb = frame->data[1];
    uint8_t *Cr = frame->data[2];
	int dummy = 0;
	for(i = 1; i < 256; i ++ )
	{
		COLOR_rgb2yuv( (r % i),(g % i),(b % i), dummy, u_[i-1],v_[i-1]);

	}
    
    
/*    for (i = 0; i < len; i++) {
	*(Y) = val - *(Y);
	*(Y)++;
    }*/

    for (i = 0; i < len; i++) {
//	*(Cb) = val - *(Cb);
  //      *(Cb)++;
    //    *(Cr) = val - *(Cr);
//	*(Cr)++;
	*(Cb) = u_[ (*Y) ];
	*(Cr) = v_[ (*Y) ];	
	*(Cb)++;
	*(Cr)++;
	*(Y)++;
    }
}
Exemplo n.º 2
0
void colormap_apply( VJFrame *frame, int r, int g, int b)
{
    unsigned int i;
    const int uv_len = (frame->ssm ? frame->len : frame->uv_len );
	uint8_t *Y = frame->data[0];
    uint8_t *Cb = frame->data[1];
    uint8_t *Cr = frame->data[2];
	int dummy = 0;
	uint8_t u_[256];
	uint8_t v_[256];

	for(i = 1; i < 257; i ++ )
	{
		COLOR_rgb2yuv( (r % i),(g % i),(b % i), dummy, u_[i-1],v_[i-1]);
	}
    
    for (i = 0; i < uv_len; i++)
	{
		Cb[i] = u_[ Y[i] ];
		Cr[i] = v_[ Y[i] ];
	}
}