PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pldeprecated.c
Go to the documentation of this file.
1 // $Id: pldeprecated.c 12953 2014-01-22 23:18:38Z airwin $
2 //
3 // Copyright (C) 2005 Alan W. Irwin
4 //
5 // This file is part of PLplot.
6 //
7 // PLplot is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU Library General Public License as published
9 // by the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // PLplot is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public License
18 // along with PLplot; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 //--------------------------------------------------------------------------
22 //
23 // This file contains deprecated routines to provide backwards compatibility
24 // for a while. For each routine the new routine you should be using instead
25 // is explicitly commented.
26 //
27 
28 #include "plplotP.h"
29 
30 #ifdef PL_DEPRECATED
31 
32 // The following functions have been removed from plplot ahead of the 5.9.8
33 // release. They have long been advertised as deprecated.
34 // plParseOpts
35 // plHLS_RGB
36 // plRGB_HLS
37 // plarrows
38 
39 
40 // The following functions have been marked as obsolete for some time,
41 // but were formally deprecated as of version 5.9.8
42 // plrgb
43 // plrgb1
44 // plhls
45 
46 // The following function was formally deprecated in 5.9.10.
47 // plwid
48 
49 //--------------------------------------------------------------------------
50 // plrgb()
51 //
52 // Set line color by red, green, blue from 0. to 1.
53 // Do NOT use this. Only retained for backward compatibility
54 //--------------------------------------------------------------------------
55 
56 void
57 c_plrgb( PLFLT r, PLFLT g, PLFLT b )
58 {
59  plwarn( "plrgb: function deprecated. Use plscol instead" );
60 
61  if ( plsc->level < 1 )
62  {
63  plabort( "plrgb: Please call plinit first" );
64  return;
65  }
66 
67  plsc->icol0 = PL_RGB_COLOR;
68  plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) );
69  plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) );
70  plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) );
71 
72  plsc->curcmap = 0;
74 }
75 
76 //--------------------------------------------------------------------------
77 // plrgb1()
78 //
79 // Set line color by 8 bit RGB values.
80 // Do NOT use this. Only retained for backward compatibility
81 //--------------------------------------------------------------------------
82 
83 void
84 c_plrgb1( PLINT r, PLINT g, PLINT b )
85 {
86  plwarn( "plrgb1: function deprecated. Use plscol instead" );
87 
88  if ( plsc->level < 1 )
89  {
90  plabort( "plrgb1: Please call plinit first" );
91  return;
92  }
93  if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) )
94  {
95  plabort( "plrgb1: Invalid color" );
96  return;
97  }
98 
99  plsc->icol0 = PL_RGB_COLOR;
100  plsc->curcolor.r = r;
101  plsc->curcolor.g = g;
102  plsc->curcolor.b = b;
103 
104  plsc->curcmap = 0;
106 }
107 
108 //--------------------------------------------------------------------------
109 // void plhls()
110 //
111 // Set current color by hue, lightness, and saturation.
112 // Convert hls color coordinates to rgb, then call plrgb.
113 // Do NOT use this. Only retained for backward compatibility
114 //--------------------------------------------------------------------------
115 
116 void
117 c_plhls( PLFLT h, PLFLT l, PLFLT s )
118 {
119  PLFLT r, g, b;
120 
121  plwarn( "plhls: function deprecated. Use plhlsrgb / plscol instead" );
122 
123  c_plhlsrgb( h, l, s, &r, &g, &b );
124  plrgb( r, g, b );
125 }
126 
127 //--------------------------------------------------------------------------
128 // void plwid()
129 //
130 // Set pen width using a deprecated integer width value rather than
131 // the recommended plwidth call with floating-point width value.
132 //--------------------------------------------------------------------------
133 
134 void
135 c_plwid( PLINT width )
136 {
137  plwarn( "plwid: function deprecated. Use plwidth instead" );
138  plwidth( (PLFLT) width );
139 }
140 
141 #endif // PL_DEPRECATED