1 /* ScummVM - Scumm Interpreter 2 * Copyright (C) 2002-2003 The ScummVM project, Fredrick Meunier and 3 * Philip Kendall 4 * 5 * HQ2x and HQ3x scalers taken from HiEnd3D Demos (http://www.hiend3d.com) 6 * Copyright (C) 2003 MaxSt ( maxst@hiend3d.com ) 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License along 19 * with this program; if not, write to the Free Software Foundation, Inc., 20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21 * 22 * $Header$ 23 */ 24 25 #ifndef SCALER_H 26 #define SCALER_H 27 28 #include <libspectrum.h> 29 30 typedef enum scaler_type { 31 SCALER_HALF = 0, 32 SCALER_HALFSKIP, 33 SCALER_NORMAL, 34 SCALER_DOUBLESIZE, 35 SCALER_TRIPLESIZE, 36 SCALER_2XSAI, 37 SCALER_SUPER2XSAI, 38 SCALER_SUPEREAGLE, 39 SCALER_ADVMAME2X, 40 SCALER_ADVMAME3X, 41 SCALER_TV2X, 42 SCALER_TV3X, 43 SCALER_TIMEXTV, 44 SCALER_DOTMATRIX, 45 SCALER_TIMEX1_5X, 46 SCALER_PALTV, 47 SCALER_PALTV2X, 48 SCALER_PALTV3X, 49 SCALER_HQ2X, 50 SCALER_HQ3X, 51 52 SCALER_NUM /* End marker; do not remove */ 53 } scaler_type; 54 55 typedef enum scaler_flags_t { 56 SCALER_FLAGS_NONE = 0, 57 SCALER_FLAGS_EXPAND = 1 << 0, 58 } scaler_flags_t; 59 60 typedef void ScalerProc( const libspectrum_byte *srcPtr, 61 libspectrum_dword srcPitch, 62 libspectrum_byte *dstPtr, libspectrum_dword dstPitch, 63 int width, int height ); 64 65 /* The type of function used to expand the area dirtied by a scaler */ 66 typedef void scaler_expand_fn( int *x, int *y, int *w, int *h, 67 int image_width, int image_height ); 68 69 extern scaler_type current_scaler; 70 extern ScalerProc *scaler_proc16, *scaler_proc32; 71 extern scaler_flags_t scaler_flags; 72 extern scaler_expand_fn *scaler_expander; 73 extern int scalers_registered; 74 75 typedef int (*scaler_available_fn)( scaler_type scaler ); 76 77 int scaler_select_id( const char *scaler_mode ); 78 void scaler_register_clear( void ); 79 int scaler_select_scaler( scaler_type scaler ); 80 void scaler_register( scaler_type scaler ); 81 int scaler_is_supported( scaler_type scaler ); 82 const char *scaler_name( scaler_type scaler ); 83 ScalerProc *scaler_get_proc16( scaler_type scaler ); 84 ScalerProc *scaler_get_proc32( scaler_type scaler ); 85 scaler_flags_t scaler_get_flags( scaler_type scaler ); 86 float scaler_get_scaling_factor( scaler_type scaler ); 87 scaler_expand_fn* scaler_get_expander( scaler_type scaler ); 88 89 int scaler_select_bitformat( libspectrum_dword BitFormat ); 90 91 #endif 92