PLplot
5.10.0
|
00001 // Copyright (C) 2005-2014 Alan W. Irwin 00002 // 00003 // This file is part of PLplot. 00004 // 00005 // PLplot is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU Library General Public License as published 00007 // by the Free Software Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // PLplot is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU Library General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Library General Public License 00016 // along with PLplot; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 // 00019 //-------------------------------------------------------------------------- 00020 // 00021 // This file contains deprecated routines to provide backwards compatibility 00022 // for a while. For each routine the new routine you should be using instead 00023 // is explicitly commented. 00024 // 00025 00026 #include "plplotP.h" 00027 00028 #ifdef PL_DEPRECATED 00029 00030 // The following functions have been removed from plplot ahead of the 5.9.8 00031 // release. They have long been advertised as deprecated. 00032 // plParseOpts 00033 // plHLS_RGB 00034 // plRGB_HLS 00035 // plarrows 00036 00037 00038 // The following functions have been marked as obsolete for some time, 00039 // but were formally deprecated as of version 5.9.8 00040 // plrgb 00041 // plrgb1 00042 // plhls 00043 00044 // The following function was formally deprecated in 5.9.10. 00045 // plwid 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 // void plwid() 00127 // 00128 // Set pen width using a deprecated integer width value rather than 00129 // the recommended plwidth call with floating-point width value. 00130 //-------------------------------------------------------------------------- 00131 00132 void 00133 c_plwid( PLINT width ) 00134 { 00135 plwarn( "plwid: function deprecated. Use plwidth instead" ); 00136 plwidth( (PLFLT) width ); 00137 } 00138 00139 #endif // PL_DEPRECATED