summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5b591e4)
raw | patch | inline | side by side (parent: 5b591e4)
author | joncruz <joncruz@users.sourceforge.net> | |
Tue, 6 Jun 2006 03:37:34 +0000 (03:37 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Tue, 6 Jun 2006 03:37:34 +0000 (03:37 +0000) |
ChangeLog | patch | blob | history | |
src/trace/siox.cpp | patch | blob | history | |
src/trace/trace.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 38d21720179c24573e96811e05078f768f61175e..f2db872f48d2476143d1973d9180099fff8ada78 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-2006-06-02 Jon A. Cruz <jon@joncruz.org>
+2006-06-05 Jon A. Cruz <jon@joncruz.org>
+
+ * trace/siox.cpp, trace/trace.cpp:
+
+ Applied patch #1501134.
+
+2006-06-05 Jon A. Cruz <jon@joncruz.org>
* src/dialogs/layers-panel.cpp:
Allow action when no layer selected.
Fixes bugs #1494646.
-2006-06-02 Jon A. Cruz <jon@joncruz.org>
+2006-06-05 Jon A. Cruz <jon@joncruz.org>
* trace/siox.cpp:
Applied patch #1500659.
-2006-06-02 Jon A. Cruz <jon@joncruz.org>
+2006-06-05 Jon A. Cruz <jon@joncruz.org>
* src/dialogs/layers-panel.h, src/dialogs/layers-panel.cpp:
diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp
index 955446b42219e341cfee0453685b396bc42be74e..752a14460d5d5578ab3d49f02b369d31522a6f53 100644 (file)
--- a/src/trace/siox.cpp
+++ b/src/trace/siox.cpp
*/
GdkPixbuf *SioxImage::getGdkPixbuf()
{
+ bool has_alpha = true;
+ int n_channels = has_alpha ? 4 : 3;
+
guchar *pixdata = (guchar *)
- malloc(sizeof(guchar) * width * height * 3);
+ malloc(sizeof(guchar) * width * height * n_channels);
if (!pixdata)
return NULL;
- int n_channels = 3;
- int rowstride = width * 3;
+ int rowstride = width * n_channels;
- GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB,
- 0, 8, width, height,
+ GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata,
+ GDK_COLORSPACE_RGB,
+ has_alpha, 8, width, height,
rowstride, NULL, NULL);
//### Fill in the cells with RGB values
for (unsigned x=0 ; x < width ; x++)
{
unsigned int rgb = getPixel(x, y);
- p[0] = (rgb >> 16) & 0xff;
- p[1] = (rgb >> 8) & 0xff;
- p[2] = (rgb ) & 0xff;
+ p[0] = (rgb >> 16) & 0xff;//r
+ p[1] = (rgb >> 8) & 0xff;//g
+ p[2] = (rgb ) & 0xff;//b
+ if ( n_channels > 3 )
+ {
+ p[3] = (rgb >> 24) & 0xff;//a
+ }
p += n_channels;
}
row += rowstride;
diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp
index d40fb89d7e67567b2e112c53ec1824e85c78d67f..408f5c5c3b988ef4e640817750a974240367da38 100644 (file)
--- a/src/trace/trace.cpp
+++ b/src/trace/trace.cpp
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (!desktop)
{
- g_warning("Trace: No active desktop\n");
+ g_warning(_("Trace: No active desktop"));
return NULL;
}
sengine.extractForeground(simage, 0xffffff);
if (!result.isValid())
{
- g_warning("Invalid SIOX result");
+ g_warning(_("Invalid SIOX result"));
return NULL;
}