Add tga loader, patch by Nicola Girardi. (#56067)

This commit is contained in:
Matthias Clasen 2001-08-21 08:51:06 +00:00
parent ce46c83ab8
commit a2e555e814
13 changed files with 1245 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* configure.in (all_loaders): Add tga loader,
patch by Nicola Girardi. (#56067)
Tue Aug 21 02:57:13 2001 Jonathan Blandford <jrb@redhat.com>>
* gtk/gtktreeview.c (gtk_tree_view_button_press): Fix up selection

View File

@ -524,7 +524,7 @@ else
fi
fi
all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm"
all_loaders="png,bmp,wbmp,gif,ico,jpeg,pnm,ras,tiff,xpm,tga"
included_loaders=""
# If no loaders specified, include all
if test "x$with_included_loaders" = xyes ; then

View File

@ -1,3 +1,8 @@
2001-08-21 Matthias Clasen <matthiasc@waldgeist.poet.de>
* Makefile.am, gdk-pixbuf-io.c, pixbufloader_tga.def,
io-tga.c: Add tga loader, patch by Nicola Girardi. (#56067)
2001-08-20 Matthias Clasen <matthiasc@waldgeist.poet.de>
* test-images.h, test-loaders.c: Add ico and wbmp tests.

View File

@ -95,6 +95,14 @@ libpixbufloader_xbm_la_LDFLAGS = -version-info 1:0:0 -module
libpixbufloader_xbm_la_LDFLAGS = -avoid-version -module
libpixbufloader_xbm_la_LIBADD = $(module_libs)
#
# The TGA loader
#
libpixbufloader_tga_la_SOURCES = io-tga.c
libpixbufloader_tga_la_LDFLAGS = -version-info 1:0:0 -module
libpixbufloader_tga_la_LDFLAGS = -avoid-version -module
libpixbufloader_tga_la_LIBADD = $(module_libs)
if HAVE_PNG
PNG_LIB = libpixbufloader-png.la
endif
@ -123,6 +131,8 @@ WBMP_LIB = libpixbufloader-wbmp.la
XBM_LIB = libpixbufloader-xbm.la
TGA_LIB = libpixbufloader-tga.la
if BUILD_DYNAMIC_MODULES
loader_LTLIBRARIES = \
@ -136,7 +146,8 @@ loader_LTLIBRARIES = \
$(PNM_LIB) \
$(BMP_LIB) \
$(WBMP_LIB) \
$(XBM_LIB)
$(XBM_LIB) \
$(TGA_LIB)
extra_sources =

View File

@ -200,6 +200,24 @@ pixbuf_check_xbm (guchar *buffer, int size)
return TRUE;
}
static gboolean
pixbuf_check_tga (guchar *buffer, int size)
{
if (size < 18)
return FALSE;
/* buffer[1] is a boolean telling if in the file a colormap is
present, while buffer[2] is the byte which specifies the image
type. (GrayScale/PseudoColor/TrueColor/RLE) */
if ((buffer[2] == 1) || (buffer[2] == 9)) {
if (buffer[1] != 1)
return FALSE;
} else {
if (buffer[1] != 0)
return FALSE;
}
return TRUE;
}
static GdkPixbufModule file_formats [] = {
{ "png", pixbuf_check_png, NULL, NULL, NULL, NULL, NULL, NULL, NULL, },
{ "jpeg", pixbuf_check_jpeg, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
@ -209,10 +227,13 @@ static GdkPixbufModule file_formats [] = {
{ "xpm", pixbuf_check_xpm, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "pnm", pixbuf_check_pnm, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "ras", pixbuf_check_sunras, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "ico", pixbuf_check_ico, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "bmp", pixbuf_check_bmp, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "wbmp", pixbuf_check_wbmp, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "xbm", pixbuf_check_xbm, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "tga", pixbuf_check_tga, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
/* Moved at the bottom, because it causes false positives against many
of my TGA files. */
{ "ico", pixbuf_check_ico, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
@ -336,6 +357,7 @@ m_fill_vtable (ras);
m_fill_vtable (tiff);
m_fill_vtable (xpm);
m_fill_vtable (xbm);
m_fill_vtable (tga);
gboolean
_gdk_pixbuf_load_module (GdkPixbufModule *image_module,
@ -414,6 +436,11 @@ _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
}
#endif
#ifdef INCLUDE_tga
else if (strcmp (image_module->module_name, "tga") == 0){
fill_vtable = mname (tga, fill_vtable);
}
#endif
if (fill_vtable) {
(* fill_vtable) (image_module);

1162
gdk-pixbuf/io-tga.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
EXPORTS
gdk_pixbuf__tga_fill_vtable