00001 #ifndef __AIBeautifulStrokes__
00002 #define __AIBeautifulStrokes__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "AITypes.h"
00023 #include "AIEntry.h"
00024 #include "AILiveEffect.h"
00025 #include "AITabletData.h"
00026 #include "AIPath.h"
00027 #include "AIHeaderBegin.h"
00028
00029
00030
00031
00032
00033
00034
00039 enum RepeatedArtAdjustment
00040 {
00042 kStretch,
00044 kAddSpace,
00046 kAdjustPath,
00047
00053 kUnknownRepeatedArtAdjustment = 0xFFFFFFFF,
00054
00056 RepeatedArtAdjustment_dummy = 0xFFFFFFFF
00057 };
00058
00059 enum RepeatedArtCorner {
00060
00062 kNoCorner,
00063
00065 kAutoCentered,
00066
00068 kAutoBetween,
00069
00071 kAutoSliced,
00072
00074 kAutoOverlap
00075 };
00076
00082 enum StrokeWidthSource
00083 {
00085 kConstantWidth,
00086
00088 kTabletData,
00089
00092 kUserProfile,
00093
00095 kCenteredProfileMark = 0x0000FF01,
00097 kUncenteredProfileMark,
00099 kCenteredProfileInterpolation,
00101 kUncenteredProfileInterpolation,
00102
00106 kUnknownStrokeWidthSource = 0xFFFFFFFF,
00107
00109 StrokeWidthSource_dummy = 0xFFFFFFFF
00110 };
00111
00112 enum GradientStrokeApplication
00113 {
00116 kGradientStrokeMask,
00117
00119 kGradientStrokeAlong,
00120
00122 kGradientStrokeAcross,
00123
00125 kGradientStroke_dummy = 0xFFFFFFFF
00126 };
00127
00131 enum ArrowTipAlignment
00132 {
00135 kArrowTipAtEnd,
00138 kArrowAttachmentPtAtEnd,
00141 kArrowTruncationPtAtEnd,
00142
00146 kUnknownArrowAlignment = 0xFFFFFFFF
00147 };
00148
00149
00151 typedef ai::uint32 WidthMarkerFlags;
00152
00153
00154
00155 enum WidthMarkerFlagValues
00156 {
00158 kNoWidthMarkerFlags = 0,
00159
00160
00161
00168 kIncomingWidthMarker = 0x1,
00169
00170
00177 kOutgoingWidthMarker = 0x4,
00178
00179
00184 kCornerWidthMarker = 0x10,
00188 kCornerLeftWidthMarker = 0x10,
00192 kCornerRightWidthMarker = 0x20,
00193
00218 kAnchoredWidthMarker = 0x40,
00219
00220
00221
00222
00223
00233 kSpreadWidthChanges = 0x10000,
00234
00239 kCopyMarker = 0x20000,
00240
00245 kLimitAtNeighbors = 0x40000,
00246
00251 kUniformChangeAcrossSpread = 0x80000,
00252
00259 kProportionalChangeAcrossSpread = 0x100000
00260
00261 };
00262
00264 typedef ai::uint32 WidthMarkerFlags;
00265
00270 typedef AIAPI AIBoolean (*AIGenerateArtProgressProc)(ai::int32 current, ai::int32 total);
00271
00280 struct StrokeHitResults
00281 {
00283 AIBoolean hitSomething;
00285 AIBoolean hitWidthMarker;
00287 AIBoolean hitCenterline;
00289 AIBoolean hitStrokeEdge;
00290
00300 AIRealPoint pointOnPath;
00301
00313 AIRealPoint snappedPoint;
00314
00318 AIReal hitDistance;
00319
00321 ai::int16 widthMarkerIndex;
00322
00324 AIReal lengthFraction;
00326 ai::int16 segIndex;
00328 AIReal bezierT;
00329 };
00330
00331
00334 enum PathEditType
00335 {
00337 kClearProfileAnchorsOnly = 0,
00338
00345 kClearAnchorsAndResetProfile,
00346
00356 kCopyAndResetAnchors,
00357
00359 kTranslate1Anchor,
00360
00363 kRemove1Anchor,
00364
00366 kAdd1Anchor,
00367
00369 kAdjustBezier,
00370
00377 kTransformSelection,
00378
00380 kReversePathDirection,
00381
00387 kSplitPath,
00388
00390 kApplyStyle
00391 };
00392
00393
00396 struct PathEditDescription
00397 {
00398 PathEditType editType;
00399
00412 ai::int16 segIndex;
00413
00418 AIArtStyleHandle newStyle;
00419
00421 AIPathSegment newAnchor;
00422
00424 AIArtHandle sourcePath;
00425
00426 };
00427
00428
00429
00430
00431
00432
00433
00434 #define kAIBeautifulStrokesSuite "AI Beautiful Strokes Suite"
00435 #define kAIBeautifulStrokesSuiteVersion3 AIAPI_VERSION(3)
00436 #define kAIBeautifulStrokesSuiteVersion kAIBeautifulStrokesSuiteVersion3
00437 #define kAIBeautifulStrokesVersion kAIBeautifulStrokesSuiteVersion
00438
00443 #define kAIBeautifulStrokesParamsDictKey "kAIBeautifulStrokesParamsDictKey"
00444
00445
00446
00447
00448
00449
00450
00498 struct AIBeautifulStrokesSuite
00499 {
00500
00501
00502
00530 AIAPI AIErr (*GenerateArt)(ConstAILiveEffectParameters effectParams, AIArtHandle inArt, AIArtHandle sourceArt,
00531 AIBoolean outputOnTop, AIArtHandle outGroup, AIArtHandle *outArt, AIGenerateArtProgressProc progressProc);
00532
00544 AIAPI AIErr (*CreateParamsDict)(AILiveEffectParameters effectParams, AIDictionaryRef ¶ms);
00545
00556 AIAPI AIErr (*GetParamsDict)(ConstAILiveEffectParameters effectParams, AIDictionaryRef ¶ms);
00557
00564 AIAPI AIBoolean (*Equiv)(ConstAIDictionaryRef params1, ConstAIDictionaryRef params2);
00565
00576 AIAPI AIErr (*AccumulateParams)(ConstAILiveEffectParameters effectParams, AIDictionaryRef accumulator);
00577
00588 AIAPI AIErr (*ApplyParams)(ConstAIDictionaryRef params, AIDictionaryRef target);
00589
00604 AIAPI AIBoolean (*ContainsParams)(ConstAIDictionaryRef paramsDict);
00605
00627 AIAPI AIErr (*GetArtStrokeParams)(AIArtHandle art, AIDictionaryRef ¶mDict,
00628 AIStrokeStyle *strokeStyle, AIBoolean *hasBrush,
00629 AIReal *scaleFactor, AIBoolean *canAccept);
00630
00647 AIAPI AIErr (*InterpolateParams)(ConstAILiveEffectParameters effectParams1, ConstAILiveEffectParameters effectParams2,
00648 AILiveEffectParameters effectParamsOut, AIReal dist);
00649
00650
00651
00657 AIAPI AIErr (*SetFlipAcross)(AIDictionaryRef params, AIBoolean flipAcross);
00658
00665 AIAPI AIBoolean (*GetFlipAcross)(ConstAIDictionaryRef params);
00666
00672 AIAPI AIErr (*SetFlipAlong)(AIDictionaryRef params, AIBoolean flipAlong);
00673
00680 AIAPI AIBoolean (*GetFlipAlong)(ConstAIDictionaryRef params);
00681
00689 AIAPI AIErr (*SetScale)(AIDictionaryRef params, AIReal scale, const AIReal *mnScale, const AIReal *mxScale);
00690
00698 AIAPI AIErr (*GetScale)(ConstAIDictionaryRef params, AIReal &scale, AIReal *mnScale, AIReal *mxScale);
00699
00702 AIAPI AIErr (*SetFoldAdjustment)(AIDictionaryRef params, AIBoolean adjust);
00703
00714 AIAPI AIBoolean (*GetFoldAdjustment)(ConstAIDictionaryRef params, AIBoolean *mixed);
00715
00716
00717
00723 AIAPI AIErr (*SetArtPaint)(AIDictionaryRef params, AIPatternHandle art);
00724
00731 AIAPI AIPatternHandle (*GetArtPaint)(ConstAIDictionaryRef params);
00732
00739 AIAPI AIErr (*SetStretch)(AIDictionaryRef params, AIBoolean stretch);
00740
00748 AIAPI AIBoolean (*GetStretch)(ConstAIDictionaryRef params);
00749
00757 AIAPI AIErr (*SetStartEndSegmentLength)(AIDictionaryRef params, AIReal startSegmentLength, AIReal endSegmentLength);
00758
00766 AIAPI AIErr (*GetStartEndSegmentLength)(ConstAIDictionaryRef params, AIReal &startSegmentLength, AIReal &endSegmentLength);
00767
00768
00769
00784 AIAPI AIErr (*SetArtPatternPaint)(AIDictionaryRef params, AIPatternHandle beginArt, AIPatternHandle endArt,
00785 AIPatternHandle sideArt,
00786 AIPatternHandle insideCornerArt, AIPatternHandle outsideCornerArt,
00787 RepeatedArtAdjustment adjustment, AIReal spacing,
00788 RepeatedArtCorner insideAutoCornerOption, RepeatedArtCorner outsideAutoCornerOption);
00789
00815 AIAPI AIErr (*GetArtPatternPaint)(ConstAIDictionaryRef params, AIPatternHandle &beginArt, AIPatternHandle &endArt,
00816 AIPatternHandle &sideArt,
00817 AIPatternHandle &insideCornerArt, AIPatternHandle &outsideCornerArt,
00818 RepeatedArtAdjustment &adjustment, AIReal &spacing,
00819 RepeatedArtCorner &insideAutoCornerOption, RepeatedArtCorner &outsideAutoCornerOption);
00820
00821
00822
00831 AIAPI AIErr (*SetDashAdjustment)(AIDictionaryRef params, AIBoolean adjust);
00832
00843 AIAPI AIBoolean (*GetDashAdjustment)(ConstAIDictionaryRef params, AIBoolean *mixed);
00844
00845
00846
00855 AIAPI AIErr (*SetGradientStrokeApplication)(AIDictionaryRef params, GradientStrokeApplication application);
00856
00866 AIAPI AIErr (*GetGradientStrokeApplication)(ConstAIDictionaryRef params, GradientStrokeApplication &application, AIBoolean *mixed);
00867
00868
00869
00913 AIAPI AIErr (*SetArrowheadOptions)(AIDictionaryRef params, AIPatternHandle *beginSymbol, AIPatternHandle *endSymbol,
00914 AIReal beginScale, AIReal endScale, ArrowTipAlignment alignment);
00915
00935 AIAPI AIErr (*GetArrowheadOptions)(ConstAIDictionaryRef params, AIPatternHandle *beginSymbol, AIPatternHandle *endSymbol,
00936 AIReal *beginScale, AIReal *endScale, ArrowTipAlignment *alignment,
00937 AIBoolean *mixedBeginArrows, AIBoolean *mixedEndArrows);
00938
00939
00940
00949 AIAPI AIErr (*SetWidthSource)(AIDictionaryRef params, StrokeWidthSource source);
00950
00957 AIAPI StrokeWidthSource (*GetWidthSource)(ConstAIDictionaryRef params);
00958
00966 AIAPI AIErr (*SetWidthTabletDataSource)(AIDictionaryRef params, AITabletDataType dataType);
00967
00974 AIAPI AIErr (*GetWidthTabletDataSource)(ConstAIDictionaryRef params, AITabletDataType &dataType);
00975
01014 AIAPI AIErr (*SetCenteredWidthProfile)(AIDictionaryRef params, AIArrayRef tVals, AIArrayRef widths);
01015
01024 AIAPI AIErr (*GetCenteredWidthProfile)(ConstAIDictionaryRef params, AIArrayRef &distances, AIArrayRef &widths);
01025
01040 AIAPI AIErr (*SetUncenteredWidthProfile)(AIDictionaryRef params, AIArrayRef tVals, AIArrayRef leftWidths, AIArrayRef rightWidths);
01041
01055 AIAPI AIErr (*GetUncenteredWidthProfile)(ConstAIDictionaryRef params, AIArrayRef &tVals, AIArrayRef &leftWidths, AIArrayRef &rightWidths);
01056
01092 AIAPI AIErr (*SetWidthProfileDetails)(AIDictionaryRef params, AIArrayRef markerOptions,
01093 AIArrayRef incomingLeftSmoothness, AIArrayRef outgoingLeftSmoothness,
01094 AIArrayRef incomingRightSmoothness, AIArrayRef outgoingRightSmoothness);
01095
01110 AIAPI AIErr (*GetWidthProfileDetails)(ConstAIDictionaryRef params, AIArrayRef &markerOptions,
01111 AIArrayRef &incomingLeftSmoothness, AIArrayRef &outgoingLeftSmoothness,
01112 AIArrayRef &incomingRightSmoothness, AIArrayRef &outgoingRightSmoothness);
01113
01127 AIAPI AIErr (*GetPathAdjustedWidthDistances)(AIArtHandle path, AIArrayRef &adjustedDistances);
01128
01167 AIAPI AIErr (*GetWidthsAtDistance)(AIArtHandle path, AIReal &lengthFraction, AIReal tolerance,
01168 AIReal *totalWidth, AIReal *leftWidth, AIReal *rightWidth,
01169 StrokeWidthSource *widthSource, ai::int16 *markerIndex, WidthMarkerFlags *markerDetails);
01170
01185 AIAPI AIErr (*SetCenteredWidthAtDistance)(AIArtHandle path, AIReal lengthFraction, AIReal width, WidthMarkerFlags options);
01186
01203 AIAPI AIErr (*SetUncenteredWidthsAtDistance)(AIArtHandle path, AIReal lengthFraction,
01204 AIReal leftWidth, AIReal rightWidth, WidthMarkerFlags options);
01205
01236 AIAPI AIErr (*SlideWidthMarkerToNewT)(AIArtHandle path, ai::int16 markerIndex, AIReal &newTValue, WidthMarkerFlags options);
01237
01243 AIAPI AIErr (*DeleteWidthPoint)(AIArtHandle path, ai::int16 markerIndex);
01244
01260 AIAPI AIErr (*AdjustWidthAnchorsBeforePathEdit)(AIArtHandle path, const PathEditDescription &editDescription);
01261
01271 AIAPI AIErr (*StrokeHitTest)(AIArtHandle path, const AIRealPoint &cursor, AIReal tolerance, StrokeHitResults *hitResults);
01272
01273 };
01274
01275 #include "AIHeaderEnd.h"
01276 #endif