src/test/SDL_test_imageBlit.c
changeset 6763 9cbd31a3450b
parent 6762 c680e085a5f2
child 6885 700f1b25f77f
     1.1 --- a/src/test/SDL_test_imageBlit.c	Thu Dec 20 08:50:36 2012 -0800
     1.2 +++ b/src/test/SDL_test_imageBlit.c	Sat Dec 22 16:06:55 2012 -0800
     1.3 @@ -535,6 +535,32 @@
     1.4    "\0\0",
     1.5  };
     1.6  
     1.7 +/**
     1.8 + * \brief Returns the Blit test image as SDL_Surface.
     1.9 + */
    1.10 +SDL_Surface *SDLTest_ImageBlit()
    1.11 +{
    1.12 +   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
    1.13 +        (void*)SDLTest_imageBlit.pixel_data,
    1.14 +        SDLTest_imageBlit.width, 
    1.15 +        SDLTest_imageBlit.height, 
    1.16 +        SDLTest_imageBlit.bytes_per_pixel * 8, 
    1.17 +        SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel,
    1.18 +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
    1.19 +         0xff000000, /* Red bit mask. */
    1.20 +         0x00ff0000, /* Green bit mask. */
    1.21 +         0x0000ff00, /* Blue bit mask. */
    1.22 +         0x000000ff  /* Alpha bit mask. */
    1.23 +#else
    1.24 +         0x000000ff, /* Red bit mask. */
    1.25 +         0x0000ff00, /* Green bit mask. */
    1.26 +         0x00ff0000, /* Blue bit mask. */
    1.27 +         0xff000000  /* Alpha bit mask. */
    1.28 +#endif
    1.29 +         );
    1.30 +   return surface;
    1.31 +}
    1.32 +
    1.33  const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
    1.34    80, 60, 3,
    1.35    "\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"
    1.36 @@ -992,6 +1018,32 @@
    1.37    "\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",
    1.38  };
    1.39  
    1.40 +/**
    1.41 + * \brief Returns the BlitColor test image as SDL_Surface.
    1.42 + */
    1.43 +SDL_Surface *SDLTest_ImageBlitColor()
    1.44 +{
    1.45 +   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
    1.46 +        (void*)SDLTest_imageBlitColor.pixel_data,
    1.47 +        SDLTest_imageBlitColor.width, 
    1.48 +        SDLTest_imageBlitColor.height, 
    1.49 +        SDLTest_imageBlitColor.bytes_per_pixel * 8, 
    1.50 +        SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel,
    1.51 +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
    1.52 +         0xff000000, /* Red bit mask. */
    1.53 +         0x00ff0000, /* Green bit mask. */
    1.54 +         0x0000ff00, /* Blue bit mask. */
    1.55 +         0x000000ff  /* Alpha bit mask. */
    1.56 +#else
    1.57 +         0x000000ff, /* Red bit mask. */
    1.58 +         0x0000ff00, /* Green bit mask. */
    1.59 +         0x00ff0000, /* Blue bit mask. */
    1.60 +         0xff000000  /* Alpha bit mask. */
    1.61 +#endif
    1.62 +         );
    1.63 +   return surface;
    1.64 +}
    1.65 +
    1.66  const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
    1.67    80, 60, 3,
    1.68    "\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"
    1.69 @@ -1478,3 +1530,28 @@
    1.70    "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
    1.71  };
    1.72  
    1.73 +/**
    1.74 + * \brief Returns the BlitAlpha test image as SDL_Surface.
    1.75 + */
    1.76 +SDL_Surface *SDLTest_ImageBlitAlpha()
    1.77 +{
    1.78 +   SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( 
    1.79 +        (void*)SDLTest_imageBlitAlpha.pixel_data,
    1.80 +        SDLTest_imageBlitAlpha.width, 
    1.81 +        SDLTest_imageBlitAlpha.height, 
    1.82 +        SDLTest_imageBlitAlpha.bytes_per_pixel * 8,
    1.83 +        SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel,
    1.84 +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
    1.85 +         0xff000000, /* Red bit mask. */
    1.86 +         0x00ff0000, /* Green bit mask. */
    1.87 +         0x0000ff00, /* Blue bit mask. */
    1.88 +         0x000000ff  /* Alpha bit mask. */
    1.89 +#else
    1.90 +         0x000000ff, /* Red bit mask. */
    1.91 +         0x0000ff00, /* Green bit mask. */
    1.92 +         0x00ff0000, /* Blue bit mask. */
    1.93 +         0xff000000  /* Alpha bit mask. */
    1.94 +#endif
    1.95 +         );
    1.96 +   return surface;
    1.97 +}