WPBDC 2013.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,518 @@
1
+ #ifndef _INTERNAL_H
2
+ #define _INTERNAL_H
3
+
4
+ // ---------------------------------------------------------------------
5
+ // --------Internal Data Structures and Constants ----------------------
6
+ // ---------------------------------------------------------------------
7
+
8
+ /*
9
+ Memory management convention:
10
+
11
+ Data structures TBridge, TGeometry, TLoading, and TAnalysis are managed according
12
+ to the following conventions.
13
+
14
+ o Caller allocates these objects. Our favorite allocation is as an array
15
+ of one element, e.g. TBridge bridge[1], so that the name 'bridge' can be
16
+ used as a pointer, avoiding a lot of &s in the code.
17
+ o Caller initializes a freshly allocated object by calling init_foo for an
18
+ object of type TFoo, e.g. init_bridge(bridge) for a TBridge.
19
+ o Caller "fills in" the initialized object by appropriate calls to "setup_foo"
20
+ "parse_foo", etc.
21
+ o Callers deallocate memory allocated by "fill in" routines by calling clear_foo.
22
+ o The clear_foo routines leave the object just as after init_foo.
23
+ o Most fill in routines begin by calling clear_foo and then allocate (malloc or calloc)
24
+ fresh internal storage for the object, e.g. for joint and member vectors in a TBridge.
25
+ */
26
+
27
+ // Need rubyish memory allocators.
28
+ #include "rubydefs.h"
29
+
30
+ // External interface
31
+ #include "judge.h"
32
+
33
+ // Defines that we don't want visible as Perl constants.
34
+ #define True ((TBool)1)
35
+ #define False ((TBool)0)
36
+ #define STATIC_ARRAY_SIZE(A) (sizeof A/sizeof A[0])
37
+ #define _STR(P) #P
38
+ #define STR(P) _STR(P)
39
+
40
+ #define NewStrSz(x,v,s,sz) \
41
+ do { \
42
+ sz = strlen(s)+1; \
43
+ New(x, v, sz, char); \
44
+ memcpy(v, s, sz); \
45
+ } while (0)
46
+
47
+ #define NewStr(x,v,s) \
48
+ do { \
49
+ unsigned sz; \
50
+ NewStrSz(x,v,s,sz); \
51
+ } while (0)
52
+
53
+ // Basic stuff.
54
+ typedef unsigned char TBool; // 1 byte
55
+ typedef double TFloat; // 8 bytes
56
+ typedef signed short TCoordinate; // 2 bytes
57
+ typedef unsigned short TElementNumber; // 2 bytes
58
+
59
+ // ---------------------------------------------------------------------
60
+ // -------- Structural elements ----------------------------------------
61
+ // ---------------------------------------------------------------------
62
+
63
+ // Bridge joint.
64
+ typedef struct joint_t {
65
+ TElementNumber number;
66
+ TCoordinate x, y;
67
+ } TJoint;
68
+
69
+ // Member cross-section attributes.
70
+ typedef struct x_section_t {
71
+ TElementNumber material;
72
+ TElementNumber section;
73
+ TElementNumber size;
74
+ } TXSection;
75
+
76
+ #define FORCE_STR_SIZE 16
77
+
78
+ // Bridge structural member.
79
+ typedef struct member_t {
80
+ TElementNumber number;
81
+ TElementNumber start_joint, end_joint;
82
+ TXSection x_section;
83
+ char compression[FORCE_STR_SIZE];
84
+ char tension[FORCE_STR_SIZE];
85
+ } TMember;
86
+
87
+ // ---------------------------------------------------------------------
88
+ // -------- Load scenarios ---------------------------------------------
89
+ // ---------------------------------------------------------------------
90
+
91
+ typedef unsigned TSupportType;
92
+
93
+ // Known support type categories.
94
+ #define ARCH_SUPPORT (1)
95
+ #define CABLE_SUPPORT_LEFT (2)
96
+ #define CABLE_SUPPORT_RIGHT (4)
97
+ #define INTERMEDIATE_SUPPORT (8)
98
+ #define HI_NOT_LO (16)
99
+
100
+ // Cable anchorage offset in grid units
101
+ #define CABLE_ANCHORAGE_X_OFFSET 32
102
+
103
+ // Scenario description.
104
+ typedef enum load_scenario_error_t {
105
+ LoadScenarioNoError,
106
+ LoadScenarioIndexRange,
107
+ LoadScenarioIndexValue,
108
+ } TLoadScenarioError;
109
+
110
+ // Load scenario. DON'T CHANGE THIS without changing the initialization constant below.
111
+ typedef struct load_scenario_t {
112
+ TLoadScenarioError error; // Error status.
113
+ TFloat grid_size; // Size of grid squares where joints are plotted.
114
+ TFloat joint_radius; // Radius of joint graphic.
115
+ unsigned load_case; // Load case 0 = A, 1 = B, 2 = C, 3 = D.
116
+ unsigned n_panels; // Number of panels in deck.
117
+ unsigned num_length_grids; // Number of grid squares in X direction.
118
+ unsigned over_meters; // Number of meters over the roadway allowed for truss height.
119
+ unsigned over_grids; // Number of grid squares above road surface (Y positive).
120
+ unsigned under_meters; // Number of meters under the roadway allowed for truss.
121
+ unsigned under_grids; // Number of grid squares below road surface (Y negative).
122
+ TSupportType support_type; // Type of support.
123
+ TElementNumber intermediate_support_joint_no; // Joint number of intermediate support; 0 if none.
124
+ TElementNumber n_loaded_joints; // Number of loaded joints (joints connected to road surface).
125
+ unsigned n_prescribed_joints; // Number of prescribed joints in this scenario.
126
+ TJoint *prescribed_joints; // List of joints determined by scenario.
127
+ } TLoadScenario;
128
+
129
+ #define INIT_LOAD_SCENARIO \
130
+ { /* TLoadScenario load_scenario; */ \
131
+ LoadScenarioNoError, /* Error status. */ \
132
+ 0.0, /* Size of grid squares where joints are plotted. */ \
133
+ 0.0, /* Radius of joint graphic. */ \
134
+ 0, /* Load case 0 = A, 1 = B, 2 = C, 3 = D. */ \
135
+ 0, /* Number of panels in deck. */ \
136
+ 0, /* Number of grid squares in X direction. */ \
137
+ 0, /* Number of meters over the roadway allowed for truss height. */ \
138
+ 0, /* Number of grid squares above road surface (Y positive). */ \
139
+ 0, /* Number of meters under the roadway allowed for truss. */ \
140
+ 0, /* Number of grid squares below road surface (Y negative). */ \
141
+ -1, /* Type of support. */ \
142
+ 0, /* Joint number of intermediate support; 0 if none. */ \
143
+ 0, /* Number of loaded joints (joints connected to road surface). */ \
144
+ 0, /* Number of prescribed joints in this scenario. */ \
145
+ (TJoint*)0, /* List of joints determined by scenario. */ \
146
+ }
147
+
148
+ typedef struct scenario_descriptor_t {
149
+ int index; // -1 for error condition
150
+ char id[SCENARIO_ID_SIZE + 1];
151
+ char number[SCENARIO_NUMBER_SIZE + 1];
152
+ TFloat site_cost;
153
+ } TScenarioDescriptor;
154
+
155
+ #define NULL_SCENARIO_DESCRIPTOR { -1, "----------", "---", -1 }
156
+
157
+ // ---------------------------------------------------------------------
158
+ // -------- Bridge -----------------------------------------------------
159
+ // ---------------------------------------------------------------------
160
+
161
+ // A compleat bridge. DON'T CHANGE THIS without re-aligning the
162
+ // initialization constant below.
163
+ typedef struct bridge_t {
164
+
165
+ TBridgeError error; // Parse error if any.
166
+ unsigned error_line; // Line where error occurred, 0 if none.
167
+
168
+ TVersion version; // WPBD version
169
+ TTestStatus test_status; // Client-recorded test status of design.
170
+ TScenarioDescriptor scenario_descriptor; // Scenario code, all blank if none.
171
+ char *designer; // Name of designer as string.
172
+ char *project_id; // Name of project as string.
173
+ unsigned n_design_iterations; // Number of design iterations.
174
+ TElementNumber n_joints; // Number of joints in bridge.
175
+ TJoint *joints; // Vector of joints.
176
+ TElementNumber n_members; // Number of members in bridge.
177
+ TMember *members; // Vector of members.
178
+ double label_pos; // Where labels are put on early, small projects.
179
+ TLoadScenario load_scenario; // Load data for this scenario.
180
+ } TBridge;
181
+
182
+ #define INIT_BRIDGE \
183
+ { /* TBrdige bridge; */ \
184
+ BridgeNoError, /* TBridgeError error; */ \
185
+ ~0u, /* unsigned error_line; */ \
186
+ \
187
+ 0x0000, /* TVersion version; */ \
188
+ NullTestStatus, /* TTestStatus test_status; */ \
189
+ NULL_SCENARIO_DESCRIPTOR, /* TScenarioDescriptor scenario_descriptor; */ \
190
+ NULL, /* char *designer; */ \
191
+ NULL, /* char *project_id; */ \
192
+ 0, /* unsigned n_design_iterations; */ \
193
+ 0, /* TElementNumber n_joints; */ \
194
+ NULL, /* TJoint *joints; */ \
195
+ 0, /* TElementNumber n_members; */ \
196
+ NULL, /* TMember *members; */ \
197
+ -1.0, /* double label_pos; */ \
198
+ INIT_LOAD_SCENARIO \
199
+ }
200
+
201
+ // Max line length in an unpacked bridge file.
202
+ #define MAX_LINE_LENGTH 512
203
+
204
+ // ---------------------------------------------------------------------
205
+ // -------- Parameters (of scenarios) ----------------------------------
206
+ // ---------------------------------------------------------------------
207
+
208
+ // Descriptors of member cross-sections.
209
+ #define NMaterials 3 // Number of available materials.
210
+ #define NSections 2 // Number of available sections.
211
+
212
+ // The available sections themselves (must match NSections above).
213
+ typedef enum section_t {
214
+ Bar,
215
+ Tube,
216
+ } TSection;
217
+
218
+ // Number of sizes of Bars available (corresponds to TSection above).
219
+ #define NBarSizes 33
220
+
221
+ // Number of sizes of Tubes available (corresponds to TSection above).
222
+ #define NTubeSizes 33
223
+
224
+ // Max of above sizes.
225
+ #define MaxNSizes 33
226
+
227
+ // Descriptor for a material.
228
+ typedef struct material_t {
229
+ char *name; // Name as string.
230
+ char *short_name; // Name as a short string (for tables).
231
+ TFloat E; // Modulus of elasticity.
232
+ TFloat Fy; // Yield strength.
233
+ TFloat density; // Density in Kg/m^3.
234
+ TFloat cost[NSections]; // Cost in dollars per cm^3 by section.
235
+ } TMaterial;
236
+
237
+ // Descriptor for a structural shape.
238
+ typedef struct shape_t {
239
+ char *name; // Name as string.
240
+ TFloat width; // Width dimension.
241
+ TFloat area; // Cross-sectional area, m^3.
242
+ TFloat moment; // First moment.
243
+ } TShape;
244
+
245
+ #define NLoadCases 4
246
+
247
+ typedef struct load_case_t {
248
+ char *name; // Name as string.
249
+ TFloat point_dead_load; // Dead load due to roadway.
250
+ TFloat front_axle_load; // Live load due to front axle.
251
+ TFloat rear_axle_load; // Live load due to rear axle.
252
+ } TLoadCase;
253
+
254
+ // Parameters of analysis.
255
+ typedef struct params_t {
256
+ TFloat slenderness_limit; // The least illegal slenderness value.
257
+ TFloat dead_load_factor; // Dead load safety factor.
258
+ TFloat live_load_factor; // Live load safety factor.
259
+ TFloat compression_resistance_factor; // Compression loading safety factor.
260
+ TFloat tension_resistance_factor; // Tension loading safety factor.
261
+ TLoadCase load_cases[NLoadCases]; // Load cases.
262
+ TFloat connection_cost; // Cost of connecting members at a joint.
263
+ TFloat ordering_fee; // Fee per cross-section used.
264
+ TMaterial materials[NMaterials]; // Descriptions of available materials.
265
+ unsigned n_sizes[NSections]; // Number of sizes available by section.
266
+ TShape *shapes[NSections]; // Shape descriptions by section and size.
267
+ } TParams;
268
+
269
+ #define INIT_CONSTANT_PARAMS \
270
+ { \
271
+ 300, /* Slenderness limit */ \
272
+ DEAD_LOAD_FACTOR, /* TFloat dead_load_factor; */ \
273
+ 1.75 * 1.33, /* TFloat live_load_factor; */ \
274
+ 0.90, /* TFloat compression_resistance_factor; */ \
275
+ 0.95, /* TFloat tension_resistance_factor; */ \
276
+ { /* TLoadCase load_cases[NLoadCases]; */ \
277
+ { /* [0] */ \
278
+ "Case A (Heavy Deck, Light Truck)", \
279
+ DEAD_LOAD_FACTOR * 120.265 + 33.097, /* TFloat point_dead_load; */ \
280
+ 44, /* TFloat front_axle_load; */ \
281
+ 181, /* TFloat rear_axle_load; */ \
282
+ }, \
283
+ { /* [1] */ \
284
+ "Case B (Heavy Deck, Heavy Truck)", \
285
+ DEAD_LOAD_FACTOR * 120.265 + 33.097, /* TFloat point_dead_load; */ \
286
+ 118, /* TFloat front_axle_load; */ \
287
+ 118, /* TFloat rear_axle_load; */ \
288
+ }, \
289
+ { /* [2] */ \
290
+ "Case C (Light Deck, Light Truck)", \
291
+ DEAD_LOAD_FACTOR * 82.608 + 33.097, /* TFloat point_dead_load; */ \
292
+ 44, /* TFloat front_axle_load; */ \
293
+ 181, /* TFloat rear_axle_load; */ \
294
+ }, \
295
+ { /* [3] */ \
296
+ "Case D (Light Deck, Heavy Truck)", \
297
+ DEAD_LOAD_FACTOR * 82.608 + 33.097, /* TFloat point_dead_load; */ \
298
+ 118, /* TFloat front_axle_load; */ \
299
+ 118, /* TFloat rear_axle_load; */ \
300
+ }, \
301
+ }, \
302
+ 300, /* TFloat connection_cost; */ \
303
+ 1000, /* TFloat ordering_fee; */ \
304
+ { /* TMaterial materials[NMaterials]; */ \
305
+ { \
306
+ "Carbon Steel (A36)", /* char *name; */ \
307
+ "CS", /* char *short_name; */ \
308
+ 200000000, /* TFloat E; */ \
309
+ 250000, /* TFloat Fy; */ \
310
+ 7850, /* TFloat density; */ \
311
+ { /* TFloat cost[NSections]; */ \
312
+ 3.78, /* Bar */ \
313
+ 6.30, /* Tube */ \
314
+ } \
315
+ }, \
316
+ { \
317
+ "High Strength Steel (A572)", /* char *name; */ \
318
+ "HSS", /* char *short_name; */ \
319
+ 200000000, /* TFloat E; */ \
320
+ 345000, /* TFloat Fy; */ \
321
+ 7850, /* TFloat density; */ \
322
+ { /* TFloat cost[NSections]; */ \
323
+ 4.62, /* Bar */ \
324
+ 7.03, /* Tube */ \
325
+ } \
326
+ }, \
327
+ { \
328
+ "Quenched & Tempered Steel", /* char *name; */ \
329
+ "QTS", /* char *short_name; */ \
330
+ 200000000, /* TFloat E; */ \
331
+ 485000, /* TFloat Fy; */ \
332
+ 7850, /* TFloat density; */ \
333
+ { /* TFloat cost[NSections]; */ \
334
+ 5.70, /* Bar */ \
335
+ 7.95, /* Tube */ \
336
+ } \
337
+ }, \
338
+ } \
339
+ }
340
+
341
+ // ---------------------------------------------------------------------
342
+ // -------- Geometry ---------------------------------------------------
343
+ // ---------------------------------------------------------------------
344
+
345
+ // Geometry info calculated from a bridge that we want to avoid
346
+ // recalculating. So we put it in here in order to pass it around for
347
+ // subsequent calculations.
348
+ typedef struct geometry_t {
349
+ TFloat *cos_x, *cos_y;
350
+ TFloat *length;
351
+ } TGeometry;
352
+
353
+ // ---------------------------------------------------------------------
354
+ // -------- Loadings and load instances --------------------------------
355
+ // ---------------------------------------------------------------------
356
+
357
+ // Information regarding a single load case.
358
+ typedef struct load_instance_t {
359
+ TFloat *point_load;
360
+ } TLoadInstance;
361
+
362
+ // A loading consisting of a vector of load cases to analyze.
363
+ typedef struct loading_t {
364
+ unsigned n_load_instances;
365
+ TLoadInstance *load_instances;
366
+ } TLoading;
367
+
368
+ // ---------------------------------------------------------------------
369
+ // -------- Analyses ---------------------------------------------------
370
+ // ---------------------------------------------------------------------
371
+
372
+ // Errors that can happen when the truss is being analyzed.
373
+ typedef enum anal_err_t {
374
+ NoAnalError,
375
+ AnalBadBridge,
376
+ AnalBadPivot,
377
+ } TAnalysisError;
378
+
379
+ // Ways that materials can fail in the V3 material model; overloaded
380
+ // in the V4 model with two modes that are not really indicated by
381
+ // the names.
382
+ typedef enum cmode_t {
383
+ FailModeNone,
384
+ FailModeBuckles,
385
+ FailModeYields,
386
+ FailModeSlenderness, // new for 2010
387
+ } TFailMode;
388
+
389
+ // Characterization of member strength and failure.
390
+ typedef struct strength_t {
391
+ TFloat compressive;
392
+ TFloat tensile;
393
+ TFailMode compressive_fail_mode;
394
+ TFailMode tensile_fail_mode;
395
+ } TMemberStrength;
396
+
397
+ // Record of max forces occurring at a member.
398
+ typedef struct max_forces_t {
399
+ TFloat compression;
400
+ TFloat tension;
401
+ } TMaxForces;
402
+
403
+ // All information associated with an analysis and its results.
404
+ // Arrays are indexed starting at 1, and the 0'th element is ignored.
405
+ typedef struct analysis_t {
406
+ TAnalysisError error;
407
+ TBool *x_restraint, *y_restraint;
408
+ TFloat *stiffness;
409
+ TFloat *displacement;
410
+ TFloat *member_force;
411
+ TMemberStrength *member_strength;
412
+ TMaxForces *max_forces;
413
+ unsigned n_compressive_failures;
414
+ unsigned n_tensile_failures;
415
+ } TAnalysis;
416
+
417
+ // Key used to scramble bridge files.
418
+ extern char RC4_Key[];
419
+
420
+ // ---------------------------------------------------------------------
421
+ // -------- Prototypes -------------------------------------------------
422
+ // ---------------------------------------------------------------------
423
+
424
+ /* analysis.c */
425
+ void init_analysis(TAnalysis *anal);
426
+ void clear_analysis(TAnalysis *anal);
427
+ void setup_analysis(TAnalysis *anal, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params);
428
+ void do_analyze(STRING *bridge_as_string, TAnalysis *analysis, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params, struct analysis_result_t *result);
429
+ char *analysis_to_html(TAnalysis *analysis, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params, struct analysis_result_t *result);
430
+ void print_analysis(FILE *f, TAnalysis *anal, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params);
431
+ /* bridge.c */
432
+ void init_bridge(TBridge *bridge);
433
+ void clear_bridge(TBridge *bridge);
434
+ TBool joint_lists_eq(TJoint *a, TJoint *b, unsigned n);
435
+ TBool x_section_lists_eq(TXSection *a, TXSection *b, unsigned n);
436
+ char *section_str(TSection section);
437
+ TBool member_lists_eq(TMember *a, TMember *b, unsigned n);
438
+ void copy_bridge(TBridge *dst, TBridge *src);
439
+ TBool bridges_indentical(TBridge *a, TBridge *b);
440
+ void canonicalize(TBridge *dst, TBridge *src);
441
+ void print_material(FILE *f, unsigned index, TMaterial *material);
442
+ void print_shape(FILE *f, unsigned section_index, unsigned size_index, TShape *shape);
443
+ /* bridge_cost.c */
444
+ int lookup_scenario_descriptor(TScenarioDescriptor *desc, char *id);
445
+ TFloat bridge_cost(TBridge *bridge, TGeometry *geometry, TParams *params);
446
+ int test_scenario_table(void);
447
+ /* bridge_hash.c */
448
+ void hashify_vec(unsigned int *v, unsigned v_len, unsigned int *hash, unsigned h_len);
449
+ char *hex_nibble(int n, char *p);
450
+ char *hex_byte(int b, char *p);
451
+ char *hex_str(char *s, unsigned n, char *p);
452
+ int hash_bridge(TBridge *bridge, char *hash);
453
+ /* bridge_parser.c */
454
+ char *get_line(char *buf, char **next);
455
+ char *parse_string(char *buf, char *str);
456
+ void basic_string(char *dst, char *src);
457
+ char *parse_comma(char *buf);
458
+ unsigned scan_unsigned(char *str, unsigned width, char **next);
459
+ int scan_int(char *str, unsigned width, char **next);
460
+ TTestStatus lookup_test_status_tag(const char *str);
461
+ char *get_to_delim(char *str, char **next);
462
+ void endecrypt_in_place(char *buf, int size);
463
+ void parse_bridge(TBridge *bridge, STRING *str);
464
+ void parse_unpacked_bridge_destructive(TBridge *bridge, char *str);
465
+ void parse_packed_bridge_destructive(TBridge *bridge, char *str);
466
+ char *unparse_bridge(TBridge *bridge);
467
+ char *unparse_packed_bridge(TBridge *bridge);
468
+ char *unparse_unpacked_bridge(TBridge *bridge);
469
+ void pack_bridge(STRING *in_str, STRING *out_str, TBool decrypt_p, TBool encrypt_p);
470
+ void unpack_bridge(STRING *in_str, STRING *out_str, TBool decrypt_p, TBool encrypt_p);
471
+ /* bridge_random.c */
472
+ void randomly_permute_unsigned(unsigned *v, unsigned n);
473
+ void randomly_permute_members(TMember *v, unsigned n);
474
+ void sample(unsigned *s, unsigned sn, unsigned m, unsigned n);
475
+ void perturb(TBridge *dst, TBridge *src, unsigned seed, unsigned n_joints, unsigned n_members);
476
+ int fix_failure(TBridge *dst, TBridge *src, TParams *params);
477
+ int induce_failure(TBridge *dst, TBridge *src, unsigned seed);
478
+ void vary(TBridge *dst, TBridge *src, unsigned seed);
479
+ /* bridge_sketch.c */
480
+ void do_sketch(TBridge *bridge, TAnalysis *analysis, int width, int height, COMPRESSED_IMAGE *compressed_image);
481
+ /* geometry.c */
482
+ void init_geometry(TGeometry *geometry);
483
+ void clear_geometry(TGeometry *geometry);
484
+ void setup_geometry(TGeometry *geometry, TBridge *bridge);
485
+ /* loading.c */
486
+ void init_loading(TLoading *loading);
487
+ void clear_loading(TLoading *loading);
488
+ void setup_loading(TLoading *loading, TBridge *bridge, TGeometry *geometry, TParams *params);
489
+ /* params.c */
490
+ unsigned n_sizes(TSection section);
491
+ void init_params(TParams *params);
492
+ void clear_params(TParams *params);
493
+ void setup_params(TParams *params);
494
+ void print_load_case(FILE *f, unsigned index, TLoadCase *load_case);
495
+ void print_params(FILE *f, TParams *params);
496
+ /* scenario.c */
497
+ char *local_contest_number_to_id(char *number);
498
+ void init_load_scenario(TLoadScenario *load_scenario);
499
+ void clear_load_scenario(TLoadScenario *load_scenario);
500
+ void setup_load_scenario(TLoadScenario *load_scenario, TScenarioDescriptor *desc);
501
+ void copy_load_scenario(TLoadScenario *dst, TLoadScenario *src);
502
+ /* sketch.c */
503
+ void init_image(IMAGE *image);
504
+ void clear_image(IMAGE *image);
505
+ void setup_image(IMAGE *image, UNSIGNED width, UNSIGNED height, RGB_TRIPLE *color);
506
+ void set_viewport(IMAGE *image, UNSIGNED x_left, UNSIGNED x_right, UNSIGNED y_bottom, UNSIGNED y_top);
507
+ void draw_line_raw(IMAGE *image, UNSIGNED x1, UNSIGNED y1, UNSIGNED x2, UNSIGNED y2, RGB_TRIPLE *color);
508
+ void draw_rect_raw(IMAGE *image, UNSIGNED x1, UNSIGNED y1, UNSIGNED x2, UNSIGNED y2, RGB_TRIPLE *color);
509
+ void clip_segment(FLOAT *x1p, FLOAT *y1p, FLOAT *x2p, FLOAT *y2p, FLOAT x_left, FLOAT x_right, FLOAT y_bottom, FLOAT y_top, int *segment_survives_p);
510
+ void draw_line(IMAGE *image, FLOAT x1, FLOAT y1, FLOAT x2, FLOAT y2, RGB_TRIPLE *color);
511
+ void init_compressed_image(COMPRESSED_IMAGE *compressed_image);
512
+ void clear_compressed_image(COMPRESSED_IMAGE *compressed_image);
513
+ int compress_image(IMAGE *image, COMPRESSED_IMAGE *compressed_image);
514
+
515
+ // Found by cproto with mkproto.bat and inserted by hand.
516
+
517
+
518
+ #endif