Update of /cvsroot/php-directfb/PHP-DirectFB/examples
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14178
Modified Files:
df_dok.php
Added Files:
image_lut.dsc
Removed Files:
palette.dsc
Log Message:
Fixed --blit-lut and --blit-lut-blend; now we use a preallocated surface
generated by directfb-phpsource.
Index: df_dok.php
===================================================================
RCS file: /cvsroot/php-directfb/PHP-DirectFB/examples/df_dok.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** df_dok.php 13 Nov 2004 17:04:02 -0000 1.1
--- df_dok.php 15 Nov 2004 15:09:20 -0000 1.2
***************
*** 33,37 ****
dl( "php_directfb.so" );
! include( "./palette.dsc" );
/* the super interface */
--- 33,37 ----
dl( "php_directfb.so" );
! include( "./image_lut.dsc" );
/* the super interface */
***************
*** 1128,1135 ****
/* create a surface and render an image to it */
{
! $palette = $dfb->CreatePalette( $image_lut_palette_dsc );
! if (!$palette)
! DirectFBErrorFatal( "IDirectFB::CreatePalette()" );
$dsc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
$dsc->width = $SX;
--- 1128,1139 ----
/* create a surface and render an image to it */
{
! $tmp = $dfb->CreateSurface( $image_lut_desc );
! if (!$tmp)
! DirectFBErrorFatal( "IDirectFB::CreateSurface()" );
+ $palette = $tmp->GetPalette();
+ if (!$palette)
+ DirectFBErrorFatal( "IDirectFBSurface::GetPalette()" );
+
$dsc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
$dsc->width = $SX;
***************
*** 1143,1150 ****
$image_lut->SetPalette( $palette );
! $image_lut->StretchBlit( $image32a );
$palette->Release();
! unset( $image_lut_palette_dsc );
}
--- 1147,1158 ----
$image_lut->SetPalette( $palette );
! $image_lut->StretchBlit( $tmp );
$palette->Release();
! $tmp->Release();
!
! unset( $image_lut_desc );
! unset( $image_lut_palette );
! unset( $image_lut_data );
}
--- palette.dsc DELETED ---
--- NEW FILE: image_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\0\0\0\0\0\0\0\0\0\0\0\0".
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".
[...1514 lines suppressed...]
new DFBColor( 0x80, 0xca, 0xb9, 0xc2 ),
new DFBColor( 0x80, 0x6a, 0x54, 0x47 ),
new DFBColor( 0x80, 0x86, 0x7e, 0x78 ),
new DFBColor( 0x80, 0xb7, 0xc4, 0xe2 ),
new DFBColor( 0x80, 0xcc, 0xa2, 0x64 )
);
$image_lut_desc = new DFBSurfaceDescription(
DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT |
DSDESC_PREALLOCATED | DSDESC_PALETTE,
0,
175,
200,
DSPF_LUT8,
$image_lut_data,
176,
$image_lut_palette
);
?>
|