OUTPUT:
RETVAL
+AV *
+get_RGB ( pixel_format, pixel )
+ SDL_PixelFormat *pixel_format
+ Uint32 pixel
+ CODE:
+ Uint8 r,g,b;
+ SDL_GetRGB(pixel,pixel_format,&r,&g,&b);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(r));
+ av_push(RETVAL,newSViv(g));
+ av_push(RETVAL,newSViv(b));
+ OUTPUT:
+ RETVAL
+AV *
+get_RGBA ( pixel_format, pixel )
+ SDL_PixelFormat *pixel_format
+ Uint32 pixel
+ CODE:
+ Uint8 r,g,b,a;
+ SDL_GetRGBA(pixel,pixel_format,&r,&g,&b,&a);
+ RETVAL = newAV();
+ av_push(RETVAL,newSViv(r));
+ av_push(RETVAL,newSViv(g));
+ av_push(RETVAL,newSViv(b));
+ av_push(RETVAL,newSViv(a));
+ OUTPUT:
+ RETVAL
Comment out for now as it does not compile
AV *
-GetRGB ( surface, pixel )
- SDL_Surface *surface
- Uint32 pixel
- CODE:
- Uint8 r,g,b;
- SDL_GetRGB(pixel,surface->format,&r,&g,&b);
- RETVAL = newAV();
- av_push(RETVAL,newSViv(r));
- av_push(RETVAL,newSViv(g));
- av_push(RETVAL,newSViv(b));
- OUTPUT:
- RETVAL
-
-AV *
GetRGBA ( surface, pixel )
SDL_Surface *surface
Uint32 pixel
use Test::More;
use SDL::Rect;
-plan ( tests => 28);
+plan ( tests => 30);
use_ok( 'SDL::Video' );
display_format_alpha
set_color_key
set_alpha
+ get_RGB
+ get_RGBA
/;
can_ok ('SDL::Video', @done);
0, '[set_alpha] Returns 0 on success'
) ;
+is_deeply(SDL::Video::get_RGB($display->format, 0), [0,0,0], '[get_RGB] returns r,g,b');
+is_deeply(SDL::Video::get_RGBA($display->format, 0), [0,0,0,255], '[get_RGBA] returns r,g,b,a');
my @left = qw/
get_gamma_ramp
- get_RGB
- get_RGBA
load_BMP
save_BMP
set_clip_rect