root/dwt/internal/gdip/Gdip.d

Revision 264:a63e2cd5485e, 80.3 kB (checked in by Frank Benoit <benoit@tionex.de>, 6 months ago)

Removed version=TANGOSVN for release 0.99.7

Line 
1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *    IBM Corporation - initial API and implementation
10  * Port to the D programming language:
11  *    John Reimer <terminal.node@gmail.com>
12  *    Frank Benoit <benoit@tionex.de>
13  *******************************************************************************/
14
15 module dwt.internal.gdip.Gdip;
16
17 import dwt.internal.gdip.native;
18
19 import dwt.internal.Library;
20 import dwt.internal.Platform;
21 import dwt.internal.win32.WINTYPES;
22 import dwt.internal.win32.WINAPI;
23 import dwt.internal.win32.OS;
24 version(TANGOSVN){
25 import tango.sys.win32.UserGdi;
26 }
27
28 import tango.util.log.Trace;
29 void trace(int line ){
30     //Trace.formatln( "Gdip {}", line );
31 }
32
33 alias dwt.internal.gdip.native.GdiplusStartupInput  GdiplusStartupInput;
34 alias dwt.internal.gdip.native.GdiplusStartupOutput GdiplusStartupOutput;
35
36 /******************************************************************************
37
38     Gdip Class: provides access to the Gdi+ interface
39
40 /*****************************************************************************/
41
42 public class Gdip : Platform
43 {
44     static this(){
45         if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (5, 1)) {
46             loadLib_Gdip();
47         }
48     }
49     /**************************************************************************
50
51     **************************************************************************/
52
53 private:
54
55     static FontFamily GenericSansSerifFontFamily = null;
56     static FontFamily GenericSerifFontFamily     = null;
57     static FontFamily GenericMonospaceFontFamily = null;
58
59     /**************************************************************************
60
61     **************************************************************************/
62
63     struct FontFamily_T
64     {
65         Handle  nativeFamily;
66         Status  lastResult;
67     }
68
69     struct StringFormat_T
70     {
71
72         StringFormat format;
73         Status  lastError;
74     }
75
76     static ubyte GenericTypographicStringFormatBuffer[StringFormat_T.sizeof] = 0;
77     static ubyte GenericDefaultStringFormatBuffer [StringFormat_T.sizeof] = 0;
78     static ubyte GenericSansSerifFontFamilyBuffer [FontFamily_T.sizeof] = 0;
79     static ubyte GenericSerifFontFamilyBuffer     [FontFamily_T.sizeof] = 0;
80     static ubyte GenericMonospaceFontFamilyBuffer [FontFamily_T.sizeof] = 0;
81
82     /**************************************************************************
83
84     **************************************************************************/
85
86 public:
87
88     alias GpPoint           Point;
89     alias GpPointF          PointF;
90     alias GpRect            Rect;
91     alias GpRectF           RectF;
92     alias GpBitmapData      BitmapData;
93     alias GpColorPalette    ColorPalette;
94     alias GpDrawImageAbort  DrawImageAbort;
95     alias GpColorMatrix     ColorMatrix;
96
97     alias GpFontFamily          FontFamily;
98     alias GpImage               Image;
99     alias GpBrush               Brush;
100     alias GpFont                Font;
101     alias GpFontCollection      FontCollection;
102     alias GpGraphics            Graphics;
103     alias GpGraphicsPath        GraphicsPath;
104     alias GpImageAttributes     ImageAttributes;
105     alias GpHatchBrush          HatchBrush;
106     alias GpLinearGradientBrush LinearGradientBrush;
107     alias GpMatrix              Matrix;
108     alias GpPen                 Pen;
109     alias GpRegion              Region;
110     alias GpSolidBrush          SolidBrush;
111     alias GpStringFormat        StringFormat;
112     alias GpTextureBrush        TextureBrush;
113     alias GpPath                Path;
114
115     alias Image  Bitmap;
116
117     alias  uint  ARGB;
118
119     alias dwt.internal.gdip.native.GdiplusStartupInput  GdiplusStartupInput;
120     alias dwt.internal.gdip.native.GdiplusStartupOutput GdiplusStartupOutput;
121
122     /**************************************************************************
123
124         Gdi+ Constants
125
126     **************************************************************************/
127
128     enum {
129         BrushTypeSolidColor = 0,
130         BrushTypeHatchFill = 1,
131         BrushTypeTextureFill = 2,
132         BrushTypePathGradient = 3,
133         BrushTypeLinearGradient = 4,
134         //  ColorAdjustTypeBitmap = 1,
135         ColorMatrixFlagsDefault = 0,
136         CombineModeReplace = 0,
137         CombineModeIntersect = 1,
138         CombineModeUnion = 2,
139         CombineModeXor = 3,
140         CombineModeExclude = 4,
141         CombineModeComplement = 5,
142         FillModeAlternate = 0,
143         FillModeWinding = 1,
144         DashCapFlat = 0,
145         DashCapRound = 2,
146         DashCapTriangle = 3,
147         DashStyleSolid = 0,
148         DashStyleDash = 1,
149         DashStyleDot = 2,
150         DashStyleDashDot = 3,
151         DashStyleDashDotDot = 4,
152         DashStyleCustom = 5,
153         FontStyleRegular = 0,
154         FontStyleBold = 1,
155         FontStyleItalic = 2,
156         FontStyleBoldItalic = 3,
157         FontStyleUnderline = 4,
158         FontStyleStrikeout = 8,
159         PaletteFlagsHasAlpha = 0x0001,
160         FlushIntentionFlush = 0,
161         FlushIntentionSync = 1,
162         HotkeyPrefixNone = 0,
163         HotkeyPrefixShow = 1,
164         HotkeyPrefixHide = 2,
165         LineJoinMiter = 0,
166         LineJoinBevel = 1,
167         LineJoinRound = 2,
168         LineCapFlat = 0,
169         LineCapSquare = 1,
170         LineCapRound = 2,
171         MatrixOrderPrepend = 0,
172         MatrixOrderAppend = 1,
173         QualityModeDefault = 0,
174         QualityModeLow = 1,
175         QualityModeHigh = 2,
176         InterpolationModeInvalid = -1,
177         InterpolationModeDefault = QualityModeDefault,
178         InterpolationModeLowQuality = QualityModeLow,
179         InterpolationModeHighQuality = QualityModeHigh,
180         InterpolationModeBilinear = QualityModeHigh + 1,
181         InterpolationModeBicubic = QualityModeHigh + 2,
182         InterpolationModeNearestNeighbor = QualityModeHigh + 3,
183         InterpolationModeHighQualityBilinear = QualityModeHigh + 4,
184         InterpolationModeHighQualityBicubic = QualityModeHigh + 5,
185         PathPointTypeStart = 0,
186         PathPointTypeLine = 1,
187         PathPointTypeBezier = 3,
188         PathPointTypePathTypeMask = 0x7,
189         PathPointTypePathDashMode = 0x10,
190         PathPointTypePathMarker = 0x20,
191         PathPointTypeCloseSubpath = 0x80,
192         PathPointTypeBezier3 = 3,
193         PixelFormatIndexed = 0x00010000,
194         PixelFormatGDI = 0x00020000,
195         PixelFormatAlpha = 0x00040000,
196         PixelFormatPAlpha = 0x00080000,
197         PixelFormatExtended = 0x00100000,
198         PixelFormatCanonical = 0x00200000,
199         PixelFormat1bppIndexed = (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI),
200         PixelFormat4bppIndexed = (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI),
201         PixelFormat8bppIndexed = (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI),
202         PixelFormat16bppGrayScale = (4 | (16 << 8) | PixelFormatExtended),
203         PixelFormat16bppRGB555 = (5 | (16 << 8) | PixelFormatGDI),
204         PixelFormat16bppRGB565 = (6 | (16 << 8) | PixelFormatGDI),
205         PixelFormat16bppARGB1555 = (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI),
206         PixelFormat24bppRGB = (8 | (24 << 8) | PixelFormatGDI),
207         PixelFormat32bppRGB = (9 | (32 << 8) | PixelFormatGDI),
208         PixelFormat32bppARGB = (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical),
209         PixelFormat32bppPARGB = (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI),
210         PixelFormat48bppRGB = (12 | (48 << 8) | PixelFormatExtended),
211         PixelFormat64bppARGB = (13 | (64 << 8) | PixelFormatAlpha  | PixelFormatCanonical | PixelFormatExtended),
212         PixelFormat64bppPARGB = (14 | (64 << 8) | PixelFormatAlpha  | PixelFormatPAlpha | PixelFormatExtended),
213         PixelFormatMax = 15,
214         PixelOffsetModeNone = QualityModeHigh + 1,
215         PixelOffsetModeHalf = QualityModeHigh + 2,
216         SmoothingModeInvalid = -1,
217         SmoothingModeDefault = QualityModeDefault,
218         SmoothingModeHighSpeed = QualityModeLow,
219         SmoothingModeHighQuality = QualityModeHigh,
220         SmoothingModeNone = 3,
221         SmoothingModeAntiAlias8x4 = 4,
222         SmoothingModeAntiAlias = SmoothingModeAntiAlias8x4,
223         SmoothingModeAntiAlias8x8 = 5,
224         StringFormatFlagsDirectionRightToLeft = 0x00000001,
225         StringFormatFlagsDirectionVertical = 0x00000002,
226         StringFormatFlagsNoFitBlackBox = 0x00000004,
227         StringFormatFlagsDisplayFormatControl = 0x00000020,
228         StringFormatFlagsNoFontFallback = 0x00000400,
229         StringFormatFlagsMeasureTrailingSpaces = 0x00000800,
230         StringFormatFlagsNoWrap = 0x00001000,
231         StringFormatFlagsLineLimit = 0x00002000,
232         StringFormatFlagsNoClip = 0x00004000,
233         TextRenderingHintSystemDefault = 0,
234         TextRenderingHintSingleBitPerPixelGridFit = 1,
235         TextRenderingHintSingleBitPerPixel = 2,
236         TextRenderingHintAntiAliasGridFit = 3,
237         TextRenderingHintAntiAlias = 4,
238         TextRenderingHintClearTypeGridFit = 5,
239         //  UnitPixel = 2,
240         WrapModeTile = 0,
241         WrapModeTileFlipX = 1,
242         WrapModeTileFlipY = 2,
243         WrapModeTileFlipXY = 3,
244         WrapModeClamp = 4
245     }
246
247     enum
248     {
249         PenTypeSolidColor       = BrushTypeSolidColor,
250         PenTypeHatchFill        = BrushTypeHatchFill,
251         PenTypeTextureFill      = BrushTypeTextureFill,
252         PenTypePathGradient     = BrushTypePathGradient,
253         PenTypeLinearGradient   = BrushTypeLinearGradient,
254         PenTypeUnknown          = -1
255     }
256
257     enum
258     {
259         UnitWorld,      // 0 -- World coordinate (non-physical unit)
260         UnitDisplay,    // 1 -- Variable -- for PageTransform only
261         UnitPixel,      // 2 -- Each unit is one device pixel.
262         UnitPoint,      // 3 -- Each unit is a printer's point, or 1/72 inch.
263         UnitInch,       // 4 -- Each unit is 1 inch.
264         UnitDocument,   // 5 -- Each unit is 1/300 inch.
265         UnitMillimeter  // 6 -- Each unit is 1 millimeter.
266     }
267
268     enum
269     {
270         AliceBlue            = 0xFFF0F8FF,
271         AntiqueWhite         = 0xFFFAEBD7,
272         Aqua                 = 0xFF00FFFF,
273         Aquamarine           = 0xFF7FFFD4,
274         Azure                = 0xFFF0FFFF,
275         Beige                = 0xFFF5F5DC,
276         Bisque               = 0xFFFFE4C4,
277         Black                = 0xFF000000,
278         BlanchedAlmond       = 0xFFFFEBCD,
279         Blue                 = 0xFF0000FF,
280         BlueViolet           = 0xFF8A2BE2,
281         Brown                = 0xFFA52A2A,
282         BurlyWood            = 0xFFDEB887,
283         CadetBlue            = 0xFF5F9EA0,
284         Chartreuse           = 0xFF7FFF00,
285         Chocolate            = 0xFFD2691E,
286         Coral                = 0xFFFF7F50,
287         CornflowerBlue       = 0xFF6495ED,
288         Cornsilk             = 0xFFFFF8DC,
289         Crimson              = 0xFFDC143C,
290         Cyan                 = 0xFF00FFFF,
291         DarkBlue             = 0xFF00008B,
292         DarkCyan             = 0xFF008B8B,
293         DarkGoldenrod        = 0xFFB8860B,
294         DarkGray             = 0xFFA9A9A9,
295         DarkGreen            = 0xFF006400,
296         DarkKhaki            = 0xFFBDB76B,
297         DarkMagenta          = 0xFF8B008B,
298         DarkOliveGreen       = 0xFF556B2F,
299         DarkOrange           = 0xFFFF8C00,
300         DarkOrchid           = 0xFF9932CC,
301         DarkRed              = 0xFF8B0000,
302         DarkSalmon           = 0xFFE9967A,
303         DarkSeaGreen         = 0xFF8FBC8B,
304         DarkSlateBlue        = 0xFF483D8B,
305         DarkSlateGray        = 0xFF2F4F4F,
306         DarkTurquoise        = 0xFF00CED1,
307         DarkViolet           = 0xFF9400D3,
308         DeepPink             = 0xFFFF1493,
309         DeepSkyBlue          = 0xFF00BFFF,
310         DimGray              = 0xFF696969,
311         DodgerBlue           = 0xFF1E90FF,
312         Firebrick            = 0xFFB22222,
313         FloralWhite          = 0xFFFFFAF0,
314         ForestGreen          = 0xFF228B22,
315         Fuchsia              = 0xFFFF00FF,
316         Gainsboro            = 0xFFDCDCDC,
317         GhostWhite           = 0xFFF8F8FF,
318         Gold                 = 0xFFFFD700,
319         Goldenrod            = 0xFFDAA520,
320         Gray                 = 0xFF808080,
321         Green                = 0xFF008000,
322         GreenYellow          = 0xFFADFF2F,
323         Honeydew             = 0xFFF0FFF0,
324         HotPink              = 0xFFFF69B4,
325         IndianRed            = 0xFFCD5C5C,
326         Indigo               = 0xFF4B0082,
327         Ivory                = 0xFFFFFFF0,
328         Khaki                = 0xFFF0E68C,
329         Lavender             = 0xFFE6E6FA,
330         LavenderBlush        = 0xFFFFF0F5,
331         LawnGreen            = 0xFF7CFC00,
332         LemonChiffon         = 0xFFFFFACD,
333         LightBlue            = 0xFFADD8E6,
334         LightCoral           = 0xFFF08080,
335         LightCyan            = 0xFFE0FFFF,
336         LightGoldenrodYellow = 0xFFFAFAD2,
337         LightGray            = 0xFFD3D3D3,
338         LightGreen           = 0xFF90EE90,
339         LightPink            = 0xFFFFB6C1,
340         LightSalmon          = 0xFFFFA07A,
341         LightSeaGreen        = 0xFF20B2AA,
342         LightSkyBlue         = 0xFF87CEFA,
343         LightSlateGray       = 0xFF778899,
344         LightSteelBlue       = 0xFFB0C4DE,
345         LightYellow          = 0xFFFFFFE0,
346         Lime                 = 0xFF00FF00,
347         LimeGreen            = 0xFF32CD32,
348         Linen                = 0xFFFAF0E6,
349         Magenta              = 0xFFFF00FF,
350         Maroon               = 0xFF800000,
351         MediumAquamarine     = 0xFF66CDAA,
352         MediumBlue           = 0xFF0000CD,
353         MediumOrchid         = 0xFFBA55D3,
354         MediumPurple         = 0xFF9370DB,
355         MediumSeaGreen       = 0xFF3CB371,
356         MediumSlateBlue      = 0xFF7B68EE,
357         MediumSpringGreen    = 0xFF00FA9A,
358         MediumTurquoise      = 0xFF48D1CC,
359         MediumVioletRed      = 0xFFC71585,
360         MidnightBlue         = 0xFF191970,
361         MintCream            = 0xFFF5FFFA,
362         MistyRose            = 0xFFFFE4E1,
363         Moccasin             = 0xFFFFE4B5,
364         NavajoWhite          = 0xFFFFDEAD,
365         Navy                 = 0xFF000080,
366         OldLace              = 0xFFFDF5E6,
367         Olive                = 0xFF808000,
368         OliveDrab            = 0xFF6B8E23,
369         Orange               = 0xFFFFA500,
370         OrangeRed            = 0xFFFF4500,
371         Orchid               = 0xFFDA70D6,
372         PaleGoldenrod        = 0xFFEEE8AA,
373         PaleGreen            = 0xFF98FB98,
374         PaleTurquoise        = 0xFFAFEEEE,
375         PaleVioletRed        = 0xFFDB7093,
376         PapayaWhip           = 0xFFFFEFD5,
377         PeachPuff            = 0xFFFFDAB9,
378         Peru                 = 0xFFCD853F,
379         Pink                 = 0xFFFFC0CB,
380         Plum                 = 0xFFDDA0DD,
381         PowderBlue           = 0xFFB0E0E6,
382         Purple               = 0xFF800080,
383         Red                  = 0xFFFF0000,
384         RosyBrown            = 0xFFBC8F8F,
385         RoyalBlue            = 0xFF4169E1,
386         SaddleBrown          = 0xFF8B4513,
387         Salmon               = 0xFFFA8072,
388         SandyBrown           = 0xFFF4A460,
389         SeaGreen             = 0xFF2E8B57,
390         SeaShell             = 0xFFFFF5EE,
391         Sienna               = 0xFFA0522D,
392         Silver               = 0xFFC0C0C0,
393         SkyBlue              = 0xFF87CEEB,
394         SlateBlue            = 0xFF6A5ACD,
395         SlateGray            = 0xFF708090,
396         Snow                 = 0xFFFFFAFA,
397         SpringGreen          = 0xFF00FF7F,
398         SteelBlue            = 0xFF4682B4,
399         Tan                  = 0xFFD2B48C,
400         Teal                 = 0xFF008080,
401         Thistle              = 0xFFD8BFD8,
402         Tomato               = 0xFFFF6347,
403         Transparent          = 0x00FFFFFF,
404         Turquoise            = 0xFF40E0D0,
405         Violet               = 0xFFEE82EE,
406         Wheat                = 0xFFF5DEB3,
407         White                = 0xFFFFFFFF,
408         WhiteSmoke           = 0xFFF5F5F5,
409         Yellow               = 0xFFFFFF00,
410         YellowGreen          = 0xFF9ACD32
411     }
412
413     // Shift count and bit mask for A, R, G, B components
414
415     enum
416     {
417         AlphaShift  = 24,
418         RedShift    = 16,
419         GreenShift  = 8,
420         BlueShift   = 0
421     }
422
423     enum
424     {
425         AlphaMask   = 0xff000000,
426         RedMask     = 0x00ff0000,
427         GreenMask   = 0x0000ff00,
428         BlueMask    = 0x000000ff
429     }
430
431     enum
432     {
433         ColorAdjustTypeDefault,
434         ColorAdjustTypeBitmap,
435         ColorAdjustTypeBrush,
436         ColorAdjustTypePen,
437         ColorAdjustTypeText,
438         ColorAdjustTypeCount,
439         ColorAdjustTypeAny      // Reserved
440     }
441
442     static ARGB MakeARGB( ubyte a,
443                           ubyte r,
444                           ubyte g,
445                           ubyte b )
446     {
447         return ((cast(ARGB) (b) <<  Gdip.BlueShift) |
448                 (cast(ARGB) (g) <<  Gdip.GreenShift) |
449                 (cast(ARGB) (r) <<  Gdip.RedShift) |
450                 (cast(ARGB) (a) <<  Gdip.AlphaShift));
451     }
452
453 /**************************************************************************
454
455     Error Status control
456
457 **************************************************************************/
458
459     private static Status SetStatus( Status status )
460     {
461         if (status != Status.OK)
462             return ( lastResult = status );
463         else
464             return status;
465     }
466
467     private static Status lastResult;
468
469 /**************************************************************************
470
471     GDI+ Bitmap Wrap Interface
472
473 **************************************************************************/
474
475 public:
476
477     static void BitmapData_delete (BitmapData* bitmapdata)
478     {
479         delete bitmapdata;
480     }
481
482     /**************************************************************************
483
484     **************************************************************************/
485
486     static BitmapData* BitmapData_new()
487     {
488         return new BitmapData;
489     }
490
491     /**************************************************************************
492
493     **************************************************************************/
494
495     static int Bitmap_GetHBITMAP( Bitmap bitmap, ARGB colorBackground,
496                                         out HBITMAP hbmReturn                )
497     {
498         return SetStatus( GdipCreateHBITMAPFromBitmap( bitmap, hbmReturn,
499                                                        colorBackground ) );
500     }
501
502     /**************************************************************************
503
504     **************************************************************************/
505
506     static int Bitmap_GetHICON( Bitmap bitmap, out HICON hIconReturn)
507     {
508         return SetStatus( GdipCreateHICONFromBitmap( bitmap, hIconReturn ) );
509     }
510
511     /**************************************************************************
512
513     **************************************************************************/
514
515     static int Bitmap_LockBits( Bitmap bitmap, Rect* rect,
516                                       uint flags, PixelFormat pixelFormat,
517                                     BitmapData* lockedBitmapData        )
518     {
519         return SetStatus( GdipBitmapLockBits( bitmap, rect, flags,
520                                         pixelFormat, lockedBitmapData ) );
521     }
522
523     /**************************************************************************
524
525     **************************************************************************/
526
527     static int Bitmap_UnlockBits( Bitmap bitmap, BitmapData* lockedBitmapData )
528     {
529         return SetStatus( GdipBitmapUnlockBits( bitmap, lockedBitmapData ) );
530     }
531
532     /**************************************************************************
533
534     **************************************************************************/
535
536     static void Bitmap_delete( Bitmap bitmap )
537     {
538         GdipDisposeImage( bitmap );
539     }
540
541     /**************************************************************************
542
543     **************************************************************************/
544
545     static Bitmap Bitmap_new( HICON hicon )
546     {
547         Bitmap bitmap;
548         Gdip.lastResult = GdipCreateBitmapFromHICON( hicon, bitmap );
549         return bitmap;
550     }
551
552     /**************************************************************************
553
554     **************************************************************************/
555
556     static Bitmap Bitmap_new( HBITMAP hbm, HPALETTE hpal )
557     {
558         Bitmap bitmap;
559         Gdip.lastResult = GdipCreateBitmapFromHBITMAP( hbm, hpal, bitmap );
560         return bitmap;
561     }
562
563     /**************************************************************************
564
565     **************************************************************************/
566
567     static Bitmap Bitmap_new( int width, int height, int stride,
568                        PixelFormat format, ubyte* scan0  )
569     {
570         Bitmap bitmap;
571         Gdip.lastResult = GdipCreateBitmapFromScan0( width, height, stride,
572                                                     format, scan0,
573                                                     bitmap );
574         return bitmap;
575     }
576
577     /**************************************************************************
578
579     **************************************************************************/
580
581     static Bitmap Bitmap_new( wchar* filename, bool useIcm )
582     {
583         Bitmap bitmap;
584         if (useIcm) {
585             Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap );
586         } else {
587             Gdip.lastResult = GdipCreateBitmapFromFile( filename, bitmap );
588         }
589         return bitmap;
590     }
591
592
593 /**************************************************************************
594
595     Gdi+ Image Wrap Interface
596
597 **************************************************************************/
598
599     static Status Image_GetLastStatus( Image image )
600     {
601         Status lastStatus = Gdip.lastResult;
602         Gdip.lastResult = Status.OK;
603         return lastStatus;
604     }
605
606     /**************************************************************************
607
608     **************************************************************************/
609
610     static PixelFormat Image_GetPixelFormat( Image image )
611     {
612         PixelFormat format;
613         SetStatus( GdipGetImagePixelFormat( image, format<