News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

BlitImage

Started by kevin, January 08, 2006, 09:15:16 AM

Previous topic - Next topic

kevin

Command: BlitImage    (in PB1.31)


  Sadly BlitImage  is complex command.   It's purpose is intended to provide some single pass merged/transfer routines between  FX buffers to output to a combined destination buffer.    Using MMX optimizations wherever possible.   

   But current there's only 5 available modes.




Mode 1 - (PB_BlitMode_Clear)

     - Mode #1  performs a transfer of source image to the destination, with interleaved clearing of the source image.   
   

    Parameters

       * Note last two parameters are unused in this mode
       * Transparency is not supported

BlitMode=1
            blitimage SrcImage,X#,Y#,transparentflag,Blitmode,ClrRGB,0,0


Replaces this.



         DrawIMage SrcImage,x#,y#,0
         Rendertoimage SrcImage
         Cls 0
         rendertoscreen


   -  Supports only 16bit + 32bit display modes with MMX extensions         






Mode 32 - (PB_BlitMode_Alpha50)

     - Mode 32  performs a alpha merege (50% of each image) transfer of source image with a second merged image.

     Neither source image is effected.   


    Parameters
       * Note last two parameters are unused in this mode
       * Transparency is not supported



BlitMOde=32
SetBlitImageBuffer BlendIMage  ; The image you wish to merge the src with
BlitImage SrcImage,x#,y#,transparentflag,Blitmode,0,0,0


Replaces this.

 
       NOT AVAILABLE   



   -  Supports 16bit (565 & 555) and 32bit display modes with and without MMX extensions         

  - 24BIT is NOT supported









Mode 64 - (PB_BlitMode_AlphaAdd)

     - Mode64  performs a transfer of source image to the destination, while performing an global alpha addition to the pixels in the source image. The source image is not effected.   


    Parameters
       * Note last two parameters are unused in this mode
       * Transparency is not supported

BlitMode=64
blitimage SrcImage,x#,y#,transparentflag,Blitmode,AddRGB,0,0


Replaces this.

 
         DrawIMage SrcImage,x#,y#,0
         Rendertoimage SrcImage
         oldink=getinkmode()
         w=getimagewidth(srcimage)
         h=getimageheight(srcimage)
         inkmode 1+64
         Boxc 0,0,w,h,1,AlphaAddRGB
         inkmode Oldink
          rendertoscreen



   -  Supports 16bit (565 & 555) and 32bit display modes with and without MMX extensions         

  - 24BIT is NOT supported




Mode 128  - (PB_BlitMode_AlphaSub)


     - Mode #128  performs a transfer of source image to the destination, while performing a global alpha subtraction from the pixels in the source image.   The source image is not effected.


    Parameters

       * Note last two parameters are unused in this mode
       *Transparency is not supported

BlitMode=128
blitimage SrcImage,x#,y#,transparentflag,Blitmode,SubtractRGB,0,0


Replaces this.

 
         DrawIMage SrcImage,x#,y#,0
         Rendertoimage SrcImage
         oldink=getinkmode()
         w=getimagewidth(srcimage)
         h=getimageheight(srcimage)
        inkmode 1+128
         Boxc 0,0,w,h,1,AlphaSubtractRGB
         inkmode Oldink
          rendertoscreen


   -  Supports 16bit (565 & 555) and 32bit display modes with and without MMX extensions         

   - 24BIT is NOT supported




Examples

Alpha Addition - Sprite/Circle Particles

Sprite Render mode Example (OLD)

kevin

#1