[Bf-committers] Sequencer filter stack patch

Xavier Thomas xavier.thomas.1980 at gmail.com
Mon Jan 18 03:49:07 CET 2010


2010/1/17 Matt Ebb <matt at mke3.net>

>
> On the other hand, I think it would also be very good to bring
> Compositor and Sequence Editor tools more in line with each other. If
> it's kept RGB, we can easily have the exact same tools nicely in the
> Compositor too (was planning to do this). I think if we can share more
> code and features between the two, it would be a net benefit for both,
> rather than keeping the sequence  as it is, almost a standalone
> application inside blender.
>
>
I suppose if the sequencer is made YUV conform one day it must stay
compatible with RGB so there sould be some possible way of reusing it.

Speeking of I did not find a way to make some image library that could work
on both ImBuf an CompBuf (Those lib should be modified to do it and campbel
was not to enthusiastic about this). So I added BLI_pixbuf to blenlib for
verry low level image treatment, it should be eassy to use this code both in
sequencer and compositor.

Here id the BLI_pixbuf.h:

#ifndef BLI_PIXBUF_H
#define BLI_PIXBUF_H

/* multiply all pixels by a factor */
void BLI_pixbuf_multiply(unsigned int *pixbuf, int sizex, int sizey, float
fmul);
void BLI_pixbuf_multiply_float(float *pixbuf, int sizex, int sizey, float
fmul);

/* apply a color balance with ASC-CDL parameters
   the byte to float expect the float pixbuf to be allocated,
   does not apply the color balance to the char pixbuf and does not free it
*/
void BLI_pixbuf_color_balance_byte_byte(unsigned int *pixbuf, int sizex, int
sizey, float *offset, float *slope, float *power);
void BLI_pixbuf_color_balance_byte_float(unsigned int *pixbuf, int sizex,
int sizey, float *pixbuf_out, float *offset, float *slope, float *power);
void BLI_pixbuf_color_balance_float_float(float *pixbuf, int sizex, int
sizey, float *offset, float *slope, float *power);

/* get interpolated pixel RGBA values at given point */
void BLI_pixbuf_neareast_interpolation_byte(unsigned int *in, int inx, int
iny, unsigned char out[4], float u, float v);
void BLI_pixbuf_neareast_interpolation_float(float *in, int inx, int iny,
float out[4], float u, float v);
void BLI_pixbuf_bilinear_interpolation_byte(unsigned int *in, int inx, int
iny, unsigned char out[4], float u, float v);
void BLI_pixbuf_bilinear_interpolation_float(float *in, int inx, int iny,
float out[4], float u, float v);
void BLI_pixbuf_bilinear_interpolation_wrap_byte(unsigned int *in, int inx,
int iny, unsigned char out[4], float u, float v);
void BLI_pixbuf_bilinear_interpolation_wrap_float(float *in, int inx, int
iny, float out[4], float u, float v);
void BLI_pixbuf_bicubic_interpolation_byte(unsigned int *in, int inx, int
iny, unsigned char out[4], float u, float v);
void BLI_pixbuf_bicubic_interpolation_float(float *in, int inx, int iny,
float out[4], float u, float v);

/* multiply 2 tansfrom matrices */
int BLI_pixbuf_is_transform_matrix_identity(float matrix[3][3]);
void BLI_pixbuf_multiply_transform_matrix(float a[3][3], float b[3][3],
float out[3][3]);
void BLI_pixbuf_apply_transform_matrix_byte(unsigned int *inbuf, int inx,
int iny, unsigned int *outbuf, int outx, int outy, float matrix[3][3], int
interpolation);
void BLI_pixbuf_apply_transform_matrix_float(float *inbuf, int inx, int iny,
float *outbuf, int outx, int outy, float matrix[3][3], int interpolation);

#define BLI_PIXBUF_INTERP_NEAREST    0
#define BLI_PIXBUF_INTERP_BILINEAR    1
#define BLI_PIXBUF_INTERP_BICUBIC    2

#endif


More information about the Bf-committers mailing list