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