summaryrefslogtreecommitdiff
path: root/src/generic
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-07-13 15:04:53 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-13 15:06:42 +0900
commit0368adfcba149c17a25eaf1ab2291ec89d303506 (patch)
treee6ac5d763b1559090c921ad3cebcbebdee07d817 /src/generic
parentdb27a6b9403d911f76345ecd04f53a3e29aad0ea (diff)
pdf: Tentative implementation of mono support
No idea if it's correct, since I have no sample. Also, simplify ARGB code.
Diffstat (limited to 'src/generic')
-rw-r--r--src/generic/evas/pdf/main.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/generic/evas/pdf/main.cpp b/src/generic/evas/pdf/main.cpp
index 097f057..8623179 100644
--- a/src/generic/evas/pdf/main.cpp
+++ b/src/generic/evas/pdf/main.cpp
@@ -154,7 +154,21 @@ void poppler_load_image(int size_w EINA_UNUSED, int size_h EINA_UNUSED)
154 154
155 if (out.format() == image::format_mono) 155 if (out.format() == image::format_mono)
156 { 156 {
157 //FIXME no idea what this format is like 157 // Looks like this is 1 bit per pixel, padded to a single byte.
158 // The problem is testing. I have no sample (and no doc).
159
160 uint8_t *src;
161 for (y = 0; y < crop_height; y++)
162 {
163 src = (uint8_t *) out.data() + y * crop_width;
164 for (x = 0; x < crop_width; x++)
165 {
166 int bit = x & 0x7;
167 int c = (*src & (1 << bit)) ? 0xFF : 0x00;
168 *dst++ = ARGB_JOIN(0xFF, c, c, c);
169 if (x & 0x7 == 0x7) src++;
170 }
171 }
158 } 172 }
159 if (out.format() == image::format_rgb24) 173 if (out.format() == image::format_rgb24)
160 { 174 {
@@ -172,11 +186,7 @@ void poppler_load_image(int size_w EINA_UNUSED, int size_h EINA_UNUSED)
172 186
173 src = (DATA32*) out.data(); 187 src = (DATA32*) out.data();
174 IMAGE_PIXEL_ITERATOR 188 IMAGE_PIXEL_ITERATOR
175 { 189 *dst++ = *src++;
176 int pos = x+y*crop_width;
177
178 dst[pos] = src[pos];
179 }
180 } 190 }
181 191
182 end: 192 end: