/* Copyright (C) 1998 BJ Eirich (aka vecna) 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 of the License, 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 Lic 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 // ================================= Data ==================================== struct span { int begin, end; // begin & end location of span int len, inverse; // lenth of span and inverse on/off }; struct span spans[32]; // maximum of 32 spans. char numspans; // number of active spans in PDF unsigned char *transparencytbl; // full transparency table (64k) char outname[100]; // output filename char paldefname[100]; // palette definition filename char *strbuf; // generic string buffer char spanidx[256]; // Color -> Span xlat table // ================================= Code ==================================== void ParsePaletteDefinition(FILE *f) { int i; fscanf(f,"%s",strbuf); if (stricmp("gradients",strbuf)) { printf("Not a valid PDF file. \n"); exit(-1); } fscanf(f,"%s",strbuf); numspans=atoi(strbuf); for (i=0; i