Support for bitmap image formats
Martin Schulze
joey at infodrom.org
Sat Apr 10 19:24:07 CEST 2004
Hi,
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.
Attached is a patch that would add these formats.
Regards,
Joey
--
Life is too short to run proprietary software. -- Bdale Garbee
-------------- 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)