wx/imagpcx.h \
wx/imagpng.h \
wx/imagpnm.h \
+ wx/imagtga.h \
wx/imagtiff.h \
wx/imagxpm.h \
wx/listbase.h \
monodll_imagpcx.o \
monodll_imagpng.o \
monodll_imagpnm.o \
+ monodll_imagtga.o \
monodll_imagtiff.o \
monodll_imagxpm.o \
monodll_layout.o \
monodll_imagpcx.o \
monodll_imagpng.o \
monodll_imagpnm.o \
+ monodll_imagtga.o \
monodll_imagtiff.o \
monodll_imagxpm.o \
monodll_layout.o \
monolib_imagpcx.o \
monolib_imagpng.o \
monolib_imagpnm.o \
+ monolib_imagtga.o \
monolib_imagtiff.o \
monolib_imagxpm.o \
monolib_layout.o \
monolib_imagpcx.o \
monolib_imagpng.o \
monolib_imagpnm.o \
+ monolib_imagtga.o \
monolib_imagtiff.o \
monolib_imagxpm.o \
monolib_layout.o \
coredll_imagpcx.o \
coredll_imagpng.o \
coredll_imagpnm.o \
+ coredll_imagtga.o \
coredll_imagtiff.o \
coredll_imagxpm.o \
coredll_layout.o \
coredll_imagpcx.o \
coredll_imagpng.o \
coredll_imagpnm.o \
+ coredll_imagtga.o \
coredll_imagtiff.o \
coredll_imagxpm.o \
coredll_layout.o \
corelib_imagpcx.o \
corelib_imagpng.o \
corelib_imagpnm.o \
+ corelib_imagtga.o \
corelib_imagtiff.o \
corelib_imagxpm.o \
corelib_layout.o \
corelib_imagpcx.o \
corelib_imagpng.o \
corelib_imagpnm.o \
+ corelib_imagtga.o \
corelib_imagtiff.o \
corelib_imagxpm.o \
corelib_layout.o \
@COND_USE_GUI_1@monodll_imagpnm.o: $(srcdir)/src/common/imagpnm.cpp $(MONODLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/imagpnm.cpp
+@COND_USE_GUI_1@monodll_imagtga.o: $(srcdir)/src/common/imagtga.cpp $(MONODLL_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/imagtga.cpp
+
@COND_USE_GUI_1@monodll_imagtiff.o: $(srcdir)/src/common/imagtiff.cpp $(MONODLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/imagtiff.cpp
@COND_USE_GUI_1@monolib_imagpnm.o: $(srcdir)/src/common/imagpnm.cpp $(MONOLIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/imagpnm.cpp
+@COND_USE_GUI_1@monolib_imagtga.o: $(srcdir)/src/common/imagtga.cpp $(MONOLIB_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/imagtga.cpp
+
@COND_USE_GUI_1@monolib_imagtiff.o: $(srcdir)/src/common/imagtiff.cpp $(MONOLIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/imagtiff.cpp
@COND_USE_GUI_1@coredll_imagpnm.o: $(srcdir)/src/common/imagpnm.cpp $(COREDLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/imagpnm.cpp
+@COND_USE_GUI_1@coredll_imagtga.o: $(srcdir)/src/common/imagtga.cpp $(COREDLL_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/imagtga.cpp
+
@COND_USE_GUI_1@coredll_imagtiff.o: $(srcdir)/src/common/imagtiff.cpp $(COREDLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/imagtiff.cpp
@COND_USE_GUI_1@corelib_imagpnm.o: $(srcdir)/src/common/imagpnm.cpp $(CORELIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/imagpnm.cpp
+@COND_USE_GUI_1@corelib_imagtga.o: $(srcdir)/src/common/imagtga.cpp $(CORELIB_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/imagtga.cpp
+
@COND_USE_GUI_1@corelib_imagtiff.o: $(srcdir)/src/common/imagtiff.cpp $(CORELIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/imagtiff.cpp
src/common/imagpcx.cpp
src/common/imagpng.cpp
src/common/imagpnm.cpp
+ src/common/imagtga.cpp
src/common/imagtiff.cpp
src/common/imagxpm.cpp
src/common/layout.cpp
wx/imagpcx.h
wx/imagpng.h
wx/imagpnm.h
+ wx/imagtga.h
wx/imagtiff.h
wx/imagxpm.h
wx/listbase.h
$(OBJS)\monodll_imagpcx.obj \
$(OBJS)\monodll_imagpng.obj \
$(OBJS)\monodll_imagpnm.obj \
+ $(OBJS)\monodll_imagtga.obj \
$(OBJS)\monodll_imagtiff.obj \
$(OBJS)\monodll_imagxpm.obj \
$(OBJS)\monodll_layout.obj \
$(OBJS)\monodll_imagpcx.obj \
$(OBJS)\monodll_imagpng.obj \
$(OBJS)\monodll_imagpnm.obj \
+ $(OBJS)\monodll_imagtga.obj \
$(OBJS)\monodll_imagtiff.obj \
$(OBJS)\monodll_imagxpm.obj \
$(OBJS)\monodll_layout.obj \
$(OBJS)\monolib_imagpcx.obj \
$(OBJS)\monolib_imagpng.obj \
$(OBJS)\monolib_imagpnm.obj \
+ $(OBJS)\monolib_imagtga.obj \
$(OBJS)\monolib_imagtiff.obj \
$(OBJS)\monolib_imagxpm.obj \
$(OBJS)\monolib_layout.obj \
$(OBJS)\monolib_imagpcx.obj \
$(OBJS)\monolib_imagpng.obj \
$(OBJS)\monolib_imagpnm.obj \
+ $(OBJS)\monolib_imagtga.obj \
$(OBJS)\monolib_imagtiff.obj \
$(OBJS)\monolib_imagxpm.obj \
$(OBJS)\monolib_layout.obj \
$(OBJS)\coredll_imagpcx.obj \
$(OBJS)\coredll_imagpng.obj \
$(OBJS)\coredll_imagpnm.obj \
+ $(OBJS)\coredll_imagtga.obj \
$(OBJS)\coredll_imagtiff.obj \
$(OBJS)\coredll_imagxpm.obj \
$(OBJS)\coredll_layout.obj \
$(OBJS)\coredll_imagpcx.obj \
$(OBJS)\coredll_imagpng.obj \
$(OBJS)\coredll_imagpnm.obj \
+ $(OBJS)\coredll_imagtga.obj \
$(OBJS)\coredll_imagtiff.obj \
$(OBJS)\coredll_imagxpm.obj \
$(OBJS)\coredll_layout.obj \
$(OBJS)\corelib_imagpcx.obj \
$(OBJS)\corelib_imagpng.obj \
$(OBJS)\corelib_imagpnm.obj \
+ $(OBJS)\corelib_imagtga.obj \
$(OBJS)\corelib_imagtiff.obj \
$(OBJS)\corelib_imagxpm.obj \
$(OBJS)\corelib_layout.obj \
$(OBJS)\corelib_imagpcx.obj \
$(OBJS)\corelib_imagpng.obj \
$(OBJS)\corelib_imagpnm.obj \
+ $(OBJS)\corelib_imagtga.obj \
$(OBJS)\corelib_imagtiff.obj \
$(OBJS)\corelib_imagxpm.obj \
$(OBJS)\corelib_layout.obj \
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monodll_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monodll_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monolib_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monolib_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\coredll_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\coredll_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\corelib_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\corelib_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
$(OBJS)\monodll_imagpcx.o \
$(OBJS)\monodll_imagpng.o \
$(OBJS)\monodll_imagpnm.o \
+ $(OBJS)\monodll_imagtga.o \
$(OBJS)\monodll_imagtiff.o \
$(OBJS)\monodll_imagxpm.o \
$(OBJS)\monodll_layout.o \
$(OBJS)\monodll_imagpcx.o \
$(OBJS)\monodll_imagpng.o \
$(OBJS)\monodll_imagpnm.o \
+ $(OBJS)\monodll_imagtga.o \
$(OBJS)\monodll_imagtiff.o \
$(OBJS)\monodll_imagxpm.o \
$(OBJS)\monodll_layout.o \
$(OBJS)\monolib_imagpcx.o \
$(OBJS)\monolib_imagpng.o \
$(OBJS)\monolib_imagpnm.o \
+ $(OBJS)\monolib_imagtga.o \
$(OBJS)\monolib_imagtiff.o \
$(OBJS)\monolib_imagxpm.o \
$(OBJS)\monolib_layout.o \
$(OBJS)\monolib_imagpcx.o \
$(OBJS)\monolib_imagpng.o \
$(OBJS)\monolib_imagpnm.o \
+ $(OBJS)\monolib_imagtga.o \
$(OBJS)\monolib_imagtiff.o \
$(OBJS)\monolib_imagxpm.o \
$(OBJS)\monolib_layout.o \
$(OBJS)\coredll_imagpcx.o \
$(OBJS)\coredll_imagpng.o \
$(OBJS)\coredll_imagpnm.o \
+ $(OBJS)\coredll_imagtga.o \
$(OBJS)\coredll_imagtiff.o \
$(OBJS)\coredll_imagxpm.o \
$(OBJS)\coredll_layout.o \
$(OBJS)\coredll_imagpcx.o \
$(OBJS)\coredll_imagpng.o \
$(OBJS)\coredll_imagpnm.o \
+ $(OBJS)\coredll_imagtga.o \
$(OBJS)\coredll_imagtiff.o \
$(OBJS)\coredll_imagxpm.o \
$(OBJS)\coredll_layout.o \
$(OBJS)\corelib_imagpcx.o \
$(OBJS)\corelib_imagpng.o \
$(OBJS)\corelib_imagpnm.o \
+ $(OBJS)\corelib_imagtga.o \
$(OBJS)\corelib_imagtiff.o \
$(OBJS)\corelib_imagxpm.o \
$(OBJS)\corelib_layout.o \
$(OBJS)\corelib_imagpcx.o \
$(OBJS)\corelib_imagpng.o \
$(OBJS)\corelib_imagpnm.o \
+ $(OBJS)\corelib_imagtga.o \
$(OBJS)\corelib_imagtiff.o \
$(OBJS)\corelib_imagxpm.o \
$(OBJS)\corelib_layout.o \
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\monodll_imagtga.o: ../../src/common/imagtga.cpp
+ $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\monodll_imagtiff.o: ../../src/common/imagtiff.cpp
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\monolib_imagtga.o: ../../src/common/imagtga.cpp
+ $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\monolib_imagtiff.o: ../../src/common/imagtiff.cpp
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\coredll_imagtga.o: ../../src/common/imagtga.cpp
+ $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\coredll_imagtiff.o: ../../src/common/imagtiff.cpp
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\corelib_imagtga.o: ../../src/common/imagtga.cpp
+ $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\corelib_imagtiff.o: ../../src/common/imagtiff.cpp
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\monodll_imagpcx.obj \
$(OBJS)\monodll_imagpng.obj \
$(OBJS)\monodll_imagpnm.obj \
+ $(OBJS)\monodll_imagtga.obj \
$(OBJS)\monodll_imagtiff.obj \
$(OBJS)\monodll_imagxpm.obj \
$(OBJS)\monodll_layout.obj \
$(OBJS)\monodll_imagpcx.obj \
$(OBJS)\monodll_imagpng.obj \
$(OBJS)\monodll_imagpnm.obj \
+ $(OBJS)\monodll_imagtga.obj \
$(OBJS)\monodll_imagtiff.obj \
$(OBJS)\monodll_imagxpm.obj \
$(OBJS)\monodll_layout.obj \
$(OBJS)\monolib_imagpcx.obj \
$(OBJS)\monolib_imagpng.obj \
$(OBJS)\monolib_imagpnm.obj \
+ $(OBJS)\monolib_imagtga.obj \
$(OBJS)\monolib_imagtiff.obj \
$(OBJS)\monolib_imagxpm.obj \
$(OBJS)\monolib_layout.obj \
$(OBJS)\monolib_imagpcx.obj \
$(OBJS)\monolib_imagpng.obj \
$(OBJS)\monolib_imagpnm.obj \
+ $(OBJS)\monolib_imagtga.obj \
$(OBJS)\monolib_imagtiff.obj \
$(OBJS)\monolib_imagxpm.obj \
$(OBJS)\monolib_layout.obj \
$(OBJS)\coredll_imagpcx.obj \
$(OBJS)\coredll_imagpng.obj \
$(OBJS)\coredll_imagpnm.obj \
+ $(OBJS)\coredll_imagtga.obj \
$(OBJS)\coredll_imagtiff.obj \
$(OBJS)\coredll_imagxpm.obj \
$(OBJS)\coredll_layout.obj \
$(OBJS)\coredll_imagpcx.obj \
$(OBJS)\coredll_imagpng.obj \
$(OBJS)\coredll_imagpnm.obj \
+ $(OBJS)\coredll_imagtga.obj \
$(OBJS)\coredll_imagtiff.obj \
$(OBJS)\coredll_imagxpm.obj \
$(OBJS)\coredll_layout.obj \
$(OBJS)\corelib_imagpcx.obj \
$(OBJS)\corelib_imagpng.obj \
$(OBJS)\corelib_imagpnm.obj \
+ $(OBJS)\corelib_imagtga.obj \
$(OBJS)\corelib_imagtiff.obj \
$(OBJS)\corelib_imagxpm.obj \
$(OBJS)\corelib_layout.obj \
$(OBJS)\corelib_imagpcx.obj \
$(OBJS)\corelib_imagpng.obj \
$(OBJS)\corelib_imagpnm.obj \
+ $(OBJS)\corelib_imagtga.obj \
$(OBJS)\corelib_imagtiff.obj \
$(OBJS)\corelib_imagxpm.obj \
$(OBJS)\corelib_layout.obj \
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monodll_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monodll_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monolib_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monolib_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\coredll_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\coredll_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\corelib_imagtga.obj: ..\..\src\common\imagtga.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\corelib_imagtiff.obj: ..\..\src\common\imagtiff.cpp
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
$(OBJS)\monodll_imagpcx.obj &
$(OBJS)\monodll_imagpng.obj &
$(OBJS)\monodll_imagpnm.obj &
+ $(OBJS)\monodll_imagtga.obj &
$(OBJS)\monodll_imagtiff.obj &
$(OBJS)\monodll_imagxpm.obj &
$(OBJS)\monodll_layout.obj &
$(OBJS)\monodll_imagpcx.obj &
$(OBJS)\monodll_imagpng.obj &
$(OBJS)\monodll_imagpnm.obj &
+ $(OBJS)\monodll_imagtga.obj &
$(OBJS)\monodll_imagtiff.obj &
$(OBJS)\monodll_imagxpm.obj &
$(OBJS)\monodll_layout.obj &
$(OBJS)\monolib_imagpcx.obj &
$(OBJS)\monolib_imagpng.obj &
$(OBJS)\monolib_imagpnm.obj &
+ $(OBJS)\monolib_imagtga.obj &
$(OBJS)\monolib_imagtiff.obj &
$(OBJS)\monolib_imagxpm.obj &
$(OBJS)\monolib_layout.obj &
$(OBJS)\monolib_imagpcx.obj &
$(OBJS)\monolib_imagpng.obj &
$(OBJS)\monolib_imagpnm.obj &
+ $(OBJS)\monolib_imagtga.obj &
$(OBJS)\monolib_imagtiff.obj &
$(OBJS)\monolib_imagxpm.obj &
$(OBJS)\monolib_layout.obj &
$(OBJS)\coredll_imagpcx.obj &
$(OBJS)\coredll_imagpng.obj &
$(OBJS)\coredll_imagpnm.obj &
+ $(OBJS)\coredll_imagtga.obj &
$(OBJS)\coredll_imagtiff.obj &
$(OBJS)\coredll_imagxpm.obj &
$(OBJS)\coredll_layout.obj &
$(OBJS)\coredll_imagpcx.obj &
$(OBJS)\coredll_imagpng.obj &
$(OBJS)\coredll_imagpnm.obj &
+ $(OBJS)\coredll_imagtga.obj &
$(OBJS)\coredll_imagtiff.obj &
$(OBJS)\coredll_imagxpm.obj &
$(OBJS)\coredll_layout.obj &
$(OBJS)\corelib_imagpcx.obj &
$(OBJS)\corelib_imagpng.obj &
$(OBJS)\corelib_imagpnm.obj &
+ $(OBJS)\corelib_imagtga.obj &
$(OBJS)\corelib_imagtiff.obj &
$(OBJS)\corelib_imagxpm.obj &
$(OBJS)\corelib_layout.obj &
$(OBJS)\corelib_imagpcx.obj &
$(OBJS)\corelib_imagpng.obj &
$(OBJS)\corelib_imagpnm.obj &
+ $(OBJS)\corelib_imagtga.obj &
$(OBJS)\corelib_imagtiff.obj &
$(OBJS)\corelib_imagxpm.obj &
$(OBJS)\corelib_layout.obj &
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\monodll_imagtga.obj : .AUTODEPEND ..\..\src\common\imagtga.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\monodll_imagtiff.obj : .AUTODEPEND ..\..\src\common\imagtiff.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\monolib_imagtga.obj : .AUTODEPEND ..\..\src\common\imagtga.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\monolib_imagtiff.obj : .AUTODEPEND ..\..\src\common\imagtiff.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\coredll_imagtga.obj : .AUTODEPEND ..\..\src\common\imagtga.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\coredll_imagtiff.obj : .AUTODEPEND ..\..\src\common\imagtiff.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\corelib_imagtga.obj : .AUTODEPEND ..\..\src\common\imagtga.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\corelib_imagtiff.obj : .AUTODEPEND ..\..\src\common\imagtiff.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
# End Source File
# Begin Source File
+SOURCE=..\..\src\common\imagtga.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\..\src\common\imagtiff.cpp
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\include\wx\imagtga.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\wx\imagtiff.h
# End Source File
# Begin Source File
- Many enhancements to wxRichTextCtrl including URL support,
formatting and symbol dialogs, print/preview, and better list
formatting.
+- Support for loading TGA files added (Seth Jackson)
Unix Ports:
The following image handlers are available. {\bf wxBMPHandler} is always
installed by default. To use other image formats, install the appropriate
-handler with \helpref{wxImage::AddHandler}{wximageaddhandler} or
+handler with \helpref{wxImage::AddHandler}{wximageaddhandler} or call
\helpref{wxInitAllImageHandlers}{wxinitallimagehandlers}.
\twocolwidtha{5cm}%
\twocolitem{\indexit{wxPCXHandler}}{For loading and saving (see below).}
\twocolitem{\indexit{wxPNMHandler}}{For loading and saving (see below).}
\twocolitem{\indexit{wxTIFFHandler}}{For loading and saving.}
+\twocolitem{\indexit{wxTGAHandler}}{For loading only.}
\twocolitem{\indexit{wxIFFHandler}}{For loading only.}
\twocolitem{\indexit{wxXPMHandler}}{For loading and saving.}
\twocolitem{\indexit{wxICOHandler}}{For loading and saving.}
\twocolitem{\indexit{wxBITMAP\_TYPE\_PCX}}{Load a PCX bitmap file.}
\twocolitem{\indexit{wxBITMAP\_TYPE\_PNM}}{Load a PNM bitmap file.}
\twocolitem{\indexit{wxBITMAP\_TYPE\_TIF}}{Load a TIFF bitmap file.}
+\twocolitem{\indexit{wxBITMAP\_TYPE\_TGA}}{Load a TGA bitmap file.}
\twocolitem{\indexit{wxBITMAP\_TYPE\_XPM}}{Load a XPM bitmap file.}
\twocolitem{\indexit{wxBITMAP\_TYPE\_ICO}}{Load a Windows icon file (ICO).}
\twocolitem{\indexit{wxBITMAP\_TYPE\_CUR}}{Load a Windows cursor file (CUR).}
wxBITMAP_TYPE_ICON_RESOURCE,
wxBITMAP_TYPE_ANI,
wxBITMAP_TYPE_IFF,
+ wxBITMAP_TYPE_TGA,
wxBITMAP_TYPE_MACCURSOR,
wxBITMAP_TYPE_MACCURSOR_RESOURCE,
wxBITMAP_TYPE_ANY = 50
#include "wx/imaggif.h"
#include "wx/imagpcx.h"
#include "wx/imagjpeg.h"
+#include "wx/imagtga.h"
#include "wx/imagtiff.h"
#include "wx/imagpnm.h"
#include "wx/imagxpm.h"
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: imagtga.h
+// Purpose: wxImage TGA handler
+// Author: Seth Jackson
+// RCS-ID: $Id$
+// Copyright: (c) 2005 Seth Jackson
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_IMAGTGA_H_
+#define _WX_IMAGTGA_H_
+
+#include "wx/image.h"
+
+//-----------------------------------------------------------------------------
+// wxTGAHandler
+//-----------------------------------------------------------------------------
+
+#if wxUSE_TGA
+
+class WXDLLEXPORT wxTGAHandler : public wxImageHandler
+{
+public:
+ wxTGAHandler()
+ {
+ m_name = wxT("TGA file");
+ m_extension = wxT("tga");
+ m_type = wxBITMAP_TYPE_TGA;
+ m_mime = wxT("image/tga");
+ }
+
+#if wxUSE_STREAMS
+ virtual bool LoadFile(wxImage* image, wxInputStream& stream,
+ bool verbose = true, int index = -1);
+ virtual bool SaveFile(wxImage* image, wxOutputStream& stream,
+ bool verbose = true);
+ virtual bool DoCanRead(wxInputStream& stream);
+#endif // wxUSE_STREAMS
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxTGAHandler)
+};
+
+#endif // wxUSE_TGA
+
+#endif // _WX_IMAGTGA_H_
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
// Set to 1 for GIF format support
#define wxUSE_GIF 1
wxBitmap my_horse_pcx;
wxBitmap my_horse_pnm;
wxBitmap my_horse_tiff;
+ wxBitmap my_horse_tga;
wxBitmap my_horse_xpm;
wxBitmap my_horse_ico32;
wxBitmap my_horse_ico16;
my_horse_tiff = wxBitmap( image );
#endif
+#if wxUSE_LIBTIFF
+ image.Destroy();
+
+ if ( !image.LoadFile( dir + _T("horse.tga"), wxBITMAP_TYPE_TGA ) )
+ wxLogError(wxT("Can't load TGA image"));
+ else
+ my_horse_tga = wxBitmap( image );
+#endif
+
CreateAntiAliasedBitmap();
my_smile_xbm = wxBitmap( (const char*)smile_bits, smile_width,
if (my_horse_tiff.Ok())
dc.DrawBitmap( my_horse_tiff, 30, 1530 );
- dc.DrawText( _T("XPM handler"), 30, 1745 );
+ dc.DrawText( _T("TGA handler"), 30, 1745 );
+ if (my_horse_tga.Ok())
+ dc.DrawBitmap( my_horse_tga, 30, 1760 );
+
+ dc.DrawText( _T("XPM handler"), 30, 1975 );
if (my_horse_xpm.Ok())
- dc.DrawBitmap( my_horse_xpm, 30, 1760 );
+ dc.DrawBitmap( my_horse_xpm, 30, 2000 );
// toucans
{
if (my_smile_xbm.Ok())
{
- dc.DrawText( _T("XBM bitmap"), 30, 1975 );
- dc.DrawText( _T("(green on red)"), 30, 1990 );
+ int x = 300, y = 1800;
+
+ dc.DrawText( _T("XBM bitmap"), x, y );
+ dc.DrawText( _T("(green on red)"), x, y + 15 );
dc.SetTextForeground( _T("GREEN") );
dc.SetTextBackground( _T("RED") );
- dc.DrawBitmap( my_smile_xbm, 30, 2010 );
+ dc.DrawBitmap( my_smile_xbm, x, y + 30 );
dc.SetTextForeground( *wxBLACK );
- dc.DrawText( _T("After wxImage conversion"), 150, 1975 );
- dc.DrawText( _T("(red on white)"), 150, 1990 );
+ dc.DrawText( _T("After wxImage conversion"), x + 120, y );
+ dc.DrawText( _T("(red on white)"), x + 120, y + 15 );
dc.SetTextForeground( wxT("RED") );
wxImage i = my_smile_xbm.ConvertToImage();
i.SetMaskColour( 255, 255, 255 );
wxRED_PEN->GetColour().Red(),
wxRED_PEN->GetColour().Green(),
wxRED_PEN->GetColour().Blue() );
- dc.DrawBitmap( wxBitmap(i), 150, 2010, true );
+ dc.DrawBitmap( wxBitmap(i), x + 120, y + 30, true );
dc.SetTextForeground( *wxBLACK );
}
if (mono.Ok())
{
- dc.DrawText( _T("Mono bitmap"), 30, 2095 );
- dc.DrawText( _T("(red on green)"), 30, 2110 );
+ int x = 300, y = 1900;
+
+ dc.DrawText( _T("Mono bitmap"), x, y );
+ dc.DrawText( _T("(red on green)"), x, y + 15 );
dc.SetTextForeground( wxT("RED") );
dc.SetTextBackground( wxT("GREEN") );
- dc.DrawBitmap( mono, 30, 2130 );
+ dc.DrawBitmap( mono, x, y + 30 );
dc.SetTextForeground( *wxBLACK );
- dc.DrawText( _T("After wxImage conversion"), 150, 2095 );
- dc.DrawText( _T("(red on white)"), 150, 2110 );
+ dc.DrawText( _T("After wxImage conversion"), x + 120, y );
+ dc.DrawText( _T("(red on white)"), x + 120, y + 15 );
dc.SetTextForeground( wxT("RED") );
wxImage i = mono.ConvertToImage();
i.SetMaskColour( 255,255,255 );
wxRED_PEN->GetColour().Red(),
wxRED_PEN->GetColour().Green(),
wxRED_PEN->GetColour().Blue() );
- dc.DrawBitmap( wxBitmap(i), 150, 2130, true );
+ dc.DrawBitmap( wxBitmap(i), x + 120, y + 30, true );
dc.SetTextForeground( *wxBLACK );
}
bool MyApp::OnInit()
{
-#if wxUSE_LIBPNG
- wxImage::AddHandler( new wxPNGHandler );
-#endif
-
-#if wxUSE_LIBJPEG
- wxImage::AddHandler( new wxJPEGHandler );
-#endif
-
-#if wxUSE_LIBTIFF
- wxImage::AddHandler( new wxTIFFHandler );
-#endif
-
-#if wxUSE_GIF
- wxImage::AddHandler( new wxGIFHandler );
-#endif
-
-#if wxUSE_PCX
- wxImage::AddHandler( new wxPCXHandler );
-#endif
-
-#if wxUSE_PNM
- wxImage::AddHandler( new wxPNMHandler );
-#endif
-
-#if wxUSE_XPM
- wxImage::AddHandler( new wxXPMHandler );
-#endif
-
-#if wxUSE_ICO_CUR
- wxImage::AddHandler( new wxICOHandler );
- wxImage::AddHandler( new wxCURHandler );
- wxImage::AddHandler( new wxANIHandler );
-#endif
+ wxInitAllImageHandlers();
- wxFrame *frame = new MyFrame();
- frame->Show( true );
+ wxFrame *frame = new MyFrame();
+ frame->Show( true );
- return true;
+ return true;
}
#define wxUSE_LIBTIFF 0
+#define wxUSE_TGA 0
+
#define wxUSE_GIF 0
#define wxUSE_PNM 0
wxImage::AddHandler( new wxCURHandler );
wxImage::AddHandler( new wxANIHandler );
#endif
+#if wxUSE_TGA
+ wxImage::AddHandler( new wxTGAHandler );
+#endif
#if wxUSE_XPM
wxImage::AddHandler( new wxXPMHandler );
#endif
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: imagtga.cpp
+// Purpose: wxImage TGA handler
+// Author: Seth Jackson
+// CVS-ID: $Id$
+// Copyright: (c) 2005 Seth Jackson
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#if wxUSE_IMAGE && wxUSE_TGA
+
+#ifndef WX_PRECOMP
+ #include "wx/palette.h"
+#endif
+
+#include "wx/imagtga.h"
+#include "wx/log.h"
+
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// TGA error codes.
+enum
+{
+ wxTGA_OK = 0,
+ wxTGA_INVFORMAT = 1,
+ wxTGA_MEMERR = 2
+};
+
+// TGA header bytes.
+enum
+{
+ HDR_OFFSET = 0,
+ HDR_COLORTYPE = 1,
+ HDR_IMAGETYPE = 2,
+ HDR_PALETTESTART = 3,
+ HDR_PALETTELENGTH = 5,
+ HDR_PALETTEBITS = 7,
+ HDR_XORIGIN = 8,
+ HDR_YORIGIN = 10,
+ HDR_WIDTH = 12,
+ HDR_HEIGHT = 14,
+ HDR_BPP = 16,
+ HDR_ORIENTATION = 17,
+ HDR_SIZE
+};
+
+// TGA color types.
+enum
+{
+ wxTGA_UNMAPPED = 0,
+ wxTGA_MAPPED = 1
+};
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+IMPLEMENT_DYNAMIC_CLASS(wxTGAHandler, wxImageHandler)
+
+#if wxUSE_STREAMS
+
+// ----------------------------------------------------------------------------
+// worker functions
+// ----------------------------------------------------------------------------
+
+static
+void FlipTGA(unsigned char* imageData, int width, int height, short pixelSize)
+{
+ int lineLength = width * pixelSize;
+ unsigned char *line1 = imageData;
+ unsigned char *line2 = &imageData[lineLength * (height - 1)];
+
+ unsigned char temp;
+ for ( ; line1 < line2; line2 -= (lineLength * 2))
+ {
+ for (int index = 0; index < lineLength; line1++, line2++, index++)
+ {
+ temp = *line1;
+ *line1 = *line2;
+ *line2 = temp;
+ }
+ }
+}
+
+static
+void DecodeRLE(unsigned char* imageData, unsigned long imageSize,
+ short pixelSize, wxInputStream& stream)
+{
+ unsigned long index = 0;
+ unsigned char current;
+ unsigned int length;
+ unsigned char buf[4];
+
+ while (index < imageSize)
+ {
+ current = stream.GetC();
+
+ // RLE packet.
+ if ( current & 0x80 )
+ {
+ // Get the run length of the packet.
+ current &= 0x7f;
+
+ current++;
+
+ length = current;
+
+ index += current * pixelSize;
+
+ // Repeat the pixel length times.
+ stream.Read(buf, pixelSize);
+
+ for (unsigned int i = 0; i < length; i++)
+ {
+ memcpy(imageData, buf, pixelSize);
+
+ imageData += pixelSize;
+ }
+ }
+ else // Raw packet.
+ {
+ // Get the run length of the packet.
+ current++;
+
+ length = current * pixelSize;
+
+ index += length;
+
+ // Write the next length pixels directly to the image data.
+ stream.Read(imageData, length);
+
+ imageData += length;
+ }
+ }
+}
+
+static
+int ReadTGA(wxImage* image, wxInputStream& stream)
+{
+ // Read in the TGA header
+ unsigned char hdr[HDR_SIZE];
+ stream.Read(hdr, HDR_SIZE);
+
+ short offset = hdr[HDR_OFFSET] + HDR_SIZE;
+ short colorType = hdr[HDR_COLORTYPE];
+ short imageType = hdr[HDR_IMAGETYPE];
+ int paletteLength = hdr[HDR_PALETTELENGTH] + 256 * hdr[HDR_PALETTELENGTH + 1];
+ int width = (hdr[HDR_WIDTH] + 256 * hdr[HDR_WIDTH + 1]) -
+ (hdr[HDR_XORIGIN] + 256 * hdr[HDR_XORIGIN + 1]);
+ int height = (hdr[HDR_HEIGHT] + 256 * hdr[HDR_HEIGHT + 1]) -
+ (hdr[HDR_YORIGIN] + 256 * hdr[HDR_YORIGIN + 1]);
+ short bpp = hdr[HDR_BPP];
+ short orientation = hdr[HDR_ORIENTATION] & 0x20;
+
+ image->Create(width, height);
+
+ if (!image->Ok())
+ {
+ return wxTGA_MEMERR;
+ }
+
+ const short pixelSize = bpp / 8;
+
+ const unsigned long imageSize = width * height * pixelSize;
+
+ unsigned char *imageData = (unsigned char* )malloc(imageSize);
+
+ if (!imageData)
+ {
+ return wxTGA_MEMERR;
+ }
+
+ unsigned char *dst = image->GetData();
+
+ unsigned char* alpha = NULL;
+ if (bpp == 16 || bpp == 32)
+ {
+ image->SetAlpha();
+
+ alpha = image->GetAlpha();
+ }
+
+ // Seek from the offset we got from the TGA header.
+ stream.SeekI(offset, wxFromStart);
+
+ // Load a palette if we have one.
+ if (colorType == wxTGA_MAPPED)
+ {
+ unsigned char buf[3];
+
+ unsigned char* r = new unsigned char[paletteLength];
+ unsigned char* g = new unsigned char[paletteLength];
+ unsigned char* b = new unsigned char[paletteLength];
+
+ for (int i = 0; i < paletteLength; i++)
+ {
+ stream.Read(buf, 3);
+
+ r[i] = buf[2];
+ g[i] = buf[1];
+ b[i] = buf[0];
+ }
+
+ #if wxUSE_PALETTE
+
+ // Set the palette of the image.
+
+ image->SetPalette(wxPalette(paletteLength, r, g, b));
+
+ #endif // wxUSE_PALETTE
+
+ delete[] r;
+ delete[] g;
+ delete[] b;
+ }
+
+ // Handle the various TGA formats we support.
+
+ switch (imageType)
+ {
+ // Raw indexed.
+
+ case 1:
+ {
+ const wxPalette& palette = image->GetPalette();
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+
+ // No compression read the data directly to imageData.
+
+ stream.Read(imageData, imageSize);
+
+ // If orientation == 0, then the image is stored upside down.
+ // We need to store it right side up.
+
+ if (orientation == 0)
+ {
+ FlipTGA(imageData, width, height, pixelSize);
+ }
+
+ // Handle the different pixel depths.
+
+ switch (bpp)
+ {
+ // 8 bpp.
+
+ case 8:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ palette.GetRGB(imageData[index], &r, &g, &b);
+
+ *(dst++) = r;
+ *(dst++) = g;
+ *(dst++) = b;
+ }
+ }
+ break;
+
+ // 16 bpp.
+
+ case 16:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ palette.GetRGB(imageData[index], &r, &g, &b);
+
+ *(dst++) = r;
+ *(dst++) = g;
+ *(dst++) = b;
+ *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255;
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+ }
+ break;
+
+ // Raw RGB.
+
+ case 2:
+ {
+ // No compression read the data directly to imageData.
+
+ stream.Read(imageData, imageSize);
+
+ // If orientation == 0, then the image is stored upside down.
+ // We need to store it right side up.
+
+ if (orientation == 0)
+ {
+ FlipTGA(imageData, width, height, pixelSize);
+ }
+
+ // Handle the different pixel depths.
+
+ switch (bpp)
+ {
+ //16 bpp.
+
+ case 16:
+ {
+ unsigned char temp;
+
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ temp = (imageData[index + 1] & 0x7c) << 1;
+ temp |= temp >> 5;
+ *(dst++) = temp;
+
+ temp = ((imageData[index + 1] & 0x03) << 6) | ((imageData[index] & 0xe0) >> 2);
+ temp |= temp >> 5;
+ *(dst++) = temp;
+
+ temp = (imageData[index] & 0x1f) << 3;
+ temp |= temp >> 5;
+ *(dst++) = temp;
+
+ *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255;
+ }
+ }
+ break;
+
+ // 24 bpp.
+
+ case 24:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index + 2];
+ *(dst++) = imageData[index + 1];
+ *(dst++) = imageData[index];
+ }
+ }
+ break;
+
+ // 32 bpp.
+
+ case 32:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index + 2];
+ *(dst++) = imageData[index + 1];
+ *(dst++) = imageData[index];
+ *(alpha++) = imageData[index + 3];
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+ }
+ break;
+
+ // Raw grayscale.
+
+ case 3:
+ {
+ // No compression read the data directly to imageData.
+
+ stream.Read(imageData, imageSize);
+
+ // If orientation == 0, then the image is stored upside down.
+ // We need to store it right side up.
+
+ if (orientation == 0)
+ {
+ FlipTGA(imageData, width, height, pixelSize);
+ }
+
+ // Handle the different pixel depths.
+
+ switch (bpp)
+ {
+ // 8 bpp.
+
+ case 8:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ }
+ }
+ break;
+
+ // 16 bpp.
+
+ case 16:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ *(alpha++) = imageData[index + 1];
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+ }
+ break;
+
+ // RLE indexed.
+
+ case 9:
+ {
+ const wxPalette& palette = image->GetPalette();
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+
+ // Decode the RLE data.
+
+ DecodeRLE(imageData, imageSize, pixelSize, stream);
+
+ // If orientation == 0, then the image is stored upside down.
+ // We need to store it right side up.
+
+ if (orientation == 0)
+ {
+ FlipTGA(imageData, width, height, pixelSize);
+ }
+
+ // Handle the different pixel depths.
+
+ switch (bpp)
+ {
+ // 8 bpp.
+
+ case 8:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ palette.GetRGB(imageData[index], &r, &g, &b);
+
+ *(dst++) = r;
+ *(dst++) = g;
+ *(dst++) = b;
+ }
+ }
+ break;
+
+ // 16 bpp.
+
+ case 16:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ palette.GetRGB(imageData[index], &r, &g, &b);
+
+ *(dst++) = r;
+ *(dst++) = g;
+ *(dst++) = b;
+ *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255;
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+ }
+ break;
+
+ // RLE RGB.
+
+ case 10:
+ {
+ // Decode the RLE data.
+
+ DecodeRLE(imageData, imageSize, pixelSize, stream);
+
+ // If orientation == 0, then the image is stored upside down.
+ // We need to store it right side up.
+
+ if (orientation == 0)
+ {
+ FlipTGA(imageData, width, height, pixelSize);
+ }
+
+ // Handle the different pixel depths.
+
+ switch (bpp)
+ {
+ //16 bpp.
+
+ case 16:
+ {
+ unsigned char temp;
+
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ temp = (imageData[index + 1] & 0x7c) << 1;
+ temp |= temp >> 5;
+ *(dst++) = temp;
+
+ temp = ((imageData[index + 1] & 0x03) << 6) | ((imageData[index] & 0xe0) >> 2);
+ temp |= temp >> 5;
+ *(dst++) = temp;
+
+ temp = (imageData[index] & 0x1f) << 3;
+ temp |= temp >> 5;
+ *(dst++) = temp;
+
+ *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255;
+ }
+ }
+ break;
+
+ // 24 bpp.
+
+ case 24:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index + 2];
+ *(dst++) = imageData[index + 1];
+ *(dst++) = imageData[index];
+ }
+ }
+ break;
+
+ // 32 bpp.
+
+ case 32:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index + 2];
+ *(dst++) = imageData[index + 1];
+ *(dst++) = imageData[index];
+ *(alpha++) = imageData[index + 3];
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+ }
+ break;
+
+ // RLE grayscale.
+
+ case 11:
+ {
+ // Decode the RLE data.
+
+ DecodeRLE(imageData, imageSize, pixelSize, stream);
+
+ // If orientation == 0, then the image is stored upside down.
+ // We need to store it right side up.
+
+ if (orientation == 0)
+ {
+ FlipTGA(imageData, width, height, pixelSize);
+ }
+
+ // Handle the different pixel depths.
+
+ switch (bpp)
+ {
+ // 8 bpp.
+
+ case 8:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ }
+ }
+ break;
+
+ // 16 bpp.
+
+ case 16:
+ {
+ for (unsigned long index = 0; index < imageSize; index += pixelSize)
+ {
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ *(dst++) = imageData[index];
+ *(alpha++) = imageData[index + 1];
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+ }
+ break;
+
+ default:
+ return wxTGA_INVFORMAT;
+ }
+
+ free(imageData);
+
+ return wxTGA_OK;
+}
+
+static
+int SaveTGA(wxImage* WXUNUSED(image), wxOutputStream& WXUNUSED(stream))
+{
+ wxLogError(wxT("Saving in TGA format is not implemented."));
+
+ return wxTGA_OK;
+}
+
+// ----------------------------------------------------------------------------
+// wxTGAHandler
+// ----------------------------------------------------------------------------
+
+bool wxTGAHandler::LoadFile(wxImage* image,
+ wxInputStream& stream,
+ bool verbose,
+ int WXUNUSED(index))
+{
+ if ( !CanRead(stream) )
+ {
+ if ( verbose )
+ wxLogError(wxT("TGA: this is not a TGA file."));
+
+ return false;
+ }
+
+ image->Destroy();
+
+ int error = ReadTGA(image, stream);
+ if ( error != wxTGA_OK )
+ {
+ if ( verbose )
+ {
+ switch ( error )
+ {
+ case wxTGA_INVFORMAT:
+ wxLogError(wxT("TGA: image format unsupported."));
+ break;
+
+ case wxTGA_MEMERR:
+ wxLogError(wxT("TGA: couldn't allocate memory."));
+ break;
+
+ default:
+ wxLogError(wxT("TGA: unknown error!"));
+ }
+ }
+
+ image->Destroy();
+
+ return false;
+ }
+
+ return true;
+}
+
+bool wxTGAHandler::SaveFile(wxImage* image, wxOutputStream& stream, bool verbose)
+{
+ int error = SaveTGA(image, stream);
+
+ if ( error != wxTGA_OK )
+ {
+ if ( verbose )
+ {
+ switch ( error )
+ {
+ case wxTGA_INVFORMAT:
+ wxLogError(wxT("TGA: invalid image."));
+ break;
+
+ case wxTGA_MEMERR:
+ wxLogError(wxT("TGA: couldn't allocate memory."));
+ break;
+
+ default:
+ wxLogError(wxT("TGA: unknown error!"));
+ }
+ }
+
+ return false;
+ }
+
+ return true;
+}
+
+bool wxTGAHandler::DoCanRead(wxInputStream& stream)
+{
+ // read the fixed-size TGA headers
+ unsigned char hdr[HDR_SIZE];
+ stream.Read(hdr, HDR_SIZE);
+
+ // Check wether we can read the file or not.
+
+ short colorType = hdr[HDR_COLORTYPE];
+ if ( colorType != wxTGA_UNMAPPED && colorType != wxTGA_MAPPED )
+ {
+ return false;
+ }
+
+ short imageType = hdr[HDR_IMAGETYPE];
+ if ( imageType == 0 || imageType == 32 || imageType == 33 )
+ {
+ return false;
+ }
+
+ short bpp = hdr[HDR_BPP];
+ if ( bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32 )
+ {
+ return false;
+ }
+
+ return true;
+}
+
+#endif // wxUSE_STREAMS
+
+#endif // wxUSE_IMAGE && wxUSE_TGA
# End Source File
# Begin Source File
+SOURCE=.\common\imagtga.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\common\imagtiff.cpp
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\include\wx\imagtga.h
+# End Source File
+# Begin Source File
+
SOURCE=..\include\wx\imagtiff.h
# End Source File
# Begin Source File