diff options
author | Alessio Treglia <alessio@debian.org> | 2010-07-12 19:34:33 +0200 |
---|---|---|
committer | Alessio Treglia <alessio@debian.org> | 2010-07-12 19:34:33 +0200 |
commit | 88ed5294e45c9a82b309c08aa5533388d90b1a1f (patch) | |
tree | 0f7ecf0420c14bed82d615e98005327e8e613fe8 /src/page.c | |
parent | 046e95e38e048f663efbf421894f3f84a212525b (diff) | |
parent | c15dc3b14e35850849f3559ac0305b4cac4a7046 (diff) |
Merge commit 'upstream/2.31.5.bzr424'
Diffstat (limited to 'src/page.c')
-rw-r--r-- | src/page.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -31,6 +31,9 @@ struct PagePrivate /* Number of rows in this page or -1 if currently unknown */ gint rows; + /* Bit depth */ + gint depth; + /* Color profile */ gchar *color_profile; @@ -43,6 +46,9 @@ struct PagePrivate /* TRUE if have some page data */ gboolean has_data; + /* TRUE if have color data */ + gboolean is_color; + /* Expected next scan row */ gint scan_line; @@ -179,6 +185,21 @@ gboolean page_has_data (Page *page) } +gboolean page_is_color (Page *page) +{ + g_return_val_if_fail (page != NULL, FALSE); + return page->priv->is_color; +} + + +gint +page_get_depth (Page *page) +{ + g_return_val_if_fail (page != NULL, 0); + return page->priv->depth; +} + + gint page_get_scan_line (Page *page) { g_return_val_if_fail (page != NULL, -1); @@ -191,7 +212,7 @@ set_pixel (ScanLine *line, gint n, gint x, guchar *pixel) { gint sample; guchar *data; - + data = line->data + line->data_length * n; switch (line->format) { @@ -231,6 +252,11 @@ parse_line (Page *page, ScanLine *line, gint n, gboolean *size_changed) line_number = line->number + n; + if (line->format != LINE_GRAY) + page->priv->is_color = TRUE; + if (line->depth > page->priv->depth) + page->priv->depth = line->depth; + /* Extend image if necessary */ while (line_number >= page_get_scan_height (page)) { GdkPixbuf *image; |