X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Ffgis.git;a=blobdiff_plain;f=lib%2Fclr.c;fp=lib%2Fclr.c;h=71e7f966d8965faea9110e42735bbcf2b742b00d;hp=ac92d495e9b2da5c60e1cbc8fb21f0d383263f24;hb=8d7c92e1a47c24c89b96e384aac6b808e5d4ecde;hpb=ed514d6406b2a9110a2dcc043b4c6a1af755e081 diff --git a/lib/clr.c b/lib/clr.c index ac92d49..71e7f96 100644 --- a/lib/clr.c +++ b/lib/clr.c @@ -1,14 +1,42 @@ +/****************************************************************************** + * $Id: clr.c,v 1.2 2003-01-07 10:59:52 dron Exp $ + * + * Project: Library fo reading EPPL7 file format + * Purpose: Read palette from the EPPL7 file + * + ****************************************************************************** + * + * Copyright (C) 1997, Victor Wagner + * Copyright (C) 2003, Andrey Kiselev + * + * This program 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 2, or (at your option) + * any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + ***************************************************************************** + */ + #include #include #include "eppl_ut.h" #include #include -int defarray[]={ +static int defarray[]={ #include "defpal.h" }; PALETTE default_palette=defarray; PALETTE read_palette(FILE *f) -/* þÉÔÁÅÔ ÐÁÌÉÔÒÕ ÉÚ ÆÁÊÌÁ × ÆÏÒÍÁÔÅ EPPL7 */ +/* Read palette from the EPPL7 file */ { PALETTE pal; int index,r,g,b; pal=memcpy(malloc(256*sizeof(long int)),default_palette,256*sizeof(long int)); @@ -30,14 +58,15 @@ char *ppm_pixel(PALETTE palette,int index) return buffer; } -char *Xcolor_string(PALETTE palette,int index) +/* char *Xcolor_string(PALETTE palette,int index) { int value; static char buffer[24]; if(index>=0&&index<255) value=palette[index]; else value=palette[255]; sprintf(buffer,"#%06x",value); return buffer; -} +}*/ + XColor Xcolor_struct(PALETTE palette,int index) { int value; XColor buffer;