ea85c22b51829acc61f259d7179d0256d2d7a8da
[mono.git] / mcs / class / System.Drawing / System.Drawing / impl / cairo / Image.cs
1 //
2 // System.Drawing.Image.cs
3 //
4 // (C) 2002/3 Ximian, Inc.  http://www.ximian.com
5 // Authors:
6 //   Christian Meyer <Christian.Meyer@cs.tum.edu>
7 //   Jason Perkins <jason@379.com>
8 //   Dennis Hayes <dennish@raytek.com>
9 //   Alexandre Pigolkine <pigolkine@gmx.de>
10
11 using System;
12 using System.Runtime.Remoting;
13 using System.Runtime.Serialization;
14 using System.Drawing.Imaging;
15 using System.IO;
16 using System.Runtime.InteropServices;
17
18 namespace System.Drawing.Cairo {
19         //[Serializable]
20         //[ComVisible(true)]
21
22         internal abstract class Image : MarshalByRefObject, IImage /*, ICloneable, ISerializable */
23         {
24
25                 internal IntPtr state;
26                 internal Cairo.Format cairo_format;
27                 internal System.Drawing.Cairo.Graphics selected_into_graphics = null;
28                 internal Size size;
29                 internal PixelFormat pixelFormat;
30                 protected ImageFormat imageFormat;
31                         
32                 // constructor
33                 public Image () {}
34
35                 [MonoTODO]
36                 public virtual object Clone()
37                 {
38                         throw new NotImplementedException ();
39                 }
40     
41                 // public methods
42                 // static
43                 public static Image FromFile (string filename)
44                 {
45                         // Fixme: implement me
46                         throw new NotImplementedException ();
47                 }
48         
49                 public static Image FromFile (string filename, bool useEmbeddedColorManagement)
50                 {
51                                 
52                         // Fixme: implement me
53                         throw new NotImplementedException ();
54                 }
55         
56                 public static Bitmap FromHbitmap (IntPtr hbitmap)
57                 {
58                         // Fixme: implement me
59                         throw new NotImplementedException ();
60                 }
61
62                 public static Bitmap FromHbitmap (IntPtr hbitmap, IntPtr hpalette)
63                 {
64                         // Fixme: implement me
65                         throw new NotImplementedException ();
66                 }
67                 
68                 [MonoTODO]
69                 public static Image FromStream (Stream stream)
70                 {
71                         throw new NotImplementedException ();
72                 }
73         
74                 [MonoTODO]
75                 public static Image FromStream (Stream stream, bool useIcm)
76                 {
77                         throw new NotImplementedException ();
78                 }
79         
80                 public static int GetPixelFormatSize (PixelFormat pixfmt)
81                 {
82                         // Fixme: implement me
83                         throw new NotImplementedException ();
84                 }
85                 
86                 public static bool IsAlphaPixelFormat (PixelFormat pixfmt)
87                 {
88                         // Fixme: implement me
89                         throw new NotImplementedException ();
90                 }
91                         
92                 public static bool IsCanonicalPixelFormat (PixelFormat pixfmt)
93                 {
94                         // Fixme: implement me
95                         throw new NotImplementedException ();
96                 }
97         
98                 public static bool IsExtendedPixelFormat (PixelFormat pixfmt)
99                 {
100                         // Fixme: implement me
101                         throw new NotImplementedException ();
102                 }
103
104                 // non-static
105                 RectangleF IImage.GetBounds (ref GraphicsUnit pageUnit)
106                 {
107                         // Fixme: implement me
108                         throw new NotImplementedException ();
109                 }
110         
111                 [MonoTODO]
112                 int IImage.GetFrameCount (FrameDimension dimension)
113                 {
114                         throw new NotImplementedException ();
115                 }
116                 
117                 [MonoTODO]
118                 PropertyItem IImage.GetPropertyItem (int propid)
119                 {
120                         throw new NotImplementedException();
121                 }
122
123                 void IImage.RemovePropertyItem (int propid)
124                 {
125                         // Fixme: implement me
126                         throw new NotImplementedException ();
127                 }
128         
129                 void IImage.RotateFlip (RotateFlipType rotateFlipType)
130                 {
131                         // Fixme: implement me
132                         throw new NotImplementedException ();
133                 }
134
135                 protected InternalImageInfo sourceImageInfo = null;
136                 unsafe InternalImageInfo IImage.ConvertToInternalImageInfo ()
137                 {
138
139                         if (sourceImageInfo == null) {
140                                 sourceImageInfo = new InternalImageInfo();
141                                 sourceImageInfo.Size = size;
142                                 sourceImageInfo.RawFormat = imageFormat;
143                                 sourceImageInfo.PixelFormat = PixelFormat.Format32bppArgb;
144                                 sourceImageInfo.Stride = Gdk.Pixbuf.GetRowstride (state);
145                                 sourceImageInfo.RawImageBytes = new byte[sourceImageInfo.Stride * size.Height];
146                                 IntPtr memptr = Gdk.Pixbuf.GetPixels (state);
147                                 Marshal.Copy( memptr, sourceImageInfo.RawImageBytes, 0, sourceImageInfo.RawImageBytes.Length);
148                                 sourceImageInfo.ChangePixelFormat (pixelFormat);
149                         }
150                         return sourceImageInfo;
151                 }
152
153                 void IImage.Save (string filename)
154                 {
155                         throw new NotImplementedException ();
156                 }
157         
158                 [MonoTODO]
159                 void IImage.Save(Stream stream, ImageFormat format)
160                 {
161                         throw new NotImplementedException ();
162                 }
163                 
164                 [MonoTODO]
165                 void IImage.Save (string filename, ImageFormat format)
166                 {
167                         throw new NotImplementedException ();
168                 }
169                 
170                 [MonoTODO]
171                 int IImage.SelectActiveFrame (FrameDimension dimension, int frameIndex)
172                 {
173                         throw new NotImplementedException();
174                 }
175         
176                 [MonoTODO]
177                 void IImage.SetPropertyItem (PropertyItem item)
178                 {
179                         throw new NotImplementedException();
180                 }
181                 // destructor
182                 ~Image() {}
183
184                 // properties
185                 int IImage.Flags {
186                         get {
187                                 throw new NotImplementedException ();
188                         }
189                 }
190         
191                 Guid [] IImage.FrameDimensionsList {
192                         get {
193                                 throw new NotImplementedException ();
194                         }
195                 }
196         
197                 int IImage.Height {
198                         get {
199                                 return size.Height;
200                         }
201                 }
202         
203                 float IImage.HorizontalResolution {
204                         get {
205                                 throw new NotImplementedException ();
206                         }
207                 }
208         
209                 ColorPalette IImage.Palette {
210                         get {
211                                 throw new NotImplementedException ();
212                         }
213                         set {
214                                 throw new NotImplementedException ();
215                         }
216                 }
217         
218                 SizeF IImage.PhysicalDimension {
219                         get {
220                                 throw new NotImplementedException ();
221                         }
222                 }
223         
224                 PixelFormat IImage.PixelFormat {
225                         get {
226                                 return pixelFormat;
227                         }
228                 }
229         
230                 int [] IImage.PropertyIdList {
231                         get {
232                                 throw new NotImplementedException ();
233                         }
234                 }
235         
236                 [MonoTODO]
237                 PropertyItem [] IImage.PropertyItems {
238                         get {
239                                 throw new NotImplementedException();
240                         }
241                 }
242
243                 [MonoTODO]
244                 ImageFormat IImage.RawFormat {
245                         get {
246                                 return imageFormat;
247                         }
248                 }
249
250                 Size IImage.Size {
251                         get {
252                                 return size;
253                         }
254                 }
255         
256                 float IImage.VerticalResolution {
257                         get {
258                                 throw new NotImplementedException ();
259                         }
260                 }
261         
262                 int IImage.Width {
263                         get {
264                                 return size.Width;
265                         }
266                 }
267
268                 [MonoTODO]
269                 public void Dispose ()
270                 {
271                 }
272
273                 [MonoTODO]
274                 protected virtual void Dispose (bool disposing)
275                 {
276                         throw new NotImplementedException();
277                 }
278         }
279 }