Support for bitmap image formats

Martin Schulze joey at infodrom.org
Mon Nov 15 18:57:31 CET 2004


Martin Schulze wrote:
> is there a reason the render engine is limited to support only JPEG
> and BMP?  The wxWidgets library seems to support more image formats,
> such as commonly used TIFF, PNG, GIF, or less commonly used PNM, PCX,
> XBM and XPM, just to name some.
> 
> I've just tested whether the engine can handle PNG, TIFF and GIF,
> which worked fine.  I know that's not a proof, but only a
> circumstantial evidence.

Here's further research:

  <http://www.wxwindows.org/feature2.htm> -- wxWidgets 2 Features
  
  XPM is implemented on Unix and Windows; and PNG is implemented on both.
  
  The wxImage class can load JPEG, TIFF, PCX, GIF, PNM and BMP files and
  can also rotate and scale images. wxImage is a platform-independent
  class with emphasis on loading multiple image formats, whereas
  wxBitmap wraps the appropriate platform-dependent bitmap.
  
Hence, it should be fine to enable PNG, TIFF and GIF since they
are supported on both Unix and Windows.

> Attached is a patch that would add these formats.

Regards,

	Joey

-- 
Open source is important from a technical angle.             -- Linus Torvalds
-------------- next part --------------
Index: renderer.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/renderer.py,v
retrieving revision 1.49
diff -u -r1.49 renderer.py
--- Thuban/UI/renderer.py	11 Nov 2003 18:16:42 -0000	1.49
+++ Thuban/UI/renderer.py	10 Apr 2004 17:15:23 -0000
@@ -20,7 +20,8 @@
 from wxPython.wx import wxPoint, wxRect, wxPen, wxBrush, wxFont, \
     wxTRANSPARENT_PEN, wxTRANSPARENT_BRUSH, \
     wxBLACK_PEN, wxBLACK, wxSOLID, wxCROSS_HATCH, wxSWISS, wxNORMAL, \
-    wxBitmapFromImage, wxImageFromStream, wxBITMAP_TYPE_BMP, wxBITMAP_TYPE_JPEG
+    wxBitmapFromImage, wxImageFromStream, wxBITMAP_TYPE_BMP, \
+    wxBITMAP_TYPE_JPEG, wxBITMAP_TYPE_PNG, wxBITMAP_TYPE_TIF, wxBITMAP_TYPE_GIF
 
 from wxproj import draw_polygon_shape, draw_polygon_init
 
@@ -42,6 +43,9 @@
 raster_format_map = {
     "BMP": wxBITMAP_TYPE_BMP,
     "JPEG": wxBITMAP_TYPE_JPEG,
+    "PNG": wxBITMAP_TYPE_PNG,
+    "TIFF": wxBITMAP_TYPE_TIF,
+    "GIF": wxBITMAP_TYPE_GIF,
     }
 
 class MapRenderer(BaseRenderer):


More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)