Adobe.com
Contents Suites Classes Class Index Member Index

AIColor.h

Go to the documentation of this file.
00001 #ifndef __AIColor__
00002 #define __AIColor__
00003 
00004 /*************************************************************************
00005  *
00006  * ADOBE CONFIDENTIAL
00007  *
00008  * Copyright 2018 Adobe
00009  *
00010  * All Rights Reserved.
00011  *
00012  * NOTICE: Adobe permits you to use, modify, and distribute this file in
00013  * accordance with the terms of the Adobe license agreement accompanying
00014  * it. If you have received this file from a source other than Adobe,
00015  * then your use, modification, or distribution of it requires the prior
00016  * written permission of Adobe.
00017  *
00018  **************************************************************************/
00019 
00020 
00021 /*******************************************************************************
00022  **
00023  **     Imports
00024  **
00025  **/
00026 
00027 #ifndef __AITypes__
00028 #include "AITypes.h"
00029 #endif
00030 
00031 #ifndef __AIRealMath__
00032 #include "AIRealMath.h"
00033 #endif
00034 
00035 #include "AIHeaderBegin.h"
00036 
00040 /*******************************************************************************
00041  **
00042  **     Constants
00043  **
00044  **/
00045 
00049 typedef enum {
00051         kGrayColor = 0,
00053         kFourColor,
00055         kPattern,
00057         kCustomColor,
00059         kGradient,
00061         kThreeColor,
00064         kNoneColor,
00068     kAdvanceColor
00069 } AIColorTag;
00070 
00073 typedef enum {
00075         kCustomFourColor = 0,
00077         kCustomThreeColor,
00079         kCustomLabColor
00080 } AICustomColorTag;
00081 
00083 enum {
00086         kLinearGradient = 0,
00088         kRadialGradient
00089 };
00090 
00093 typedef short AICustomColorFlags;
00094 
00097 #define kCustomSpotColor                        0x0001
00098 
00100 #define kCustomRegistrationColor        0x0002
00101 
00102 
00106 #define kNameInvalidForSpotColorErr             'NA~.'
00107 
00108 
00109 /*******************************************************************************
00110  **
00111  **     Types
00112  **
00113  **/
00114 
00116 typedef struct {
00117         AIReal gray;
00118     void Init()
00119     {
00120         gray = 0;
00121     }
00122 } AIGrayColorStyle;
00123 
00125 typedef struct {
00126         AIBoolean gray;
00127     void Init()
00128     {
00129         gray = false;
00130     }
00131 } AIGrayColorStyleMap;
00132 
00133 
00135 typedef struct {
00136         AIReal cyan, magenta, yellow, black;
00137     void Init()
00138     {
00139         cyan = 0;
00140         magenta = 0;
00141         yellow = 0;
00142         black = 0;
00143     }
00144 } AIFourColorStyle;
00145 
00147 typedef struct {
00148         AIBoolean cyan, magenta, yellow, black;
00149     void Init()
00150     {
00151         cyan = false;
00152         magenta = false;
00153         yellow = false;
00154         black = false;
00155     }
00156 } AIFourColorStyleMap;
00157 
00158 
00160 typedef struct {
00161         AIReal red, green, blue;
00162     void Init()
00163     {
00164         red = 0;
00165         green = 0;
00166         blue = 0;
00167     }
00168 } AIThreeColorStyle;
00169 
00171 typedef struct {
00172         AIBoolean red, green, blue;
00173     void Init()
00174     {
00175         red = false;
00176         green = false;
00177         blue = false;
00178     }
00179 } AIThreeColorStyleMap;
00180 
00181 
00183 typedef struct {
00184         AIReal l, a, b;
00185     void Init()
00186     {
00187         l = 0;
00188         a = 0;
00189         b = 0;
00190     }
00191 } AILabColorStyle;
00192 
00194 typedef struct {
00195         AIBoolean l, a, b;
00196     void Init()
00197     {
00198         l = false;
00199         a = false;
00200         b = false;
00201     }
00202 } AILabColorStyleMap;
00203 
00204 
00207 typedef union {
00209         AIFourColorStyle        f;
00211         AIThreeColorStyle       rgb;
00213         AIGrayColorStyle        gray;
00215         AILabColorStyle         lab;
00216 } AICustomColorUnion;
00217 
00221 typedef struct {
00223         AICustomColorTag        kind;
00225         AICustomColorUnion      c;
00228         AICustomColorFlags      flag;
00229 
00230         void Init()
00231         {
00232                 flag = 0;
00233                 kind = kCustomFourColor;
00234                 c = {};
00235         }
00236 } AICustomColor;
00237 
00239 typedef void *AICustomColorHandle;
00240 
00242 typedef struct {
00244         AICustomColorHandle color;
00247         AIReal tint;
00248     
00249     void Init()
00250     {
00251         color = nullptr;
00252         tint = 0;
00253     }
00254 } AICustomColorStyle;
00255 
00257 typedef struct {
00258     AIBoolean color;
00259         AIBoolean tint;
00260     void Init()
00261     {
00262         color = false;
00263         tint = false;
00264     }
00265 } AICustomColorStyleMap;
00266 
00268 typedef struct {
00269         AIBoolean not_implemented;
00270 } AIPattern;
00271 
00273 typedef void *AIPatternHandle;
00274 
00286 typedef struct {
00291         AIPatternHandle pattern;
00294         AIReal shiftDist;
00297         AIReal shiftAngle;
00299     AIRealPoint scale;
00301         AIReal rotate;
00303         AIBoolean reflect;
00305         AIReal reflectAngle;
00307         AIReal shearAngle;
00309         AIReal shearAxis;
00311         AIRealMatrix transform;
00312     
00313     void Init()
00314     {
00315         pattern = nullptr;
00316         shiftDist = 0;
00317         shiftAngle = 0;
00318         scale = {0, 0};
00319         rotate = 0;
00320         reflect = false;
00321         reflectAngle = 0;
00322         shearAngle = 0;
00323         shearAxis = 0;
00324                 transform.Init();
00325     }
00326     
00327 } AIPatternStyle;
00328 
00330 typedef struct {
00331     AIBoolean pattern;
00332         AIBoolean shiftDist;
00333         AIBoolean shiftAngle;
00334         AIBoolean scale;
00335         AIBoolean rotate;
00336         AIBoolean reflect;
00337         AIBoolean reflectAngle;
00338         AIBoolean shearAngle;
00339         AIBoolean shearAxis;
00340         AIBoolean transform;
00341     void Init()
00342     {
00343         pattern = false;
00344         shiftDist = false;
00345         shiftAngle = false;
00346         scale = false;
00347         rotate = false;
00348         reflect = false;
00349         reflectAngle = false;
00350         shearAngle = false;
00351         shearAxis = false;
00352         transform = false;
00353     }
00354 } AIPatternStyleMap;
00355 
00357 typedef void *AIGradientHandle;
00358 
00369 typedef struct {
00373         AIGradientHandle gradient;
00377         AIRealPoint gradientOrigin;
00382         AIReal gradientAngle;
00386         AIReal gradientLength;
00392         AIRealMatrix matrix;
00395         AIReal hiliteAngle;
00399         AIReal hiliteLength;
00400         void Init()
00401         {
00402                 gradient = NULL;
00403                 gradientOrigin.h = kAIRealZero;
00404                 gradientOrigin.v = kAIRealZero;
00405                 gradientAngle = kAIRealZero;
00406                 gradientLength = kAIRealZero;
00407                 matrix.Init();
00408                 hiliteAngle = kAIRealZero;
00409                 hiliteLength = kAIRealZero;
00410         }
00411 } AIGradientStyle;
00412 
00414 typedef struct {
00415         AIBoolean gradient;
00416         AIBoolean gradientOrigin;
00417         AIBoolean gradientAngle;
00418         AIBoolean gradientLength;
00419         AIBoolean matrix;
00420         AIBoolean hiliteAngle;
00421         AIBoolean hiliteLength;
00422         void Init()
00423         {
00424                 gradient = false;
00425                 gradientOrigin = false;
00426                 gradientAngle = false;
00427                 gradientLength = false;
00428                 matrix = false;
00429                 hiliteAngle = false;
00430                 hiliteLength = false;
00431         }
00432 } AIGradientStyleMap;
00433 
00434 
00436 typedef union {
00438         AIGrayColorStyle g;
00440         AIFourColorStyle f;
00442         AIThreeColorStyle rgb;
00444         AICustomColorStyle c;
00446         AIPatternStyle p;
00448         AIGradientStyle b;
00449     
00450 } AIColorUnion;
00451 
00453 typedef union {
00455         AIGrayColorStyleMap g;
00457         AIFourColorStyleMap f;
00459         AIThreeColorStyleMap rgb;
00461         AICustomColorStyleMap c;
00463         AIPatternStyleMap p;
00465         AIGradientStyleMap b;
00466     
00467 } AIColorUnionMap;
00468 
00474 typedef struct {
00476         AIColorTag kind;
00479     AIColorUnion c;
00480     
00481     void Init()
00482     {
00483         kind = kNoneColor;
00484                 c = {};
00485     }
00486 } AIColor;
00487 
00491 typedef struct {
00492         AIBoolean kind;
00493         AIColorUnionMap c;
00494         void Init()
00495         {
00496                 kind = false;
00497                 c = {};
00498         }
00499 } AIColorMap;
00500 
00501 
00506 typedef struct {
00511         AIReal midPoint;
00515         AIReal rampPoint;
00518         AIColor color;
00521         AIReal opacity;
00522         void Init()
00523         {
00524                 midPoint = kAIRealZero;
00525                 rampPoint = kAIRealZero;
00526                 color.Init();
00527                 opacity = kAIRealZero;
00528         }
00529 } AIGradientStop;
00530 
00531 
00533 typedef unsigned short AIColorUsedHow;
00534 
00537 enum AIColorUsedHowValues {
00539         kAIColorNotUsed                 = 0x0000,
00541         kAIColorUsedOnStroke    = 0x0001,
00543         kAIColorUsedInFill              = 0x0002,
00544         /* The target \c #AIColor is used inside a gradient or pattern
00545                 that is used in the object, or for graphs in a
00546                 graph design or transform (which can be expressed or not
00547                 in the graph art objects.) */
00548         kAIColorUsedIndirectly  = 0x0004
00549 };
00550 
00570 typedef void (*AIAdjustColorFunc) (AIColor *color, void *userData, AIErr *result, AIBoolean *altered);
00571 
00590 typedef void (*AIAdjustColorsWithOPFunc) (AIColor *color, void *userData, AIErr *result, AIBoolean *altered,
00591                                                                                                 AIColorUsedHow usedWhere, AIBoolean *overprint );
00592 
00604 typedef AIErr (*AIAdjustPatternHandleFunc) ( AIPatternHandle oldPattern, AIPatternHandle *newPattern, void *userData );
00605 
00606 
00608 typedef unsigned short VisitAIColorFlags;
00609 
00613 enum VisitAIColorFlagValues {
00615         kVisitColorsNullFlags = 0x0000,
00619         kVisitColorsSelectedOnly = 0x0001,
00620 
00629         kVisitColorsUniversally = 0x0002,
00630 
00633         kVisitColorsDirectOnly = 0x0004,
00634 
00647         kVisitColorsSolidOnly = 0x0008,
00648 
00650         kVisitColorsFillsOnly = 0x0010,
00651 
00653         kVisitColorsStrokesOnly = 0x0020,
00654 
00658         kVisitColorsReadOnly = 0x0040,
00659 
00662         kVisitColorsInResultArt = 0x0080,
00663 
00671         kVisitGlobalObjectsOnceOnly = 0x0100,
00672 
00677         kVisitColorsForModalPreview = 0x0200,
00678 
00687         kVisitColorsForceAnonymous = 0x0400,
00688 
00690         kVisitColorsIncludeRegistration = 0x0800
00691 };
00692 
00693 
00694 /*******************************************************************************
00695  **
00696  ** Constants
00697  **
00698  *******************************************************************************/
00699 
00700 #define kAIColorSuite                           "AI Color Suite"
00701 #define kAIColorSuiteVersion1       AIAPI_VERSION(1)
00702 #define kAIColorSuiteVersion        kAIColorSuiteVersion1
00703 
00704 /*******************************************************************************
00705  **
00706  **     Suite
00707  **
00708  ********************************************************************************/
00715 struct AIColorSuite {
00716     
00722     AIAPI AIBoolean(*IsEqual) (const AIColor& color1, const AIColor &color2);
00723     
00724 };
00725 
00726 #include "AIHeaderEnd.h"
00727 
00728 #endif


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks