00001 #ifndef __AIColor__
00002 #define __AIColor__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __AITypes__
00030 #include "AITypes.h"
00031 #endif
00032
00033 #ifndef __AIRealMath__
00034 #include "AIRealMath.h"
00035 #endif
00036
00037 #include "AIHeaderBegin.h"
00038
00042
00043
00044
00045
00046
00047
00051 typedef enum {
00053 kGrayColor = 0,
00055 kFourColor,
00057 kPattern,
00059 kCustomColor,
00061 kGradient,
00063 kThreeColor,
00066 kNoneColor
00067 } AIColorTag;
00068
00071 typedef enum {
00073 kCustomFourColor = 0,
00075 kCustomThreeColor,
00077 kCustomLabColor
00078 } AICustomColorTag;
00079
00081 enum {
00084 kLinearGradient = 0,
00086 kRadialGradient
00087 };
00088
00091 typedef short AICustomColorFlags;
00092
00095 #define kCustomSpotColor 0x0001
00096
00098 #define kCustomRegistrationColor 0x0002
00099
00100
00104 #define kNameInvalidForSpotColorErr 'NA~.'
00105
00106
00107
00108
00109
00110
00111
00112
00114 typedef struct {
00115 AIReal gray;
00116 } AIGrayColorStyle;
00117
00119 typedef struct {
00120 AIBoolean gray;
00121 } AIGrayColorStyleMap;
00122
00123
00125 typedef struct {
00126 AIReal cyan, magenta, yellow, black;
00127 } AIFourColorStyle;
00128
00130 typedef struct {
00131 AIBoolean cyan, magenta, yellow, black;
00132 } AIFourColorStyleMap;
00133
00134
00136 typedef struct {
00137 AIReal red, green, blue;
00138 } AIThreeColorStyle;
00139
00141 typedef struct {
00142 AIBoolean red, green, blue;
00143 } AIThreeColorStyleMap;
00144
00145
00147 typedef struct {
00148 AIReal l, a, b;
00149 } AILabColorStyle;
00150
00152 typedef struct {
00153 AIBoolean l, a, b;
00154 } AILabColorStyleMap;
00155
00156
00159 typedef union {
00161 AIFourColorStyle f;
00163 AIThreeColorStyle rgb;
00165 AIGrayColorStyle gray;
00167 AILabColorStyle lab;
00168 } AICustomColorUnion;
00169
00173 typedef struct {
00175 AICustomColorTag kind;
00177 AICustomColorUnion c;
00180 AICustomColorFlags flag;
00181 } AICustomColor;
00182
00184 typedef void *AICustomColorHandle;
00185
00187 typedef struct {
00189 AICustomColorHandle color;
00192 AIReal tint;
00193 } AICustomColorStyle;
00194
00196 typedef struct {
00197 AIBoolean color;
00198 AIBoolean tint;
00199 } AICustomColorStyleMap;
00200
00202 typedef struct {
00203 AIBoolean not_implemented;
00204 } AIPattern;
00205
00207 typedef void *AIPatternHandle;
00208
00220 typedef struct {
00225 AIPatternHandle pattern;
00228 AIReal shiftDist;
00231 AIReal shiftAngle;
00233 AIRealPoint scale;
00235 AIReal rotate;
00237 AIBoolean reflect;
00239 AIReal reflectAngle;
00241 AIReal shearAngle;
00243 AIReal shearAxis;
00245 AIRealMatrix transform;
00246 } AIPatternStyle;
00247
00249 typedef struct {
00250 AIBoolean pattern;
00251 AIBoolean shiftDist;
00252 AIBoolean shiftAngle;
00253 AIBoolean scale;
00254 AIBoolean rotate;
00255 AIBoolean reflect;
00256 AIBoolean reflectAngle;
00257 AIBoolean shearAngle;
00258 AIBoolean shearAxis;
00259 AIBoolean transform;
00260 } AIPatternStyleMap;
00261
00263 typedef void *AIGradientHandle;
00264
00275 typedef struct {
00279 AIGradientHandle gradient;
00283 AIRealPoint gradientOrigin;
00288 AIReal gradientAngle;
00292 AIReal gradientLength;
00298 AIRealMatrix matrix;
00301 AIReal hiliteAngle;
00305 AIReal hiliteLength;
00306 void Init()
00307 {
00308 gradient = NULL;
00309 gradientOrigin.h = kAIRealZero;
00310 gradientOrigin.v = kAIRealZero;
00311 gradientAngle = kAIRealZero;
00312 gradientLength = kAIRealZero;
00313 matrix.Init();
00314 hiliteAngle = kAIRealZero;
00315 hiliteLength = kAIRealZero;
00316 }
00317 } AIGradientStyle;
00318
00320 typedef struct {
00321 AIBoolean gradient;
00322 AIBoolean gradientOrigin;
00323 AIBoolean gradientAngle;
00324 AIBoolean gradientLength;
00325 AIBoolean matrix;
00326 AIBoolean hiliteAngle;
00327 AIBoolean hiliteLength;
00328 void Init()
00329 {
00330 gradient = false;
00331 gradientOrigin = false;
00332 gradientAngle = false;
00333 gradientLength = false;
00334 matrix = false;
00335 hiliteAngle = false;
00336 hiliteLength = false;
00337 }
00338 } AIGradientStyleMap;
00339
00340
00342 typedef union {
00344 AIGrayColorStyle g;
00346 AIFourColorStyle f;
00348 AIThreeColorStyle rgb;
00350 AICustomColorStyle c;
00352 AIPatternStyle p;
00354 AIGradientStyle b;
00355 } AIColorUnion;
00356
00358 typedef union {
00360 AIGrayColorStyleMap g;
00362 AIFourColorStyleMap f;
00364 AIThreeColorStyleMap rgb;
00366 AICustomColorStyleMap c;
00368 AIPatternStyleMap p;
00370 AIGradientStyleMap b;
00371 } AIColorUnionMap;
00372
00378 typedef struct {
00380 AIColorTag kind;
00383 AIColorUnion c;
00384 } AIColor;
00385
00389 typedef struct {
00390 AIBoolean kind;
00391 AIColorUnionMap c;
00392 } AIColorMap;
00393
00394
00399 typedef struct {
00404 AIReal midPoint;
00408 AIReal rampPoint;
00411 AIColor color;
00414 AIReal opacity;
00415 void Init()
00416 {
00417 midPoint = kAIRealZero;
00418 rampPoint = kAIRealZero;
00419 color.kind = kNoneColor;
00420 opacity = kAIRealZero;
00421 }
00422 } AIGradientStop;
00423
00424
00426 typedef unsigned short AIColorUsedHow;
00427
00430 enum AIColorUsedHowValues {
00432 kAIColorNotUsed = 0x0000,
00434 kAIColorUsedOnStroke = 0x0001,
00436 kAIColorUsedInFill = 0x0002,
00437
00438
00439
00440
00441 kAIColorUsedIndirectly = 0x0004
00442 };
00443
00463 typedef void (*AIAdjustColorFunc) (AIColor *color, void *userData, AIErr *result, AIBoolean *altered);
00464
00483 typedef void (*AIAdjustColorsWithOPFunc) (AIColor *color, void *userData, AIErr *result, AIBoolean *altered,
00484 AIColorUsedHow usedWhere, AIBoolean *overprint );
00485
00497 typedef AIErr (*AIAdjustPatternHandleFunc) ( AIPatternHandle oldPattern, AIPatternHandle *newPattern, void *userData );
00498
00499
00501 typedef unsigned short VisitAIColorFlags;
00502
00506 enum VisitAIColorFlagValues {
00508 kVisitColorsNullFlags = 0x0000,
00512 kVisitColorsSelectedOnly = 0x0001,
00513
00522 kVisitColorsUniversally = 0x0002,
00523
00526 kVisitColorsDirectOnly = 0x0004,
00527
00540 kVisitColorsSolidOnly = 0x0008,
00541
00543 kVisitColorsFillsOnly = 0x0010,
00544
00546 kVisitColorsStrokesOnly = 0x0020,
00547
00551 kVisitColorsReadOnly = 0x0040,
00552
00555 kVisitColorsInResultArt = 0x0080,
00556
00564 kVisitGlobalObjectsOnceOnly = 0x0100,
00565
00570 kVisitColorsForModalPreview = 0x0200,
00571
00580 kVisitColorsForceAnonymous = 0x0400,
00581
00583 kVisitColorsIncludeRegistration = 0x0800
00584 };
00585
00586 #include "AIHeaderEnd.h"
00587
00588 #endif