Blender Git Loki
Git Commits -> Revision 445d077
Revision 445d077 by Benoit Bolsee (master) December 8, 2009, 10:02 (GMT) |
BGE: Add plot method to VideoTexture.ImageBuff class. Synopsis: plot(brush,width,height,x,y,mode) plot(imgbuff,x,y,mode) The first form uses a byte array containing the brush shape. The second form uses another ImageBuff object as a brush. The ImageBuff object must be initialized before you can call these methods. Use load(rgb_buffer,sizex,sizey) method to create an image buffer of given size (with alpha channel set to 255). The brush is plotted directly in the image buffer. The texture is updated only when the VideoTexture.Texture parent object is refreshed: this will download the image buffer to the GPU. brush: Byte array containing RGBA data to be plotted in image buffer. The data must be continuous in memory, organized row by row starting from lower left corner of the image. Each pixel is 4 bytes representing RGBA data in that order. width: Horizontal size in pixels of image in brush. height: Vertical size in pixels of the image in brush. imgbuff:Another ImageBuff object that is used as a brush. The object must have been initialized first with load(). x: Horizontal position in pixel from left side of the image buffer where the brush will be plotted. The brush is plotted on pixels positions x->x+width-1. Clipping is performed if the brush falls partially outside the image buffer. y: Vertical position in pixel from bottom side of the image buffer where the brush will be plotted. mode: Mode of drawing. Use one of the following value: 0 : MIX 1 : ADD 2 : SUB 3 : MUL 4 : LIGHTEN 5 : DARKEN 6 : ERASE ALPHA 7 : ADD ALPHA 1000 : COPY RGBA (default) 1001 : COPY RGB 1002 : COPY ALPHA Modes 0 to 7 are 'blend' modes: the brush pixels are combined with the image pixel in various ways. Refer to Blender documentation to learn more about these modes. |
Commit Details:
Full Hash: 445d077cf4ecc84b5d5cf422bfb2040186d60164
SVN Revision: 25207
Parent Commit: 5132b6a
Lines Changed: +150, -15