2001-04-26 16:45:43 +00:00
|
|
|
/*
|
|
|
|
SDL - Simple DirectMedia Layer
|
2011-02-11 22:37:15 -08:00
|
|
|
Copyright (C) 1997-2011 Sam Lantinga
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2006-02-01 06:32:25 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2001-04-26 16:45:43 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2006-02-01 06:32:25 +00:00
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2006-02-01 06:32:25 +00:00
|
|
|
Lesser General Public License for more details.
|
2001-04-26 16:45:43 +00:00
|
|
|
|
2006-02-01 06:32:25 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
Sam Lantinga
|
2001-12-14 12:38:15 +00:00
|
|
|
slouken@libsdl.org
|
2001-04-26 16:45:43 +00:00
|
|
|
*/
|
2006-02-21 08:46:50 +00:00
|
|
|
#include "SDL_config.h"
|
2001-04-26 16:45:43 +00:00
|
|
|
|
|
|
|
#include "SDL_video.h"
|
|
|
|
|
2006-07-10 21:04:37 +00:00
|
|
|
/* This is the software implementation of the YUV texture support */
|
|
|
|
|
2009-09-07 04:51:29 +00:00
|
|
|
struct SDL_SW_YUVTexture
|
|
|
|
{
|
|
|
|
Uint32 format;
|
|
|
|
Uint32 target_format;
|
|
|
|
int w, h;
|
|
|
|
Uint8 *pixels;
|
|
|
|
int *colortab;
|
|
|
|
Uint32 *rgb_2_pix;
|
|
|
|
void (*Display1X) (int *colortab, Uint32 * rgb_2_pix,
|
|
|
|
unsigned char *lum, unsigned char *cr,
|
|
|
|
unsigned char *cb, unsigned char *out,
|
|
|
|
int rows, int cols, int mod);
|
|
|
|
void (*Display2X) (int *colortab, Uint32 * rgb_2_pix,
|
|
|
|
unsigned char *lum, unsigned char *cr,
|
|
|
|
unsigned char *cb, unsigned char *out,
|
|
|
|
int rows, int cols, int mod);
|
|
|
|
|
|
|
|
/* These are just so we don't have to allocate them separately */
|
|
|
|
Uint16 pitches[3];
|
|
|
|
Uint8 *planes[3];
|
|
|
|
|
|
|
|
/* This is a temporary surface in case we have to stretch copy */
|
|
|
|
SDL_Surface *stretch;
|
|
|
|
SDL_Surface *display;
|
|
|
|
};
|
|
|
|
|
2006-07-10 21:04:37 +00:00
|
|
|
typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture;
|
|
|
|
|
2008-11-24 23:25:36 +00:00
|
|
|
SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h);
|
2006-07-10 21:04:37 +00:00
|
|
|
int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
|
|
|
|
int *pitch);
|
|
|
|
int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
|
|
|
|
const void *pixels, int pitch);
|
|
|
|
int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
|
2011-02-03 00:19:40 -08:00
|
|
|
void **pixels, int *pitch);
|
2006-07-10 21:04:37 +00:00
|
|
|
void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata);
|
|
|
|
int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
|
|
|
|
Uint32 target_format, int w, int h, void *pixels,
|
|
|
|
int pitch);
|
|
|
|
void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata);
|
|
|
|
|
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|