Adobe.com
Contents Suites Classes Class Index Member Index

AIImageOptimization.h

Go to the documentation of this file.
00001 #ifndef __AIImageOptimization__
00002 #define __AIImageOptimization__
00003 
00004 /*
00005  *      Name:   AIImageOptimization.h
00006  *      Purpose:        Adobe Illustrator Image Optimization Suite
00007  *
00008  * ADOBE SYSTEMS INCORPORATED
00009  * Copyright 1986-2007 Adobe Systems Incorporated.
00010  * All rights reserved.
00011  *
00012  * NOTICE:  Adobe permits you to use, modify, and distribute this file
00013  * in accordance with the terms of the Adobe license agreement
00014  * accompanying it. If you have received this file from a source other
00015  * than Adobe, then your use, modification, or distribution of it
00016  * requires the prior written permission of Adobe.
00017  *
00018  */
00019 
00020 /********************************************************************************
00021  **
00022  **     Imports
00023  **
00024  **/
00025 
00026 #ifndef __AITypes__
00027 #include "AITypes.h"
00028 #endif
00029 
00030 #ifndef __AIDataFilter__
00031 #include "AIDataFilter.h"
00032 #endif
00033 
00034 #ifndef __ASTypes__
00035 #include "ASTypes.h"
00036 #endif
00037 
00038 #include "AIRasterize.h"
00039 
00040 #include "AIHeaderBegin.h"
00041 
00044 /********************************************************************************
00045  **
00046  **     Constants
00047  **
00048  **/
00049 
00050 #define kAIImageOptSuite                        "AI Image Optimization Suite"
00051 #define kAIImageOptSuiteVersion7        AIAPI_VERSION(7)
00052 #define kAIImageOptSuiteVersion         kAIImageOptSuiteVersion7
00053 #define kAIImageOptVersion                      kAIImageOptSuiteVersion
00054 
00057 #define kAIImageOptErr 'IMer'
00058 
00059 /********************************************************************************
00060  **
00061  **     Types
00062  **
00063  **/
00064 
00066 struct AIImageOptGIFParams{
00068         AIBool8 interlaced;
00070         AIBool8 transparencyAvailable;
00072         ai::int32 numberOfColors;
00074         ai::int32 transparentIndex;
00076         ai::int32 loss;
00077 
00079         AIFloat resolution;
00081         AIBool8 outAlpha;
00083         ai::int32 outWidth;
00085         ai::int32 outHeight;
00086 };
00087 
00089 enum AIImageOptJPEGKind {
00091         AIImageOptJPEGStandard,
00093         AIImageOptJPEGOptimized,
00095         AIImageOptJPEGProgressive
00096 };
00097 
00099 struct AIImageOptJPEGParams{
00101         ai::int32 quality;
00103         AIImageOptJPEGKind kind;
00106         ai::int32 scans;
00108         AIFloat blurAmount;
00109 
00111         AIFloat resolution;
00113         AIBool8 outAlpha;
00115         ai::int32 outWidth;
00117         ai::int32 outHeight;
00118 };
00119 
00122 struct AIImageOptPNGParams {
00124         AIBool8 interlaced;
00126         ai::int32 numberOfColors;
00128         ai::int32 transparentIndex;
00129 
00131         AIFloat resolution;
00133         AIBool8 outAlpha;
00135         ai::int32 outWidth;
00137         ai::int32 outHeight;
00138 };
00139 
00141 enum AIImageOptZLIBLevel {
00143         AIImageOptZLIBDefault = -1,
00145         AIImageOptZLIBNone = 0,
00147         AIImageOptZLIBFast = 1,
00149         AIImageOptZLIBSmall = 9
00150 };
00151 
00153 struct AIImageOptZLIBParams{
00155         AIImageOptZLIBLevel level;
00157         AIFloat resolution;
00159         AIBool8 outAlpha;
00161         ai::int32 outWidth;
00163         ai::int32 outHeight;
00164 };
00165 
00166 /*
00167  *      AIImageOptSuiteVersion2 Types
00168  */
00169 
00172 struct AIImageOptPNGParams2 {
00174         AIImageOptPNGParams versionOneSuiteParams;
00179         ASInt32 antialias;
00181         AIRealRect cropBox;
00184         AIBool8 backgroundIsTransparent;
00187         AIRGBColor matteColor;
00188 
00189 #ifdef __cplusplus
00190 
00191         AIImageOptPNGParams2()
00192                 :
00193                         versionOneSuiteParams(),
00194                         antialias(0),   // no text antialiasing
00195                         cropBox(),
00196                         backgroundIsTransparent(true),  // no matte color applied
00197                         matteColor()
00198         {
00199                 cropBox.top = 0.0; cropBox.left = 0.0; cropBox.bottom = 0.0; cropBox.right = 0.0;
00200                 matteColor.red = 0; matteColor.green = 0; matteColor.blue = 0;
00201         };
00202 #endif
00203 };
00204 
00205 
00206 
00207 
00208 /* Version 3 additions */
00209 
00210 
00212 typedef struct _t_AIColorPalette *AIColorPaletteHandle;
00213 
00215 typedef struct _t_AIInverseColorPalette *AIInverseColorPaletteHandle;
00216 
00217 
00219 typedef short AIPaletteType;
00221 enum AIPaletteTypeValue
00222 {
00224         kAIAutomaticPalette,
00225 
00227         kAICustomPalette
00228 };
00229 
00230 
00235 typedef struct AIPaletteOptions
00236 {
00238         AIPaletteType paletteType;
00239 
00243         ai::int32 colorCount;
00244 
00245 } AIPaletteOptions;
00246 
00247 
00249 struct AIPaletteColor
00250 {
00252     unsigned char alpha;
00254     unsigned char r;
00256     unsigned char g;
00258     unsigned char b;
00259 };
00260 
00261 /********************************************************************************
00262  **
00263  **     Suite
00264  **
00265  **/
00266 
00275 typedef struct {
00276 
00277         // AIImageOptSuiteVersion1 functions
00283         AIAPI AIErr (*AsGIF)(
00284                 AIArtHandle aiArt,
00285                 AIDataFilter* aiDataFilter,
00286                 AIImageOptGIFParams& params);
00287 
00293         AIAPI AIErr (*AsJPEG)(
00294                 AIArtHandle aiArt,
00295                 AIDataFilter* aiDataFilter,
00296                 AIImageOptJPEGParams& params);
00297 
00303         AIAPI AIErr (*AsPNG)(                           // as PNG24
00304                 AIArtHandle aiArt,
00305                 AIDataFilter* aiDataFilter,
00306                 AIImageOptPNGParams& params);
00307 
00313         AIAPI AIErr (*AsZLIB)(
00314                 AIArtHandle aiArt,
00315                 AIDataFilter* aiDataFilter,
00316                 AIImageOptZLIBParams& params);
00317 
00318         // AIImageOptSuiteVersion2 functions
00319 
00329         AIAPI AIErr (*MakePNG24)(
00330                 AIArtHandle aiArt,
00331                 AIDataFilter* aiDataFilter,
00332                 AIImageOptPNGParams2& params,
00333                 AIRasterizeProgressProc progressProc);
00334 
00335 
00336         // AIImageOptSuiteVersion3 functions
00337 
00343         AIAPI AIErr (*CreatePalette) (AIArtHandle raster, const AIPaletteOptions *options, AIColorPaletteHandle *palette);
00344 
00350         AIAPI AIErr (*DisposePalette) (AIColorPaletteHandle palette);
00351 
00357         AIAPI AIErr (*GetPaletteColor) (AIColorPaletteHandle palette, ai::int32 index, AIPaletteColor *color);
00358 
00364         AIAPI AIErr (*SetPaletteColor) (AIColorPaletteHandle palette, ai::int32 index, AIPaletteColor *color);
00365 
00370         AIAPI AIErr (*CreateInversePalette) (AIColorPaletteHandle palette, AIInverseColorPaletteHandle *inverse);
00371 
00377         AIAPI AIErr (*DisposeInversePalette) (AIInverseColorPaletteHandle inverse);
00378 
00385         AIAPI AIErr (*GetPaletteIndex) (AIInverseColorPaletteHandle inverse, const AIPaletteColor *color, ai::int32 *index);
00386 
00393         AIAPI AIErr (*CreateReducedPalette) ( AIPaletteColor *colorList, int colorListCount, int reduceColorCount, AIColorPaletteHandle *palette  );
00394 }
00395 AIImageOptSuite;
00396 
00397 
00398 #include "AIHeaderEnd.h"
00399 
00400 #endif  // __AIImageOptimization__


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