00001
#ifndef DEF_object_prototypes
00002
#define DEF_object_prototypes
00003
00004
public void coalesce_object_points(
00005
int *n_points,
00006 Point *points[],
00007
int n_indices,
00008
int indices[] );
00009
00010
public void separate_object_points(
00011
int *new_n_points,
00012 Point *points[],
00013
int n_indices,
00014
int indices[],
00015 Colour_flags colour_flag,
00016 Colour *colours[] );
00017
00018
public void get_default_surfprop(
00019 Surfprop *surfprop );
00020
00021
public BOOLEAN
lookup_colour(
00022 STRING colour_name,
00023 Colour *col );
00024
00025
public BOOLEAN
lookup_colour_name(
00026 Colour col,
00027 STRING *colour_name );
00028
00029
public void rgb_to_hsl(
00030 Real r,
00031 Real g,
00032 Real b,
00033 Real *h,
00034 Real *s,
00035 Real *l );
00036
00037
public void hsl_to_rgb(
00038 Real h,
00039 Real sl,
00040 Real l,
00041 Real *r,
00042 Real *g,
00043 Real *b );
00044
00045
public void convert_colour_to_hsl(
00046 Colour rgb,
00047 Colour *hsl );
00048
00049
public void convert_colour_to_rgb(
00050 Colour hsl,
00051 Colour *rgb );
00052
00053
public BOOLEAN
equal_colours(
00054 Colour col1,
00055 Colour col2 );
00056
00057
public STRING
convert_colour_to_string(
00058 Colour col );
00059
00060
public Colour
convert_string_to_colour(
00061 STRING string );
00062
00063
public int get_colour_distance(
00064
int r,
00065
int g,
00066
int b,
00067 Colour c2 );
00068
00069
public int find_closest_colour(
00070
int r,
00071
int g,
00072
int b,
00073
int n_colours,
00074 Colour colours[] );
00075
00076
public int get_Colour_luminance(
00077 Colour colour );
00078
00079
public Colour
scale_colour(
00080 Colour colour,
00081 Real factor );
00082
00083
public Status
input_graphics_file(
00084 STRING filename,
00085 File_formats *format,
00086
int *n_objects,
00087
object_struct ***object_list );
00088
00089
public Status
output_graphics_file(
00090 STRING filename,
00091 File_formats format,
00092
int n_objects,
00093
object_struct *object_list[] );
00094
00095
public Status
input_objects_any_format(
00096 Volume volume,
00097 STRING filename,
00098 Colour marker_colour,
00099 Real marker_size,
00100 Marker_types marker_type,
00101
int *n_objects,
00102
object_struct **object_list[] );
00103
00104
public STRING
get_default_landmark_file_suffix(
void );
00105
00106
public Status
input_landmark_file(
00107 Volume volume,
00108 STRING filename,
00109 Colour colour,
00110 Real size,
00111 Marker_types type,
00112
int *n_objects,
00113
object_struct **object_list[] );
00114
00115
public Status
io_tag_point(
00116 FILE *file,
00117 IO_types io_direction,
00118 Volume volume,
00119 Real size,
00120
marker_struct *marker );
00121
00122
public void initialize_lines(
00123
lines_struct *lines,
00124 Colour col );
00125
00126
public void initialize_lines_with_size(
00127
lines_struct *lines,
00128 Colour col,
00129
int size,
00130 BOOLEAN closed );
00131
00132
public void delete_lines(
lines_struct *lines );
00133
00134
public void start_new_line(
lines_struct *lines );
00135
00136
public void add_point_to_line(
00137
lines_struct *lines,
00138 Point *point );
00139
00140
public void get_line_segment_index(
00141
lines_struct *lines,
00142
int obj_index,
00143
int *line,
00144
int *seg );
00145
00146
public void set_bintree_delete_function(
00147
void (*func)(
bintree_struct_ptr * ) );
00148
00149
public void delete_bintree_if_any(
00150
bintree_struct_ptr *bintree );
00151
00152
public Real
get_lines_length(
00153
lines_struct *lines );
00154
00155
public void get_lines_arc_point(
00156
lines_struct *lines,
00157 Real arc_length,
00158 Point *point );
00159
00160
public void initialize_marker(
00161
marker_struct *marker,
00162 Marker_types type,
00163 Colour colour );
00164
00165
public void delete_marker(
00166
marker_struct *marker );
00167
00168
public void initialize_model(
00169
model_struct *model );
00170
00171
public void delete_model(
00172
model_struct *model );
00173
00174
public void assign_model_extra_ptr(
00175
model_struct *model,
00176
void *ptr );
00177
00178
public void *
get_model_extra_ptr(
00179
model_struct *model );
00180
00181
public void add_object_to_list(
00182
int *n_objects,
00183
object_struct ***object_list,
00184
object_struct *new_object );
00185
00186
public void remove_object_from_list(
00187
int *n_objects,
00188
object_struct **object_list[],
00189
int obj_index );
00190
00191
public void delete_object_list(
00192
int n_objects,
00193
object_struct *object_list[] );
00194
00195
public int find_object_index_in_model(
00196
model_struct *model,
00197
object_struct *object );
00198
00199
public void add_object_to_model(
00200
model_struct *model,
00201
object_struct *new_object );
00202
00203
public void insert_object_in_model(
00204
model_struct *model,
00205
object_struct *new_object,
00206
int obj_index );
00207
00208
public void remove_ith_object_from_model(
00209
model_struct *model,
00210
int obj_index );
00211
00212
public void remove_object_from_model(
00213
model_struct *model,
00214
object_struct *object );
00215
00216
public Status
io_lines(
00217 FILE *file,
00218 IO_types io_flag,
00219 File_formats format,
00220
lines_struct *lines );
00221
00222
public Status
io_marker(
00223 FILE *file,
00224 IO_types io_flag,
00225 File_formats format,
00226
marker_struct *marker );
00227
00228
public Status
io_model(
00229 FILE *file,
00230 IO_types io_flag,
00231 File_formats format,
00232
model_struct *model );
00233
00234
public Status
io_pixels(
00235 FILE *file,
00236 IO_types io_flag,
00237 File_formats format,
00238
pixels_struct *pixels );
00239
00240
public void set_use_compressed_polygons_flag(
00241 BOOLEAN value );
00242
00243
public BOOLEAN
get_use_compressed_polygons_flag(
void );
00244
00245
public Status
io_polygons(
00246 FILE *file,
00247 IO_types io_flag,
00248 File_formats format,
00249
polygons_struct *polygons );
00250
00251
public Status
io_quadmesh(
00252 FILE *file,
00253 IO_types io_flag,
00254 File_formats format,
00255
quadmesh_struct *quadmesh );
00256
00257
public Status
io_text(
00258 FILE *file,
00259 IO_types io_flag,
00260 File_formats format,
00261
text_struct *text );
00262
00263
public Status
io_point(
00264 FILE *file,
00265 IO_types io_flag,
00266 File_formats format,
00267 Point *point );
00268
00269
public Status
io_vector(
00270 FILE *file,
00271 IO_types io_flag,
00272 File_formats format,
00273 Vector *v );
00274
00275
public Status
io_colour(
00276 FILE *file,
00277 IO_types io_flag,
00278 File_formats format,
00279 Colour *colour );
00280
00281
public Status
io_colours(
00282 FILE *file,
00283 IO_types io_flag,
00284 File_formats format,
00285 Colour_flags *colour_flag,
00286
int n_items,
00287
int n_points,
00288 Colour **colours );
00289
00290
public Status
io_surfprop(
00291 FILE *file,
00292 IO_types io_flag,
00293 File_formats format,
00294 Surfprop *surfprop );
00295
00296
public Status
io_object_type(
00297 FILE *file,
00298 IO_types io_flag,
00299 File_formats format,
00300 Object_types type );
00301
00302
public Status
input_object_type(
00303 FILE *file,
00304 Object_types *type,
00305 File_formats *format,
00306 BOOLEAN *eof );
00307
00308
public Status
io_pixel_colours(
00309 FILE *file,
00310 IO_types io_flag,
00311 File_formats format,
00312
int n,
00313 Colour *pixel_colours[] );
00314
00315
public Status
io_pixel_colour(
00316 FILE *file,
00317 IO_types io_flag,
00318 File_formats format,
00319 Colour *pixel_colour );
00320
00321
public Status
input_object(
00322 STRING directory,
00323 FILE *file,
00324 File_formats *format,
00325
object_struct **object,
00326 BOOLEAN *eof );
00327
00328
public Status
output_object(
00329 FILE *file,
00330 File_formats format,
00331
object_struct *object );
00332
00333
public object_struct *
create_object(
00334 Object_types object_type );
00335
00336
public Object_types get_object_type(
00337
object_struct *object );
00338
00339
public BOOLEAN
get_object_visibility(
00340
object_struct *object );
00341
00342
public void set_object_visibility(
00343
object_struct *object,
00344 BOOLEAN visibility );
00345
00346
public lines_struct *
get_lines_ptr(
00347
object_struct *object );
00348
00349
public marker_struct *
get_marker_ptr(
00350
object_struct *object );
00351
00352
public model_struct *
get_model_ptr(
00353
object_struct *object );
00354
00355
public pixels_struct *
get_pixels_ptr(
00356
object_struct *object );
00357
00358
public polygons_struct *
get_polygons_ptr(
00359
object_struct *object );
00360
00361
public quadmesh_struct *
get_quadmesh_ptr(
00362
object_struct *object );
00363
00364
public text_struct *
get_text_ptr(
00365
object_struct *object );
00366
00367
public void delete_object(
00368
object_struct *object );
00369
00370
public int get_object_points(
00371
object_struct *object,
00372 Point *points[] );
00373
00374
public int get_object_normals(
00375
object_struct *object,
00376 Vector *normals[] );
00377
00378
public Colour_flags *
get_object_colours(
00379
object_struct *object,
00380 Colour *colours[] );
00381
00382
public void set_object_colours(
00383
object_struct *object,
00384 Colour colours[] );
00385
00386
public Surfprop *
get_object_surfprop(
00387
object_struct *object );
00388
00389
public STRING
get_object_name(
00390
object_struct *object );
00391
00392
public void initialize_object_traverse(
00393
object_traverse_struct *object_traverse,
00394 BOOLEAN visible_ones_only,
00395
int n_objects,
00396
object_struct *object_list[] );
00397
00398
public BOOLEAN
get_next_object_traverse(
00399
object_traverse_struct *object_traverse,
00400
object_struct **object );
00401
00402
public void terminate_object_traverse(
00403
object_traverse_struct *object_traverse );
00404
00405
public BOOLEAN
get_range_of_object(
00406
object_struct *object,
00407 BOOLEAN visible_ones_only,
00408 Point *min_corner,
00409 Point *max_corner );
00410
00411
public void reverse_object_normals(
00412
object_struct *object );
00413
00414
public BOOLEAN
get_object_colour(
00415
object_struct *object,
00416 Colour *colour );
00417
00418
public void set_object_colour(
00419
object_struct *object,
00420 Colour col );
00421
00422
public void set_object_surfprop(
00423
object_struct *object,
00424 Surfprop *spr );
00425
00426
public void free_colours(
00427 Colour_flags colour_flag,
00428 Colour colours[],
00429
int n_points,
00430
int n_items );
00431
00432
public BOOLEAN
objects_are_same_topology(
00433
int n_points1,
00434
int n_items1,
00435
int *end_indices1,
00436
int *indices1,
00437
int n_points2,
00438
int n_items2,
00439
int *end_indices2,
00440
int *indices2 );
00441
00442
public int get_n_colours(
00443 Colour_flags colour_flag,
00444
int n_points,
00445
int n_items );
00446
00447
public void initialize_pixels(
00448
pixels_struct *pixels,
00449
int x_position,
00450
int y_position,
00451
int x_size,
00452
int y_size,
00453 Real x_zoom,
00454 Real y_zoom,
00455 Pixel_types pixel_type );
00456
00457
public void delete_pixels(
pixels_struct *pixels );
00458
00459
public void modify_pixels_size(
00460
int *n_pixels_alloced,
00461
pixels_struct *pixels,
00462
int x_size,
00463
int y_size,
00464 Pixel_types pixel_type );
00465
00466
public void convert_pixels24_to_pixels8(
00467
pixels_struct *pixels_rgb,
00468
pixels_struct *pixels_8 );
00469
00470
public void convert_pixels24_to_index8(
00471
pixels_struct *pixels_rgb,
00472
pixels_struct *pixels_8,
00473
int n_colours,
00474 Colour colour_table[] );
00475
00476
public void convert_index8_to_pixels24(
00477
pixels_struct *pixels_8,
00478 Colour colour_table[],
00479
pixels_struct *pixels_rgb );
00480
00481
public void convert_pixels24_to_gray_scale(
00482
pixels_struct *pixels_rgb,
00483
pixels_struct *pixels_8 );
00484
00485
public void convert_pixels24_to_dithered(
00486
pixels_struct *pixels_rgb,
00487
pixels_struct *pixels_8,
00488
int n_colours,
00489 Colour colour_table[] );
00490
00491
public void resample_pixels(
00492
pixels_struct *pixels,
00493 Transform_2d *transform,
00494
int n_samples,
00495
pixels_struct *new_pixels,
00496 Colour background_colour );
00497
00498
public void copy_pixel_region(
00499
pixels_struct *pixels,
00500
int x_min,
00501
int x_max,
00502
int y_min,
00503
int y_max,
00504
pixels_struct *new_pixels );
00505
00506
public void check_polygons_neighbours_computed(
00507
polygons_struct *polygons );
00508
00509
public void delete_polygon_point_neighbours(
00510
polygons_struct *polygons,
00511
int n_point_neighbours[],
00512
int *point_neighbours[],
00513 Smallest_int interior_flags[],
00514
int *point_polygons[] );
00515
00516
public void create_polygon_point_neighbours(
00517
polygons_struct *polygons,
00518 BOOLEAN across_polygons_flag,
00519
int *n_point_neighbours_ptr[],
00520
int **point_neighbours_ptr[],
00521 Smallest_int *interior_flags_ptr[],
00522
int **point_polygons_ptr[] );
00523
00524
public void initialize_polygons(
00525
polygons_struct *polygons,
00526 Colour col,
00527 Surfprop *spr );
00528
00529
public void initialize_polygons_with_size(
00530
polygons_struct *polygons,
00531 Colour col,
00532 Surfprop *spr,
00533
int n_points,
00534
int n_polygons,
00535
int size );
00536
00537
public void free_polygon_neighbours(
00538
polygons_struct *polygons );
00539
00540
public void delete_polygons(
polygons_struct *polygons );
00541
00542
public void copy_polygons(
00543
polygons_struct *src,
00544
polygons_struct *dest );
00545
00546
public void set_polygon_per_item_colours(
00547
polygons_struct *polygons );
00548
00549
public void create_polygons_visibilities(
00550
polygons_struct *polygons );
00551
00552
public void set_polygons_visibilities(
00553
polygons_struct *polygons,
00554 BOOLEAN state );
00555
00556
public void start_new_polygon(
00557
polygons_struct *polygons );
00558
00559
public void add_point_to_polygon(
00560
polygons_struct *polygons,
00561 Point *point,
00562 Vector *normal );
00563
00564
public int get_polygon_points(
00565
polygons_struct *polygons,
00566
int poly,
00567 Point points[] );
00568
00569
public void get_polygon_centroid(
00570
polygons_struct *polygons,
00571
int poly,
00572 Point *centroid );
00573
00574
public int find_vertex_index(
00575
polygons_struct *polygons,
00576
int poly,
00577
int point_index );
00578
00579
public int find_edge_index(
00580
polygons_struct *polygons,
00581
int poly,
00582
int point_index1,
00583
int point_index2 );
00584
00585
public BOOLEAN
find_polygon_with_edge(
00586
polygons_struct *polygons,
00587
int point_index1,
00588
int point_index2,
00589
int *poly_containing_edge,
00590
int *edge_index );
00591
00592
public BOOLEAN
find_polygon_with_vertex(
00593
polygons_struct *polygons,
00594
int point_index,
00595
int *poly_index,
00596
int *vertex_index );
00597
00598
public BOOLEAN
lookup_polygon_vertex(
00599
polygons_struct *polygons,
00600 Point *point,
00601
int *point_index );
00602
00603
public BOOLEAN
find_next_edge_around_point(
00604
polygons_struct *polygons,
00605
int poly,
00606
int index_1,
00607
int index_2,
00608
int *next_poly,
00609
int *next_index_1,
00610
int *next_index_2 );
00611
00612
public int get_neighbours_of_point(
00613
polygons_struct *polygons,
00614
int poly,
00615
int vertex_index,
00616
int neighbours[],
00617
int max_neighbours,
00618 BOOLEAN *interior_point );
00619
00620
public int get_polygons_around_vertex(
00621
polygons_struct *polygons,
00622
int poly,
00623
int vertex_index,
00624
int poly_indices[],
00625
int n_polys_alloced,
00626 BOOLEAN *closed_flag );
00627
00628
public void compute_polygon_normal(
00629
polygons_struct *polygons,
00630
int poly,
00631 Vector *normal );
00632
00633
public void compute_polygon_normals(
00634
polygons_struct *polygons );
00635
00636
public void average_polygon_normals(
00637
polygons_struct *polygons,
00638
int n_iters,
00639 Real neighbour_weight );
00640
00641
public BOOLEAN
get_plane_polygon_intersection(
00642 Vector *normal,
00643 Real d,
00644
polygons_struct *polygons,
00645
int poly,
00646 Point intersection_points[] );
00647
00648
public BOOLEAN
get_plane_segment_intersection(
00649 Vector *normal,
00650 Real d,
00651 Point *p1,
00652 Point *p2,
00653 Point *intersection_point );
00654
00655
public void reverse_polygons_vertices(
00656
polygons_struct *polygons );
00657
00658
public void make_polygons_front_facing(
00659
polygons_struct *polygons );
00660
00661
public BOOLEAN
polygon_is_back_facing(
00662
polygons_struct *polygons,
00663
int poly );
00664
00665
public void compute_points_centroid_and_normal(
00666
polygons_struct *polygons,
00667
int point_index,
00668
int n_neighbours,
00669
int neighbours[],
00670 Point *centroid,
00671 Vector *normal,
00672 Real *base_length,
00673 Real *curvature );
00674
00675
public void compute_polygon_point_centroid(
00676
polygons_struct *polygons,
00677
int poly,
00678
int vertex_index,
00679
int point_index,
00680 Point *centroid,
00681 Vector *normal,
00682 Real *base_length,
00683 Real *curvature );
00684
00685
public Real
compute_polygon_vertex_curvature(
00686
polygons_struct *polygons,
00687
int point_index );
00688
00689
public Real
get_polygon_edge_angle(
00690
polygons_struct *polygons,
00691
int poly,
00692
int edge );
00693
00694
public BOOLEAN
polygons_are_same_topology(
00695
polygons_struct *p1,
00696
polygons_struct *p2 );
00697
00698
public void initialize_quadmesh(
00699
quadmesh_struct *quadmesh,
00700 Colour col,
00701 Surfprop *spr,
00702
int m,
00703
int n );
00704
00705
public void delete_quadmesh(
00706
quadmesh_struct *quadmesh );
00707
00708
public void set_quadmesh_point(
00709
quadmesh_struct *quadmesh,
00710
int i,
00711
int j,
00712 Point *point,
00713 Vector *normal );
00714
00715
public BOOLEAN
get_quadmesh_point(
00716
const quadmesh_struct *quadmesh,
00717
int i,
00718
int j,
00719 Point *point );
00720
00721
public void get_quadmesh_n_objects(
00722
const quadmesh_struct *quadmesh,
00723
int *m,
00724
int *n );
00725
00726
public void compute_quadmesh_normals(
00727
quadmesh_struct *quadmesh );
00728
00729
public void get_quadmesh_patch_indices(
00730
const quadmesh_struct *quadmesh,
00731
int i,
00732
int j,
00733
int indices[] );
00734
00735
public void get_quadmesh_patch(
00736
const quadmesh_struct *quadmesh,
00737
int i,
00738
int j,
00739 Point points[] );
00740
00741
public void reverse_quadmesh_vertices(
00742
quadmesh_struct *quadmesh );
00743
00744
public Colour *
get_8bit_rgb_pixel_lookup(
void );
00745
00746
public int convert_rgb_pixel_to_8bit_lookup(
00747 Colour colour );
00748
00749
public Status
input_tag_objects_file(
00750 STRING filename,
00751 Colour marker_colour,
00752 Real default_size,
00753 Marker_types default_type,
00754
int *n_objects,
00755
object_struct **object_list[] );
00756
00757
public void initialize_text(
00758
text_struct *text,
00759 Point *position,
00760 Colour colour,
00761 Font_types text_font,
00762 Real size );
00763
00764
public void delete_text(
00765
text_struct *text );
00766
00767
public Status
output_texture_values(
00768 STRING filename,
00769 File_formats format,
00770
int n_values,
00771 Real values[] );
00772
00773
public Status
input_texture_values(
00774 STRING filename,
00775
int *n_values,
00776 Real *values[] );
00777
#endif