00001 // $Id: pldeprecated.c 11682 2011-03-31 02:55:49Z airwin $ 00002 // 00003 // Copyright (C) 2005 Alan W. Irwin 00004 // 00005 // This file is part of PLplot. 00006 // 00007 // PLplot is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU Library General Public License as published 00009 // by the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // PLplot is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU Library General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Library General Public License 00018 // along with PLplot; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 // 00021 //-------------------------------------------------------------------------- 00022 // 00023 // This file contains deprecated routines to provide backwards compatibility 00024 // for a while. For each routine the new routine you should be using instead 00025 // is explicitly commented. 00026 // 00027 00028 #ifdef PL_DEPRECATED 00029 00030 #define NEED_PLDEBUG 00031 #include "plplotP.h" 00032 00033 // The following functions have been removed from plplot ahead of the 5.9.8 00034 // release. They have long been advertised as deprecated. 00035 // plParseOpts 00036 // plHLS_RGB 00037 // plRGB_HLS 00038 // plarrows 00039 00040 00041 // The following functions have been marked as obsolete for some time, 00042 // but were formally deprecated as of version 5.9.8 00043 // plrgb 00044 // plrgb1 00045 // plhls 00046 00047 //-------------------------------------------------------------------------- 00048 // plrgb() 00049 // 00050 // Set line color by red, green, blue from 0. to 1. 00051 // Do NOT use this. Only retained for backward compatibility 00052 //-------------------------------------------------------------------------- 00053 00054 void 00055 c_plrgb( PLFLT r, PLFLT g, PLFLT b ) 00056 { 00057 plwarn( "plrgb: function deprecated. Use plscol instead" ); 00058 00059 if ( plsc->level < 1 ) 00060 { 00061 plabort( "plrgb: Please call plinit first" ); 00062 return; 00063 } 00064 00065 plsc->icol0 = PL_RGB_COLOR; 00066 plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) ); 00067 plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) ); 00068 plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) ); 00069 00070 plsc->curcmap = 0; 00071 plP_state( PLSTATE_COLOR0 ); 00072 } 00073 00074 //-------------------------------------------------------------------------- 00075 // plrgb1() 00076 // 00077 // Set line color by 8 bit RGB values. 00078 // Do NOT use this. Only retained for backward compatibility 00079 //-------------------------------------------------------------------------- 00080 00081 void 00082 c_plrgb1( PLINT r, PLINT g, PLINT b ) 00083 { 00084 plwarn( "plrgb1: function deprecated. Use plscol instead" ); 00085 00086 if ( plsc->level < 1 ) 00087 { 00088 plabort( "plrgb1: Please call plinit first" ); 00089 return; 00090 } 00091 if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) ) 00092 { 00093 plabort( "plrgb1: Invalid color" ); 00094 return; 00095 } 00096 00097 plsc->icol0 = PL_RGB_COLOR; 00098 plsc->curcolor.r = r; 00099 plsc->curcolor.g = g; 00100 plsc->curcolor.b = b; 00101 00102 plsc->curcmap = 0; 00103 plP_state( PLSTATE_COLOR0 ); 00104 } 00105 00106 //-------------------------------------------------------------------------- 00107 // void plhls() 00108 // 00109 // Set current color by hue, lightness, and saturation. 00110 // Convert hls color coordinates to rgb, then call plrgb. 00111 // Do NOT use this. Only retained for backward compatibility 00112 //-------------------------------------------------------------------------- 00113 00114 void 00115 c_plhls( PLFLT h, PLFLT l, PLFLT s ) 00116 { 00117 PLFLT r, g, b; 00118 00119 plwarn( "plhls: function deprecated. Use plhlsrgb / plscol instead" ); 00120 00121 c_plhlsrgb( h, l, s, &r, &g, &b ); 00122 plrgb( r, g, b ); 00123 } 00124 00125 00126 #endif // PL_DEPRECATED