-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBalloon.pck.st
2176 lines (1869 loc) · 79.2 KB
/
Balloon.pck.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'From Cuis 4.2 of 25 July 2013 [latest update: #2327] on 16 May 2015 at 5:28:40.8284 pm'!
'Description This package includes code required by VMMaker for building the Balloon VM plugin. In any case, Cuis does not use Balloon at all, so this code is only for use by VMMaker'!
!provides: 'Balloon' 1 5!
!classDefinition: #BalloonEngineConstants category: #'Balloon-Engine-Pools'!
SharedPool subclass: #BalloonEngineConstants
instanceVariableNames: ''
classVariableNames: 'BEAaLevelIndex BEBalloonEngineSize BEBitBltIndex BEClipRectIndex BEColorTransformIndex BEDeferredIndex BEDestOffsetIndex BEEdgeTransformIndex BEExternalsIndex BEFormsIndex BEPostFlushNeededIndex BESpanIndex BEWorkBufferIndex ETBalloonEdgeDataSize ETIndexIndex ETLinesIndex ETSourceIndex ETXValueIndex ETYValueIndex ETZValueIndex FTBalloonFillDataSize FTDestFormIndex FTIndexIndex FTMaxXIndex FTMinXIndex FTSourceIndex FTYValueIndex GBBaseSize GBBitmapDepth GBBitmapHeight GBBitmapRaster GBBitmapSize GBBitmapWidth GBColormapOffset GBColormapSize GBEndX GBEndY GBFinalX GBMBaseSize GBTileFlag GBUpdateDDX GBUpdateDDY GBUpdateDX GBUpdateDY GBUpdateData GBUpdateX GBUpdateY GBViaX GBViaY GBWideEntry GBWideExit GBWideExtent GBWideFill GBWideSize GBWideUpdateData GBWideWidth GEBaseEdgeSize GEBaseFillSize GEEdgeClipFlag GEEdgeFillsInvalid GEFAlreadyFailed GEFBadPoint GEFBitBltLoadFailed GEFClassMismatch GEFEdgeDataTooSmall GEFEngineIsInteger GEFEngineIsWords GEFEngineStopped GEFEngineTooSmall GEFEntityCheckFailed GEFEntityLoadFailed GEFFillDataTooSmall GEFFormLoadFailed GEFSizeMismatch GEFWorkBufferBadMagic GEFWorkBufferIsInteger GEFWorkBufferIsPointers GEFWorkBufferStartWrong GEFWorkBufferTooSmall GEFWorkBufferWrongSize GEFWorkTooBig GEFWrongEdge GEFWrongFill GEFWrongState GEFillIndexLeft GEFillIndexRight GENumLines GEObjectIndex GEObjectLength GEObjectType GEObjectUnused GEPrimitiveBezier GEPrimitiveClippedBitmapFill GEPrimitiveEdge GEPrimitiveEdgeMask GEPrimitiveFill GEPrimitiveFillMask GEPrimitiveLine GEPrimitiveLinearGradientFill GEPrimitiveRadialGradientFill GEPrimitiveRepeatedBitmapFill GEPrimitiveTypeMask GEPrimitiveUnknown GEPrimitiveWide GEPrimitiveWideBezier GEPrimitiveWideEdge GEPrimitiveWideLine GEPrimitiveWideMask GEStateAddingFromGET GEStateBlitBuffer GEStateCompleted GEStateScanningAET GEStateUnlocked GEStateUpdateEdges GEStateWaitingChange GEStateWaitingForEdge GEStateWaitingForFill GEXValue GEYValue GEZValue GErrorAETEntry GErrorBadState GErrorFillEntry GErrorGETEntry GErrorNeedFlush GErrorNoMoreSpace GFDirectionX GFDirectionY GFNormalX GFNormalY GFOriginX GFOriginY GFRampLength GFRampOffset GGBaseSize GLBaseSize GLEndX GLEndY GLError GLErrorAdjDown GLErrorAdjUp GLWideEntry GLWideExit GLWideExtent GLWideFill GLWideSize GLWideWidth GLXDirection GLXIncrement GLYDirection GWAAColorMask GWAAColorShift GWAAHalfPixel GWAALevel GWAAScanMask GWAAShift GWAETStart GWAETUsed GWBezierHeightSubdivisions GWBezierLineConversions GWBezierMonotonSubdivisions GWBezierOverflowSubdivisions GWBufferTop GWClearSpanBuffer GWClipMaxX GWClipMaxY GWClipMinX GWClipMinY GWColorTransform GWCountAddAETEntry GWCountChangeAETEntry GWCountDisplaySpan GWCountFinishTest GWCountInitializing GWCountMergeFill GWCountNextAETEntry GWCountNextFillEntry GWCountNextGETEntry GWCurrentY GWCurrentZ GWDestOffsetX GWDestOffsetY GWEdgeTransform GWFillMaxX GWFillMaxY GWFillMinX GWFillMinY GWFillOffsetX GWFillOffsetY GWGETStart GWGETUsed GWHasClipShapes GWHasColorTransform GWHasEdgeTransform GWHeaderSize GWLastExportedEdge GWLastExportedFill GWLastExportedLeftX GWLastExportedRightX GWMagicIndex GWMagicNumber GWMinimalSize GWNeedsFlush GWObjStart GWObjUsed GWPoint1 GWPoint2 GWPoint3 GWPoint4 GWPointListFirst GWSize GWSpanEnd GWSpanEndAA GWSpanSize GWSpanStart GWState GWStopReason GWTimeAddAETEntry GWTimeChangeAETEntry GWTimeDisplaySpan GWTimeFinishTest GWTimeInitializing GWTimeMergeFill GWTimeNextAETEntry GWTimeNextFillEntry GWTimeNextGETEntry'
poolDictionaries: ''
category: 'Balloon-Engine-Pools'!
!classDefinition: 'BalloonEngineConstants class' category: #'Balloon-Engine-Pools'!
BalloonEngineConstants class
instanceVariableNames: ''!
!classDefinition: #BalloonBezierSimulation category: #'Balloon-Simulation'!
Object subclass: #BalloonBezierSimulation
instanceVariableNames: 'start end via lastX lastY fwDx fwDy fwDDx fwDDy maxSteps'
classVariableNames: 'HeightSubdivisions LineConversions MonotonSubdivisions OverflowSubdivisions'
poolDictionaries: ''
category: 'Balloon-Simulation'!
!classDefinition: 'BalloonBezierSimulation class' category: #'Balloon-Simulation'!
BalloonBezierSimulation class
instanceVariableNames: ''!
!classDefinition: #BalloonBuffer category: #'Balloon-Engine'!
Object variableWordSubclass: #BalloonBuffer
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Balloon-Engine'!
!classDefinition: 'BalloonBuffer class' category: #'Balloon-Engine'!
BalloonBuffer class
instanceVariableNames: ''!
!classDefinition: #BalloonEdgeData category: #'Balloon-Simulation'!
Object subclass: #BalloonEdgeData
instanceVariableNames: 'index xValue yValue zValue lines source'
classVariableNames: ''
poolDictionaries: ''
category: 'Balloon-Simulation'!
!classDefinition: 'BalloonEdgeData class' category: #'Balloon-Simulation'!
BalloonEdgeData class
instanceVariableNames: ''!
!classDefinition: #BalloonEngine category: #'Balloon-Engine'!
Object subclass: #BalloonEngine
instanceVariableNames: 'workBuffer span bitBlt forms clipRect destOffset externals aaLevel edgeTransform colorTransform deferred postFlushNeeded'
classVariableNames: 'BezierStats BufferCache CacheProtect Counts Debug Times'
poolDictionaries: 'BalloonEngineConstants'
category: 'Balloon-Engine'!
!classDefinition: 'BalloonEngine class' category: #'Balloon-Engine'!
BalloonEngine class
instanceVariableNames: ''!
!classDefinition: #BalloonFillData category: #'Balloon-Simulation'!
Object subclass: #BalloonFillData
instanceVariableNames: 'index minX maxX yValue source destForm'
classVariableNames: ''
poolDictionaries: ''
category: 'Balloon-Simulation'!
!classDefinition: 'BalloonFillData class' category: #'Balloon-Simulation'!
BalloonFillData class
instanceVariableNames: ''!
!classDefinition: #BalloonLineSimulation category: #'Balloon-Simulation'!
Object subclass: #BalloonLineSimulation
instanceVariableNames: 'start end xIncrement xDirection error errorAdjUp errorAdjDown'
classVariableNames: ''
poolDictionaries: ''
category: 'Balloon-Simulation'!
!classDefinition: 'BalloonLineSimulation class' category: #'Balloon-Simulation'!
BalloonLineSimulation class
instanceVariableNames: ''!
!classDefinition: #BalloonSolidFillSimulation category: #'Balloon-Simulation'!
Object subclass: #BalloonSolidFillSimulation
instanceVariableNames: 'color'
classVariableNames: ''
poolDictionaries: ''
category: 'Balloon-Simulation'!
!classDefinition: 'BalloonSolidFillSimulation class' category: #'Balloon-Simulation'!
BalloonSolidFillSimulation class
instanceVariableNames: ''!
!classDefinition: #BalloonState category: #'Balloon-Engine'!
Object subclass: #BalloonState
instanceVariableNames: 'transform colorTransform aaLevel'
classVariableNames: ''
poolDictionaries: ''
category: 'Balloon-Engine'!
!classDefinition: 'BalloonState class' category: #'Balloon-Engine'!
BalloonState class
instanceVariableNames: ''!
!BalloonBezierSimulation commentStamp: '<historical>' prior: 0!
This class is a simulation of the code that's run by the Balloon engine. For debugging purposes only.!
!BalloonBuffer commentStamp: '<historical>' prior: 0!
BalloonBuffer is a repository for primitive data used by the BalloonEngine.!
!BalloonEdgeData commentStamp: '<historical>' prior: 0!
BalloonEdgeData defines an entry in the internal edge table of the Balloon engine.
Instance Variables:
index <Integer> The index into the external objects array of the associated graphics engine
xValue <Integer> The computed x-value of the requested operation
yValue <Integer> The y-value for the requested operation
height <Integer> The (remaining) height of the edge
source <Object> The object from the external objects array!
!BalloonEngine commentStamp: '<historical>' prior: 0!
BalloonEngine is the representative for the Balloon engine inside Squeak. For most purposes it should not be used directly but via BalloonCanvas since this ensures proper initialization and is polymorphic with other canvas uses.!
!BalloonFillData commentStamp: '<historical>' prior: 0!
This class is a simulation of the code that's run by the Balloon engine. For debugging purposes only.!
!BalloonLineSimulation commentStamp: '<historical>' prior: 0!
This class is a simulation of the code that's run by the Balloon engine. For debugging purposes only.!
!BalloonSolidFillSimulation commentStamp: '<historical>' prior: 0!
This class is a simulation of the code that's run by the Balloon engine. For debugging purposes only.!
!BalloonState commentStamp: '<historical>' prior: 0!
This class is a repository for data which needs to be preserved during certain operations of BalloonCanvas.!
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'ar 5/18/2003 19:55'!
initEdgeConstants
"Initialize the edge constants"
"Edge primitive types"
GEPrimitiveEdge := 2. "External edge - not handled by the GE"
GEPrimitiveWideEdge := 3. "Wide external edge"
GEPrimitiveLine := 4. "Straight line"
GEPrimitiveWideLine := 5. "Wide line"
GEPrimitiveBezier := 6. "Quadratic bezier curve"
GEPrimitiveWideBezier := 7. "Wide bezier curve"
"Special flags"
GEPrimitiveWide := 16r01. "Flag determining a wide primitive"
GEPrimitiveWideMask := 16rFE. "Mask for clearing the wide flag"
GEEdgeFillsInvalid := 16r10000. "Flag determining if left/right fills of an edge are invalid"
GEEdgeClipFlag := 16r20000. "Flag determining if this is a clip edge"
"General edge state constants"
GEXValue := 4. "Current raster x"
GEYValue := 5. "Current raster y"
GEZValue := 6. "Current raster z"
GENumLines := 7. "Number of scan lines remaining"
GEFillIndexLeft := 8. "Left fill index"
GEFillIndexRight := 9. "Right fill index"
GEBaseEdgeSize := 10. "Basic size of each edge"
"General fill state constants"
GEBaseFillSize := 4. "Basic size of each fill"
"General Line state constants"
GLXDirection := 10. "Direction of edge (1: left-to-right; -1: right-to-left)"
GLYDirection := 11. "Direction of edge (1: top-to-bottom; -1: bottom-to-top)"
GLXIncrement := 12. "Increment at each scan line"
GLError := 13. "Current error"
GLErrorAdjUp := 14. "Error to add at each scan line"
GLErrorAdjDown := 15. "Error to subtract on roll-over"
"Note: The following entries are only needed before the incremental
state is computed. They are therefore aliased to the error values above"
GLEndX := 14. "End X of line"
GLEndY := 15. "End Y of line"
GLBaseSize := 16. "Basic size of each line"
"Additional stuff for wide lines"
GLWideFill := 16. "Current fill of line"
GLWideWidth := 17. "Current width of line"
GLWideEntry := 18. "Initial steps"
GLWideExit := 19. "Final steps"
GLWideExtent := 20. "Target width"
GLWideSize := 21. "Size of wide lines"
"General Bezier state constants"
GBUpdateData := 10. "Incremental update data for beziers"
GBUpdateX := 0. "Last computed X value (24.8)"
GBUpdateY := 1. "Last computed Y value (24.8)"
GBUpdateDX := 2. "Delta X forward difference step (8.24)"
GBUpdateDY := 3. "Delta Y forward difference step (8.24)"
GBUpdateDDX := 4. "Delta DX forward difference step (8.24)"
GBUpdateDDY := 5. "Delta DY forward difference step (8.24)"
"Note: The following four entries are only needed before the incremental
state is computed. They are therefore aliased to the incremental values above"
GBViaX := 12. "via x"
GBViaY := 13. "via y"
GBEndX := 14. "end x"
GBEndY := 15. "end y"
GBBaseSize := 16. "Basic size of each bezier.
Note: MUST be greater or equal to the size of lines"
"Additional stuff for wide beziers"
GBWideFill := 16. "Current fill of line"
GBWideWidth := 17. "Current width of line"
GBWideEntry := 18. "Initial steps"
GBWideExit := 19. "Final steps"
GBWideExtent := 20. "Target extent"
GBFinalX := 21. "Final X value"
GBWideUpdateData := 22. "Update data for second curve"
GBWideSize := 28. "Size of wide beziers"
! !
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'ar 5/18/2003 20:08'!
initFillConstants
"Initialize the fill constants"
"Fill primitive types"
GEPrimitiveFill := 16r100.
GEPrimitiveLinearGradientFill := 16r200.
GEPrimitiveRadialGradientFill := 16r300.
GEPrimitiveClippedBitmapFill := 16r400.
GEPrimitiveRepeatedBitmapFill := 16r500.
"General fill state constants"
GEBaseFillSize := 4. "Basic size of each fill"
"Oriented fill constants"
GFOriginX := 4. "X origin of fill"
GFOriginY := 5. "Y origin of fill"
GFDirectionX := 6. "X direction of fill"
GFDirectionY := 7. "Y direction of fill"
GFNormalX := 8. "X normal of fill"
GFNormalY := 9. "Y normal of fill"
"Gradient fill constants"
GFRampLength := 10. "Length of following color ramp"
GFRampOffset := 12. "Offset of first ramp entry"
GGBaseSize := 12.
"Bitmap fill constants"
GBBitmapWidth := 10. "Width of bitmap"
GBBitmapHeight := 11. "Height of bitmap"
GBBitmapDepth := 12. "Depth of bitmap"
GBBitmapSize := 13. "Size of bitmap words"
GBBitmapRaster := 14. "Size of raster line"
GBColormapSize := 15. "Size of colormap, if any"
GBTileFlag := 16. "True if the bitmap is tiled"
GBColormapOffset := 18. "Offset of colormap, if any"
GBMBaseSize := 18. "Basic size of bitmap fill"
! !
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'eem 6/4/2009 18:07'!
initPrimitiveConstants
"Initialize the primitive constants"
"Primitive type constants"
GEPrimitiveUnknown := 0.
GEPrimitiveEdgeMask := 16rFF.
GEPrimitiveFillMask := 16rFF00.
GEPrimitiveTypeMask := 16rFFFF.
"General state constants (Note: could be compressed later)"
GEObjectType := 0. "Type of object"
GEObjectLength := 1. "Length of object"
GEObjectIndex := 2. "Index into external objects"
GEObjectUnused := 3. "Currently unused"
"Primitive failure codes"
GEFAlreadyFailed := 100.
GEFEngineIsInteger := 101.
GEFEngineIsWords := 102.
GEFEngineTooSmall := 103.
GEFEngineStopped := 104.
GEFWorkBufferIsInteger := 105.
GEFWorkBufferIsPointers := 106.
GEFWorkBufferTooSmall := 107.
GEFWorkBufferBadMagic := 108.
GEFWorkBufferWrongSize := 109.
GEFWorkBufferStartWrong := 110.
GEFWorkTooBig := 111.
GEFEdgeDataTooSmall := 112.
GEFFillDataTooSmall := 113.
GEFClassMismatch := 114.
GEFSizeMismatch := 115.
GEFWrongState := 116.
GEFWrongFill := 117.
GEFWrongEdge := 118.
GEFEntityLoadFailed := 119.
GEFEntityCheckFailed := 120.
GEFBadPoint := 121.
GEFBitBltLoadFailed := 122.
GEFFormLoadFailed := 123! !
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'ar 5/18/2003 20:00'!
initStateConstants
"Initialize the state Constants"
GEStateUnlocked := 0. "Buffer is unlocked and can be modified as wanted"
GEStateAddingFromGET := 1. "Adding edges from the GET"
GEStateWaitingForEdge := 2. "Waiting for edges added to GET"
GEStateScanningAET := 3. "Scanning the active edge table"
GEStateWaitingForFill := 4. "Waiting for a fill to mix in during AET scan"
GEStateBlitBuffer := 5. "Blt the current scan line"
GEStateUpdateEdges := 6. "Update edges to next scan line"
GEStateWaitingChange := 7. "Waiting for a changed edge"
GEStateCompleted := 8. "Rendering completed"
"Error constants"
GErrorNoMoreSpace := 1. "No more space in collection"
GErrorBadState := 2. "Tried to call a primitive while engine in bad state"
GErrorNeedFlush := 3. "Tried to call a primitive that requires flushing before"
"Incremental error constants"
GErrorGETEntry := 4. "Unknown entry in GET"
GErrorFillEntry := 5. "Unknown FILL encountered"
GErrorAETEntry := 6. "Unknown entry in AET"
! !
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'ar 5/18/2003 20:04'!
initWorkBufferConstants
"Initialize the work buffer constants"
"General work buffer constants"
GWMagicNumber := 16r416E6469. "Magic number"
GWHeaderSize := 128. "Size of header"
GWMinimalSize := 256. "Minimal size of work buffer"
"Header entries"
GWMagicIndex := 0. "Index of magic number"
GWSize := 1. "Size of full buffer"
GWState := 2. "Current state (e.g., locked or not."
"Buffer entries"
GWObjStart := 8. "objStart"
GWObjUsed := 9. "objUsed"
GWBufferTop := 10. "wbTop"
GWGETStart := 11. "getStart"
GWGETUsed := 12. "getUsed"
GWAETStart := 13. "aetStart"
GWAETUsed := 14. "aetUsed"
"Transform entries"
GWHasEdgeTransform := 16. "True if we have an edge transformation"
GWHasColorTransform := 17. "True if we have a color transformation"
GWEdgeTransform := 18. "2x3 edge transformation"
GWColorTransform := 24. "8 word RGBA color transformation"
"Span entries"
GWSpanStart := 32. "spStart"
GWSpanSize := 33. "spSize"
GWSpanEnd := 34. "spEnd"
GWSpanEndAA := 35. "spEndAA"
"Bounds entries"
GWFillMinX := 36. "fillMinX"
GWFillMaxX := 37. "fillMaxX"
GWFillMinY := 38. "fillMinY"
GWFillMaxY := 39. "fillMaxY"
GWFillOffsetX := 40. "fillOffsetX"
GWFillOffsetY := 41. "fillOffsetY"
GWClipMinX := 42.
GWClipMaxX := 43.
GWClipMinY := 44.
GWClipMaxY := 45.
GWDestOffsetX := 46.
GWDestOffsetY := 47.
"AA entries"
GWAALevel := 48. "aaLevel"
GWAAShift := 49. "aaShift"
GWAAColorShift := 50. "aaColorShift"
GWAAColorMask := 51. "aaColorMask"
GWAAScanMask := 52. "aaScanMask"
GWAAHalfPixel := 53. "aaHalfPixel"
"Misc entries"
GWNeedsFlush := 63. "True if the engine may need a flush"
GWStopReason := 64. "stopReason"
GWLastExportedEdge := 65. "last exported edge"
GWLastExportedFill := 66. "last exported fill"
GWLastExportedLeftX := 67. "last exported leftX"
GWLastExportedRightX := 68. "last exported rightX"
GWClearSpanBuffer := 69. "Do we have to clear the span buffer?"
GWPointListFirst := 70. "First point list in buffer"
GWPoint1 := 80.
GWPoint2 := 82.
GWPoint3 := 84.
GWPoint4 := 86.
GWCurrentY := 88.
"Profile stats"
GWTimeInitializing := 90.
GWCountInitializing := 91.
GWTimeFinishTest := 92.
GWCountFinishTest := 93.
GWTimeNextGETEntry := 94.
GWCountNextGETEntry := 95.
GWTimeAddAETEntry := 96.
GWCountAddAETEntry := 97.
GWTimeNextFillEntry := 98.
GWCountNextFillEntry := 99.
GWTimeMergeFill := 100.
GWCountMergeFill := 101.
GWTimeDisplaySpan := 102.
GWCountDisplaySpan := 103.
GWTimeNextAETEntry := 104.
GWCountNextAETEntry := 105.
GWTimeChangeAETEntry := 106.
GWCountChangeAETEntry := 107.
"Bezier stats"
GWBezierMonotonSubdivisions := 108. "# of subdivision due to non-monoton beziers"
GWBezierHeightSubdivisions := 109. "# of subdivisions due to excessive height"
GWBezierOverflowSubdivisions := 110. "# of subdivisions due to possible int overflow"
GWBezierLineConversions := 111. "# of beziers converted to lines"
GWHasClipShapes := 112. "True if the engine contains clip shapes"
GWCurrentZ := 113. "Current z value of primitives"
! !
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'ar 5/18/2003 20:08'!
initialize
"BalloonEngineConstants initialize"
self initStateConstants.
self initWorkBufferConstants.
self initPrimitiveConstants.
self initEdgeConstants.
self initFillConstants.
self initializeInstVarNames: BalloonEngine prefixedBy: 'BE'.
self initializeInstVarNames: BalloonEdgeData prefixedBy: 'ET'.
self initializeInstVarNames: BalloonFillData prefixedBy: 'FT'.! !
!BalloonEngineConstants class methodsFor: 'pool definition' stamp: 'nice 12/27/2009 03:11'!
initializeInstVarNames: aClass prefixedBy: aString
| token |
aClass instVarNames withIndexDo: [ :instVarName :index| | value |
token := (aString, instVarName first asUppercase asString, (instVarName copyFrom: 2 to: instVarName size),'Index') asSymbol.
value := index - 1.
(self bindingOf: token) ifNil:[self addClassVarName: token].
(self bindingOf: token) value: value.
].
token := (aString, aClass name,'Size') asSymbol.
(self bindingOf: token) ifNil:[self addClassVarName: token].
(self bindingOf: token) value: aClass instSize.! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 16:37'!
absoluteSquared8Dot24: value
"Compute the squared value of a 8.24 number with 0.0 <= value < 1.0,
e.g., compute (value * value) bitShift: -24"
| halfWord1 halfWord2 result |
(value >= 0 and:[value < 16r1000000]) ifFalse:[^self error:'Value out of range'].
halfWord1 := value bitAnd: 16rFFFF.
halfWord2 := (value bitShift: -16) bitAnd: 255.
result := (halfWord1 * halfWord1) bitShift: -16. "We don't need the lower 16bits at all"
result := result + ((halfWord1 * halfWord2) * 2).
result := result + ((halfWord2 * halfWord2) bitShift: 16).
"word1 := halfWord1 * halfWord1.
word2 := (halfWord2 * halfWord1) + (word1 bitShift: -16).
word1 := word1 bitAnd: 16rFFFF.
word2 := word2 + (halfWord1 * halfWord2).
word2 := word2 + ((halfWord2 * halfWord2) bitShift: 16)."
^result bitShift: -8! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/27/1998 20:46'!
computeInitialStateFrom: source with: transformation
"Compute the initial state in the receiver."
start := (transformation localPointToGlobal: source start) asIntegerPoint.
end := (transformation localPointToGlobal: source end) asIntegerPoint.
via := (transformation localPointToGlobal: source via) asIntegerPoint.! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'jmv 5/14/2015 09:51'!
computeSplitAt: t
"Split the receiver at the parametric value t"
| left right newVia1 newVia2 newPoint |
left := self copy.
right := self copy.
"Compute new intermediate points"
newVia1 := (via - start) * t + start.
newVia2 := (end - via) * t + via.
"Compute new point on curve"
newPoint := ((newVia1 - newVia2) * t + newVia2) asIntegerPoint.
left via: newVia1 asIntegerPoint.
left end: newPoint.
right start: newPoint.
right via: newVia2 asIntegerPoint.
^Array with: left with: right! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 5/25/2000 17:57'!
debugDraw
| entry minY maxY lX lY canvas |
entry := BalloonEdgeData new.
canvas := Display getCanvas.
minY := (start y min: end y) min: via y.
maxY := (start y max: end y) max: via y.
entry yValue: minY.
self stepToFirstScanLineAt: minY in: entry.
lX := entry xValue.
lY := entry yValue.
minY+1 to: maxY do:[:y|
self stepToNextScanLineAt: y in: entry.
canvas line: lX@lY to: entry xValue @ y width: 2 color: Color black.
lX := entry xValue.
lY := y.
].
! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 5/25/2000 17:57'!
debugDraw2
| canvas last max t next |
canvas := Display getCanvas.
max := 100.
last := nil.
0 to: max do:[:i|
t := i asFloat / max asFloat.
next := self valueAt: t.
last ifNotNil:[
canvas line: last to: next rounded width: 2 color: Color blue.
].
last := next rounded.
].! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 5/25/2000 17:57'!
debugDrawWide: n
| entry minY maxY canvas curve p1 p2 entry2 y |
curve := self class new.
curve start: start + (0@n).
curve via: via + (0@n).
curve end: end + (0@n).
entry := BalloonEdgeData new.
entry2 := BalloonEdgeData new.
canvas := Display getCanvas.
minY := (start y min: end y) min: via y.
maxY := (start y max: end y) max: via y.
entry yValue: minY.
entry2 yValue: minY + n.
self stepToFirstScanLineAt: minY in: entry.
curve stepToFirstScanLineAt: minY+n in: entry2.
y := minY.
1 to: n do:[:i|
y := y + 1.
self stepToNextScanLineAt: y in: entry.
p1 := entry xValue @ y.
canvas line: p1 to: p1 + (n@0) width: 1 color: Color black.
].
[y < maxY] whileTrue:[
y := y + 1.
self stepToNextScanLineAt: y in: entry.
p2 := (entry xValue + n) @ y.
curve stepToNextScanLineAt: y in: entry2.
p1 := entry2 xValue @ y.
canvas line: p1 to: p2 width: 1 color: Color black.
].
! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
end
^end! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
end: aPoint
end := aPoint! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 01:34'!
floatStepToFirstScanLineAt: yValue in: edgeTableEntry
"Float version of forward differencing"
| startX endX startY endY deltaY fwX1 fwX2 fwY1 fwY2
steps scaledStepSize squaredStepSize |
(end y) >= (start y) ifTrue:[
startX := start x. endX := end x.
startY := start y. endY := end y.
] ifFalse:[
startX := end x. endX := start x.
startY := end y. endY := start y.
].
deltaY := endY - startY.
"Quickly check if the line is visible at all"
(yValue >= endY or:[deltaY = 0]) ifTrue:[
^edgeTableEntry lines: 0].
fwX1 := (startX + endX - (2 * via x)) asFloat.
fwX2 := (via x - startX * 2) asFloat.
fwY1 := (startY + endY - (2 * via y)) asFloat.
fwY2 := ((via y - startY) * 2) asFloat.
steps := deltaY asInteger * 2.
scaledStepSize := 1.0 / steps asFloat.
squaredStepSize := scaledStepSize * scaledStepSize.
fwDx := fwX2 * scaledStepSize.
fwDDx := 2.0 * fwX1 * squaredStepSize.
fwDy := fwY2 * scaledStepSize.
fwDDy := 2.0 * fwY1 * squaredStepSize.
fwDx := fwDx + (fwDDx * 0.5).
fwDy := fwDy + (fwDDy * 0.5).
lastX := startX asFloat.
lastY := startY asFloat.
"self xDirection: xDir.
self yDirection: yDir."
edgeTableEntry xValue: startX.
edgeTableEntry yValue: startY.
edgeTableEntry zValue: 0.
edgeTableEntry lines: deltaY.
"If not at first scan line then step down to yValue"
yValue = startY ifFalse:[
self stepToNextScanLineAt: yValue in: edgeTableEntry.
"And adjust remainingLines"
edgeTableEntry lines: deltaY - (yValue - startY).
].! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 02:45'!
floatStepToNextScanLineAt: yValue in: edgeTableEntry
"Float version of forward differencing"
[yValue asFloat > lastY] whileTrue:[
(fwDx < -50.0 or:[fwDx > 50.0]) ifTrue:[self halt].
(fwDy < -50.0 or:[fwDy > 50.0]) ifTrue:[self halt].
(fwDDx < -50.0 or:[fwDDx > 50.0]) ifTrue:[self halt].
(fwDDy < -50.0 or:[fwDDy > 50.0]) ifTrue:[self halt].
lastX := lastX + fwDx.
lastY := lastY + fwDy.
fwDx := fwDx + fwDDx.
fwDy := fwDy + fwDDy.
].
edgeTableEntry xValue: lastX asInteger.
edgeTableEntry zValue: 0.! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/30/1998 01:57'!
inTangent
"Return the tangent at the start point"
^via - start! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
initialX
^start y <= end y
ifTrue:[start x]
ifFalse:[end x]! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
initialY
^start y <= end y
ifTrue:[start y]
ifFalse:[end y]! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
initialZ
^0 "Assume no depth given"! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 16:23'!
intStepToFirstScanLineAt: yValue in: edgeTableEntry
"Scaled integer version of forward differencing"
| startX endX startY endY deltaY fwX1 fwX2 fwY1 fwY2
scaledStepSize squaredStepSize |
(end y) >= (start y) ifTrue:[
startX := start x. endX := end x.
startY := start y. endY := end y.
] ifFalse:[
startX := end x. endX := start x.
startY := end y. endY := start y.
].
deltaY := endY - startY.
"Quickly check if the line is visible at all"
(yValue >= endY or:[deltaY = 0]) ifTrue:[
^edgeTableEntry lines: 0].
fwX1 := (startX + endX - (2 * via x)).
fwX2 := (via x - startX * 2).
fwY1 := (startY + endY - (2 * via y)).
fwY2 := ((via y - startY) * 2).
maxSteps := deltaY asInteger * 2.
scaledStepSize := 16r1000000 // maxSteps.
"@@: Okay, we need some fancy 64bit multiplication here"
squaredStepSize := self absoluteSquared8Dot24: scaledStepSize.
squaredStepSize = ((scaledStepSize * scaledStepSize) bitShift: -24)
ifFalse:[self error:'Bad computation'].
fwDx := fwX2 * scaledStepSize.
fwDDx := 2 * fwX1 * squaredStepSize.
fwDy := fwY2 * scaledStepSize.
fwDDy := 2 * fwY1 * squaredStepSize.
fwDx := fwDx + (fwDDx // 2).
fwDy := fwDy + (fwDDy // 2).
self validateIntegerRange.
lastX := startX * 256.
lastY := startY * 256.
edgeTableEntry xValue: startX.
edgeTableEntry yValue: startY.
edgeTableEntry zValue: 0.
edgeTableEntry lines: deltaY.
"If not at first scan line then step down to yValue"
yValue = startY ifFalse:[
self stepToNextScanLineAt: yValue in: edgeTableEntry.
"And adjust remainingLines"
edgeTableEntry lines: deltaY - (yValue - startY).
].! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 04:02'!
intStepToNextScanLineAt: yValue in: edgeTableEntry
"Scaled integer version of forward differencing"
[maxSteps >= 0 and:[yValue * 256 > lastY]] whileTrue:[
self validateIntegerRange.
lastX := lastX + ((fwDx + 16r8000) // 16r10000).
lastY := lastY + ((fwDy + 16r8000) // 16r10000).
fwDx := fwDx + fwDDx.
fwDy := fwDy + fwDDy.
maxSteps := maxSteps - 1.
].
edgeTableEntry xValue: lastX // 256.
edgeTableEntry zValue: 0.! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/29/1998 22:14'!
isMonoton
"Return true if the receiver is monoton along the y-axis,
e.g., check if the tangents have the same sign"
^(via y - start y) * (end y - via y) >= 0! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/30/1998 01:57'!
outTangent
"Return the tangent at the end point"
^end - via! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 00:35'!
printOn: aStream
aStream
nextPutAll: self class name;
nextPut:$(;
print: start;
nextPutAll:' - ';
print: via;
nextPutAll:' - ';
print: end;
nextPut:$)! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 21:56'!
quickPrint: curve
Transcript nextPut:$(;
print: curve start;
space;
print: curve via;
space;
print: curve end;
nextPut:$).! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 22:13'!
quickPrint: curve first: aBool
aBool ifTrue:[Transcript cr].
Transcript nextPut:$(;
print: curve start;
space;
print: curve via;
space;
print: curve end;
nextPut:$).
Transcript endEntry.! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
start
^start! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
start: aPoint
start := aPoint! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 03:53'!
stepToFirst
| startX endX startY endY deltaY fwX1 fwX2 fwY1 fwY2
steps scaledStepSize squaredStepSize |
(end y) >= (start y) ifTrue:[
startX := start x. endX := end x.
startY := start y. endY := end y.
] ifFalse:[
startX := end x. endX := start x.
startY := end y. endY := start y.
].
deltaY := endY - startY.
"Quickly check if the line is visible at all"
(deltaY = 0) ifTrue:[^self].
fwX1 := (startX + endX - (2 * via x)) asFloat.
fwX2 := (via x - startX * 2) asFloat.
fwY1 := (startY + endY - (2 * via y)) asFloat.
fwY2 := ((via y - startY) * 2) asFloat.
steps := deltaY asInteger * 2.
scaledStepSize := 1.0 / steps asFloat.
squaredStepSize := scaledStepSize * scaledStepSize.
fwDx := fwX2 * scaledStepSize.
fwDDx := 2.0 * fwX1 * squaredStepSize.
fwDy := fwY2 * scaledStepSize.
fwDDy := 2.0 * fwY1 * squaredStepSize.
fwDx := fwDx + (fwDDx * 0.5).
fwDy := fwDy + (fwDDy * 0.5).
lastX := startX asFloat.
lastY := startY asFloat.
! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 03:50'!
stepToFirstInt
"Scaled integer version of forward differencing"
| startX endX startY endY deltaY fwX1 fwX2 fwY1 fwY2
scaledStepSize squaredStepSize |
self halt.
(end y) >= (start y) ifTrue:[
startX := start x. endX := end x.
startY := start y. endY := end y.
] ifFalse:[
startX := end x. endX := start x.
startY := end y. endY := start y.
].
deltaY := endY - startY.
"Quickly check if the line is visible at all"
(deltaY = 0) ifTrue:[^nil].
fwX1 := (startX + endX - (2 * via x)).
fwX2 := (via x - startX * 2).
fwY1 := (startY + endY - (2 * via y)).
fwY2 := ((via y - startY) * 2).
maxSteps := deltaY asInteger * 2.
scaledStepSize := 16r1000000 // maxSteps.
"@@: Okay, we need some fancy 64bit multiplication here"
squaredStepSize := (scaledStepSize * scaledStepSize) bitShift: -24.
fwDx := fwX2 * scaledStepSize.
fwDDx := 2 * fwX1 * squaredStepSize.
fwDy := fwY2 * scaledStepSize.
fwDDy := 2 * fwY1 * squaredStepSize.
fwDx := fwDx + (fwDDx // 2).
fwDy := fwDy + (fwDDy // 2).
self validateIntegerRange.
lastX := startX * 256.
lastY := startY * 256.
! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/31/1998 16:36'!
stepToFirstScanLineAt: yValue in: edgeTableEntry
"Compute the initial x value for the scan line at yValue"
^self intStepToFirstScanLineAt: yValue in: edgeTableEntry! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 00:26'!
stepToNext
lastX := lastX + fwDx.
lastY := lastY + fwDy.
fwDx := fwDx + fwDDx.
fwDy := fwDy + fwDDy.! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 04:01'!
stepToNextInt
"Scaled integer version of forward differencing"
self halt.
(maxSteps >= 0) ifTrue:[
self validateIntegerRange.
lastX := lastX + ((fwDx + 16r8000) // 16r10000).
lastY := lastY + ((fwDy + 16r8000) // 16r10000).
fwDx := fwDx + fwDDx.
fwDy := fwDy + fwDDy.
maxSteps := maxSteps - 1.
].! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 03:40'!
stepToNextScanLineAt: yValue in: edgeTableEntry
"Compute the next x value for the scan line at yValue.
This message is sent during incremental updates.
The yValue parameter is passed in here for edges
that have more complicated computations,"
^self intStepToNextScanLineAt: yValue in: edgeTableEntry! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 11/1/1998 00:31'!
subdivide
"Subdivide the receiver"
| dy dx |
"Test 1: If the bezier curve is not monoton in Y, we need a subdivision"
self isMonoton ifFalse:[
MonotonSubdivisions := MonotonSubdivisions + 1.
^self subdivideToBeMonoton].
"Test 2: If the receiver is horizontal, don't do anything"
(end y = start y) ifTrue:[^nil].
"Test 3: If the receiver can be represented as a straight line,
make a line from the receiver and declare it invalid"
((end - start) crossProduct: (via - start)) = 0 ifTrue:[
LineConversions := LineConversions + 1.
^self subdivideToBeLine].
"Test 4: If the height of the curve exceeds 256 pixels, subdivide
(forward differencing is numerically not very stable)"
dy := end y - start y.
dy < 0 ifTrue:[dy := dy negated].
(dy > 255) ifTrue:[
HeightSubdivisions := HeightSubdivisions + 1.
^self subdivideAt: 0.5].
"Test 5: Check if the incremental values could possibly overflow the scaled integer range"
dx := end x - start x.
dx < 0 ifTrue:[dx := dx negated].
dy * 32 < dx ifTrue:[
OverflowSubdivisions := OverflowSubdivisions + 1.
^self subdivideAt: 0.5].
^nil! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 22:13'!
subdivideAt: parameter
"Subdivide the receiver at the given parameter"
| both |
(parameter <= 0.0 or:[parameter >= 1.0]) ifTrue:[self halt].
both := self computeSplitAt: parameter.
"Transcript cr.
self quickPrint: self.
Transcript space.
self quickPrint: both first.
Transcript space.
self quickPrint: both last.
Transcript endEntry."
self via: both first via.
self end: both first end.
^both last! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 11/11/1998 22:15'!
subdivideToBeLine
"Not a true subdivision.
Just return a line representing the receiver and fake me to be of zero height"
| line |
line := BalloonLineSimulation new.
line start: start.
line end: end.
"Make me invalid"
end := start.
via := start.
^line! !
!BalloonBezierSimulation methodsFor: 'computing' stamp: 'ar 10/30/1998 02:24'!
subdivideToBeMonoton
"Subdivide the receiver at it's extreme point"
| v1 v2 t other |
v1 := (via - start).
v2 := (end - via).
t := (v1 y / (v2 y - v1 y)) negated asFloat.
other := self subdivideAt: t.
self isMonoton ifFalse:[self halt].
other isMonoton ifFalse:[self halt].
^other! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/30/1998 03:27'!
validateIntegerRange
fwDx class == SmallInteger ifFalse:[self halt].
fwDy class == SmallInteger ifFalse:[self halt].
fwDDx class == SmallInteger ifFalse:[self halt].
fwDDy class == SmallInteger ifFalse:[self halt].
! !
!BalloonBezierSimulation methodsFor: 'private' stamp: 'ar 10/29/1998 21:26'!
valueAt: parameter
"Return the point at the value parameter:
p(t) = (1-t)^2 * p1 +
2*t*(1-t) * p2 +
t^2 * p3.
"
| t1 t2 t3 |
t1 := (1.0 - parameter) squared.
t2 := 2 * parameter * (1.0 - parameter).
t3 := parameter squared.
^(start * t1) + (via * t2) + (end * t3)! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
via
^via! !
!BalloonBezierSimulation methodsFor: 'accessing' stamp: 'ar 10/27/1998 20:45'!
via: aPoint
via := aPoint! !
!BalloonBezierSimulation class methodsFor: 'initialization' stamp: 'MarcusDenker 9/30/2009 11:56'!
initialize
HeightSubdivisions := 0.
LineConversions := 0.
MonotonSubdivisions := 0.
OverflowSubdivisions := 0.! !
!BalloonBuffer methodsFor: 'accessing' stamp: 'ar 10/26/1998 21:12'!
at: index
"For simulation only"
| word |
word := self basicAt: index.
word < 16r3FFFFFFF ifTrue:[^word]. "Avoid LargeInteger computations"
^word >= 16r80000000 "Negative?!!"
ifTrue:["word - 16r100000000"
(word bitInvert32 + 1) negated]
ifFalse:[word]! !