/* GnarlPlot colour code V0.31 28/8/04
   Copyright 2008 Jeffrey Lee
   This file is part of GnarlPlot.
   GnarlPlot is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   GnarlPlot 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 General Public License for more details.
   You should have received a copy of the GNU General Public License
   along with GnarlPlot.  If not, see <http://www.gnu.org/licenses/>. */

#ifndef _GP_COL_C
#define _GP_COL_C

#define GP_PS_8 0
#define GP_PS_16 1
#define GP_PS_24 2

extern const int gp_col_conv(int ips,int ic,int ops);
/* Convert colour ic in pixel size ips to size ops */

extern const int gp_col_convx(int ips,int ic,int ops);
/* Convert colour ic in pixel size ips to size ops
   Returns the colour expanded to fill the entire word */

extern const int gp_col_to_tbgr(int col);
/* Converts BGGRBRTT format to TTBBGGRR format */

extern const int gp_col_from_tbgr(int col);
/* Converts TTBBGGRR format to BGGRBRTT format */

extern const int gp_col_24_grey(int spr,int scr);
/* Returns 24bpp sprite pixel 'spr' (with greyscale mask in top byte) combined with 24bpp screen pixel 'scr' (e.g. as for GP_MT_GREY) */

extern const int gp_col_24_rgb(int spr,int mask,int scr);
/* Returns 24bpp sprite pixel 'spr' with 24bpp mask 'mask' combined with 24bpp screen pixel 'scr' (e.g. as for GP_MT_RGB) */

extern const int gp_col_trueps(int ps,int mt);
/* Returns the 'true' pixel size of a given format
   I.e. how much space a pixel & mask pair will take up */

#endif
