src/render/SDL_yuv_sw_c.h
changeset 5156 307ccc9c135e
parent 3697 f7b03b6838cb
child 5262 b530ef003506
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/render/SDL_yuv_sw_c.h	Thu Feb 03 00:19:40 2011 -0800
     1.3 @@ -0,0 +1,69 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2010 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#include "SDL_video.h"
    1.28 +
    1.29 +/* This is the software implementation of the YUV texture support */
    1.30 +
    1.31 +struct SDL_SW_YUVTexture
    1.32 +{
    1.33 +    Uint32 format;
    1.34 +    Uint32 target_format;
    1.35 +    int w, h;
    1.36 +    Uint8 *pixels;
    1.37 +    int *colortab;
    1.38 +    Uint32 *rgb_2_pix;
    1.39 +    void (*Display1X) (int *colortab, Uint32 * rgb_2_pix,
    1.40 +                       unsigned char *lum, unsigned char *cr,
    1.41 +                       unsigned char *cb, unsigned char *out,
    1.42 +                       int rows, int cols, int mod);
    1.43 +    void (*Display2X) (int *colortab, Uint32 * rgb_2_pix,
    1.44 +                       unsigned char *lum, unsigned char *cr,
    1.45 +                       unsigned char *cb, unsigned char *out,
    1.46 +                       int rows, int cols, int mod);
    1.47 +
    1.48 +    /* These are just so we don't have to allocate them separately */
    1.49 +    Uint16 pitches[3];
    1.50 +    Uint8 *planes[3];
    1.51 +
    1.52 +    /* This is a temporary surface in case we have to stretch copy */
    1.53 +    SDL_Surface *stretch;
    1.54 +    SDL_Surface *display;
    1.55 +};
    1.56 +
    1.57 +typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture;
    1.58 +
    1.59 +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h);
    1.60 +int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
    1.61 +                                 int *pitch);
    1.62 +int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
    1.63 +                            const void *pixels, int pitch);
    1.64 +int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
    1.65 +                          void **pixels, int *pitch);
    1.66 +void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata);
    1.67 +int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
    1.68 +                        Uint32 target_format, int w, int h, void *pixels,
    1.69 +                        int pitch);
    1.70 +void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata);
    1.71 +
    1.72 +/* vi: set ts=4 sw=4 expandtab: */