diff options
author | scuri <scuri> | 2011-01-19 16:28:59 +0000 |
---|---|---|
committer | scuri <scuri> | 2011-01-19 16:28:59 +0000 |
commit | a3ef3df6ecc95439e2d6fb909cc30fab77675e9f (patch) | |
tree | bdd7c251dfaa9c5a7b6c91625cdf327e4ef32bc4 | |
parent | 1a113acb45c6228039b0b1d40afceaa041ff8869 (diff) |
Fixed: support for alpha with gray images in SGI format.
-rw-r--r-- | html/en/history.html | 9 | ||||
-rw-r--r-- | src/im_format_sgi.cpp | 17 | ||||
-rw-r--r-- | tecmake.mak | 9 | ||||
-rw-r--r-- | tecmakewin.mak | 2 |
4 files changed, 33 insertions, 4 deletions
diff --git a/html/en/history.html b/html/en/history.html index 6b55c03..525cfe0 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -26,6 +26,15 @@ <h2>History of Changes</h2> <h3 dir="ltr"> + CVS (19/Jan/2011)</h3> +<ul dir="ltr"> + <li dir="ltr"><span style="color: #008000"> + <span + style="color: #000000"> + <span class="hist_fixed">Fixed:</span> support for alpha with gray + images in SGI format.</span></span></li> +</ul> +<h3 dir="ltr"> <a href="http://sourceforge.net/projects/imtoolkit/files/3.6.3/">Version 3.6.3</a> (09/Nov/2010)</h3> <ul dir="ltr"> diff --git a/src/im_format_sgi.cpp b/src/im_format_sgi.cpp index 08bbf4d..695340b 100644 --- a/src/im_format_sgi.cpp +++ b/src/im_format_sgi.cpp @@ -2,7 +2,7 @@ * \brief SGI - Silicon Graphics Image File Format * * See Copyright Notice in im_lib.h - * $Id: im_format_sgi.cpp,v 1.2 2008/12/03 15:45:34 scuri Exp $ + * $Id: im_format_sgi.cpp,v 1.3 2011/01/19 16:28:59 scuri Exp $ */ #include "im_format.h" @@ -300,9 +300,13 @@ int imFileFormatSGI::ReadImageInfo(int index) switch (dimension) { case 1: + // If this value is 1, the image file consists of only 1 channel and only 1 scanline (row). + // Only width is valid. this->height = 1; depth = 1; case 2: + // If this value is 2, the file consists of a single channel with a number of scanlines. + // Only width and height are valid. depth = 1; break; case 3: @@ -319,6 +323,10 @@ int imFileFormatSGI::ReadImageInfo(int index) case 1: this->file_color_mode = IM_GRAY; break; + case 2: + // This is NOT mentioned by the specification, but it is used + this->file_color_mode = IM_GRAY | IM_ALPHA; + break; case 3: this->file_color_mode = IM_RGB; break; @@ -411,6 +419,13 @@ int imFileFormatSGI::WriteImageInfo() if (imColorModeHasAlpha(this->user_color_mode)) this->file_color_mode |= IM_ALPHA; } + else if (this->file_color_mode == IM_GRAY && + imColorModeHasAlpha(this->user_color_mode)) + { + // This is NOT mentioned by the specification, but it is used + dimension = 3; + this->file_color_mode |= IM_ALPHA; + } this->file_data_type = this->user_data_type; diff --git a/tecmake.mak b/tecmake.mak index 3f8c0ab..d8c18bc 100644 --- a/tecmake.mak +++ b/tecmake.mak @@ -240,6 +240,11 @@ ifndef NO_GTK_DEFAULT ifneq ($(findstring FreeBSD, $(TEC_UNAME)), ) GTK_DEFAULT = Yes endif + ifneq ($(findstring SunOS, $(TEC_UNAME)), ) + ifeq ($(TEC_SYSARCH), x86) + GTK_DEFAULT = Yes + endif + endif endif #---------------------------------# @@ -947,7 +952,7 @@ endif ifdef USE_GTK ifdef USE_PKGCONFIG # get compile/link flags via pkg-config - PKGINCS += $(shell pkg-config --cflags gtk+-2.0 gdk-2.0) + PKGINCS += $(shell pkg-config --cflags gtk+-2.0 gdk-2.0 gtk+-unix-print-2.0) PKGLIBS += $(shell pkg-config --libs gtk+-2.0 gdk-2.0) GTK_BASE := $(shell pkg-config --variable=prefix gtk+-2.0) GTK := $(GTK_BASE) @@ -984,7 +989,7 @@ ifdef USE_GTK endif LIBS += gdk_pixbuf-2.0 pango-1.0 gobject-2.0 gmodule-2.0 glib-2.0 - STDINCS += $(GTK)/include/atk-1.0 $(GTK)/include/gtk-2.0 $(GTK)/include/cairo $(GTK)/include/pango-1.0 $(GTK)/include/glib-2.0 + STDINCS += $(GTK)/include/atk-1.0 $(GTK)/include/gtk-2.0 $(GTK)/include/gdk-pixbuf-2.0 $(GTK)/include/cairo $(GTK)/include/pango-1.0 $(GTK)/include/glib-2.0 ifeq ($(TEC_SYSARCH), x64) STDINCS += $(GTK)/lib64/glib-2.0/include $(GTK)/lib64/gtk-2.0/include diff --git a/tecmakewin.mak b/tecmakewin.mak index 4e87c3c..89e3ede 100644 --- a/tecmakewin.mak +++ b/tecmakewin.mak @@ -984,7 +984,7 @@ ifdef USE_OPENGL endif ifdef USE_GTK - STDINCS += $(GTK)/include/atk-1.0 $(GTK)/include/gtk-2.0 $(GTK)/include/cairo $(GTK)/include/pango-1.0 $(GTK)/include/glib-2.0 $(GTK)/lib/glib-2.0/include $(GTK)/lib/gtk-2.0/include + STDINCS += $(GTK)/include/atk-1.0 $(GTK)/include/gtk-2.0 $(GTK)/include/gdk-pixbuf-2.0 $(GTK)/include/cairo $(GTK)/include/pango-1.0 $(GTK)/include/glib-2.0 $(GTK)/lib/glib-2.0/include $(GTK)/lib/gtk-2.0/include ifeq "$(TEC_CC)" "gcc" STDFLAGS += -mms-bitfields endif |