PLplot  5.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pldeprecated.c
Go to the documentation of this file.
1 // $Id: pldeprecated.c 12290 2013-01-30 08:25:49Z 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 //--------------------------------------------------------------------------
47 // plrgb()
48 //
49 // Set line color by red, green, blue from 0. to 1.
50 // Do NOT use this. Only retained for backward compatibility
51 //--------------------------------------------------------------------------
52 
53 void
54 c_plrgb( PLFLT r, PLFLT g, PLFLT b )
55 {
56  plwarn( "plrgb: function deprecated. Use plscol instead" );
57 
58  if ( plsc->level < 1 )
59  {
60  plabort( "plrgb: Please call plinit first" );
61  return;
62  }
63 
64  plsc->icol0 = PL_RGB_COLOR;
65  plsc->curcolor.r = MAX( 0, MIN( 255, (int) ( 256. * r ) ) );
66  plsc->curcolor.g = MAX( 0, MIN( 255, (int) ( 256. * g ) ) );
67  plsc->curcolor.b = MAX( 0, MIN( 255, (int) ( 256. * b ) ) );
68 
69  plsc->curcmap = 0;
71 }
72 
73 //--------------------------------------------------------------------------
74 // plrgb1()
75 //
76 // Set line color by 8 bit RGB values.
77 // Do NOT use this. Only retained for backward compatibility
78 //--------------------------------------------------------------------------
79 
80 void
81 c_plrgb1( PLINT r, PLINT g, PLINT b )
82 {
83  plwarn( "plrgb1: function deprecated. Use plscol instead" );
84 
85  if ( plsc->level < 1 )
86  {
87  plabort( "plrgb1: Please call plinit first" );
88  return;
89  }
90  if ( ( r < 0 || r > 255 ) || ( g < 0 || g > 255 ) || ( b < 0 || b > 255 ) )
91  {
92  plabort( "plrgb1: Invalid color" );
93  return;
94  }
95 
96  plsc->icol0 = PL_RGB_COLOR;
97  plsc->curcolor.r = r;
98  plsc->curcolor.g = g;
99  plsc->curcolor.b = b;
100 
101  plsc->curcmap = 0;
103 }
104 
105 //--------------------------------------------------------------------------
106 // void plhls()
107 //
108 // Set current color by hue, lightness, and saturation.
109 // Convert hls color coordinates to rgb, then call plrgb.
110 // Do NOT use this. Only retained for backward compatibility
111 //--------------------------------------------------------------------------
112 
113 void
114 c_plhls( PLFLT h, PLFLT l, PLFLT s )
115 {
116  PLFLT r, g, b;
117 
118  plwarn( "plhls: function deprecated. Use plhlsrgb / plscol instead" );
119 
120  c_plhlsrgb( h, l, s, &r, &g, &b );
121  plrgb( r, g, b );
122 }
123 
124 //--------------------------------------------------------------------------
125 // void plwid()
126 //
127 // Set pen width using a deprecated integer width value rather than
128 // the recommended plwidth call with floating-point width value.
129 //--------------------------------------------------------------------------
130 
131 void
132 c_plwid( PLINT width )
133 {
134  plwarn( "plwid: function deprecated. Use plwidth instead" );
135  plwidth( (PLFLT) width );
136 }
137 
138 #endif // PL_DEPRECATED
#define PL_RGB_COLOR
Definition: plplotP.h:290
#define MAX(a, b)
Definition: dsplint.c:28
#define PLSTATE_COLOR0
Definition: plplotP.h:330
#define plrgb
Definition: plplot.h:680
void c_plrgb(PLFLT r, PLFLT g, PLFLT b)
int PLINT
Definition: plplot.h:175
#define MIN(a, b)
Definition: dsplint.c:29
PLDLLIMPEXP void c_plwid(PLINT width)
void c_plhlsrgb(PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b)
Definition: plctrl.c:1245
void c_plhls(PLFLT h, PLFLT l, PLFLT s)
void c_plrgb1(PLINT r, PLINT g, PLINT b)
#define plwidth
Definition: plplot.h:756
void plabort(const char *errormsg)
Definition: plctrl.c:1877
void plP_state(PLINT op)
Definition: plcore.c:253
float PLFLT
Definition: plplot.h:159
void plwarn(const char *errormsg)
Definition: plctrl.c:1846