blob: f7889f16d7b44b643810ace19d8c4f8a16badf69 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2010 The Android Open Source Project
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000010#include "SkPDFImage.h"
11
12#include "SkBitmap.h"
13#include "SkColor.h"
14#include "SkColorPriv.h"
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000015#include "SkPackBits.h"
16#include "SkPDFCatalog.h"
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000017#include "SkRect.h"
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000018#include "SkStream.h"
19#include "SkString.h"
20#include "SkUnPreMultiply.h"
21
22namespace {
23
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000024void extractImageData(const SkBitmap& bitmap, const SkIRect& srcRect,
25 SkStream** imageData, SkStream** alphaData) {
26 SkMemoryStream* image = NULL;
27 SkMemoryStream* alpha = NULL;
28 bool hasAlpha = false;
29 bool isTransparent = false;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000030
vandebo@chromium.orgad114952010-10-26 19:43:14 +000031 bitmap.lockPixels();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000032 switch (bitmap.getConfig()) {
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000033 case SkBitmap::kIndex8_Config: {
34 const int rowBytes = srcRect.width();
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000035 image = new SkMemoryStream(rowBytes * srcRect.height());
36 uint8_t* dst = (uint8_t*)image->getMemoryBase();
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000037 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
38 memcpy(dst, bitmap.getAddr8(srcRect.fLeft, y), rowBytes);
39 dst += rowBytes;
40 }
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000041 break;
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000042 }
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000043 case SkBitmap::kRLE_Index8_Config: {
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000044 const int rowBytes = srcRect.width();
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000045 image = new SkMemoryStream(rowBytes * srcRect.height());
46 uint8_t* dst = (uint8_t*)image->getMemoryBase();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000047 const SkBitmap::RLEPixels* rle =
48 (const SkBitmap::RLEPixels*)bitmap.getPixels();
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000049 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
50 SkPackBits::Unpack8(dst, srcRect.fLeft, rowBytes,
51 rle->packedAtY(y));
52 dst += rowBytes;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000053 }
54 break;
55 }
56 case SkBitmap::kARGB_4444_Config: {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000057 isTransparent = true;
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000058 const int rowBytes = (srcRect.width() * 3 + 1) / 2;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000059 const int alphaRowBytes = (srcRect.width() + 1) / 2;
60 image = new SkMemoryStream(rowBytes * srcRect.height());
61 alpha = new SkMemoryStream(alphaRowBytes * srcRect.height());
62 uint8_t* dst = (uint8_t*)image->getMemoryBase();
63 uint8_t* alphaDst = (uint8_t*)alpha->getMemoryBase();
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000064 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000065 uint16_t* src = bitmap.getAddr16(0, y);
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000066 int x;
67 for (x = srcRect.fLeft; x + 1 < srcRect.fRight; x += 2) {
68 dst[0] = (SkGetPackedR4444(src[x]) << 4) |
69 SkGetPackedG4444(src[x]);
70 dst[1] = (SkGetPackedB4444(src[x]) << 4) |
71 SkGetPackedR4444(src[x + 1]);
72 dst[2] = (SkGetPackedG4444(src[x + 1]) << 4) |
73 SkGetPackedB4444(src[x + 1]);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000074 dst += 3;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000075 alphaDst[0] = (SkGetPackedA4444(src[x]) << 4) |
76 SkGetPackedA4444(src[x + 1]);
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +000077 if (alphaDst[0] != 0xFF) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000078 hasAlpha = true;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +000079 }
80 if (alphaDst[0]) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000081 isTransparent = false;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +000082 }
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000083 alphaDst++;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000084 }
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +000085 if (srcRect.width() & 1) {
86 dst[0] = (SkGetPackedR4444(src[x]) << 4) |
87 SkGetPackedG4444(src[x]);
88 dst[1] = (SkGetPackedB4444(src[x]) << 4);
vandebo@chromium.org8ab3e0f2011-02-24 21:51:13 +000089 dst += 2;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000090 alphaDst[0] = (SkGetPackedA4444(src[x]) << 4);
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +000091 if (alphaDst[0] != 0xF0) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000092 hasAlpha = true;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +000093 }
94 if (alphaDst[0] & 0xF0) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +000095 isTransparent = false;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +000096 }
vandebo@chromium.org8ab3e0f2011-02-24 21:51:13 +000097 alphaDst++;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000098 }
99 }
100 break;
101 }
102 case SkBitmap::kRGB_565_Config: {
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +0000103 const int rowBytes = srcRect.width() * 3;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000104 image = new SkMemoryStream(rowBytes * srcRect.height());
105 uint8_t* dst = (uint8_t*)image->getMemoryBase();
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +0000106 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000107 uint16_t* src = bitmap.getAddr16(0, y);
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +0000108 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
109 dst[0] = SkGetPackedR16(src[x]);
110 dst[1] = SkGetPackedG16(src[x]);
111 dst[2] = SkGetPackedB16(src[x]);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000112 dst += 3;
113 }
114 }
115 break;
116 }
117 case SkBitmap::kARGB_8888_Config: {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000118 isTransparent = true;
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +0000119 const int rowBytes = srcRect.width() * 3;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000120 image = new SkMemoryStream(rowBytes * srcRect.height());
121 alpha = new SkMemoryStream(srcRect.width() * srcRect.height());
122 uint8_t* dst = (uint8_t*)image->getMemoryBase();
123 uint8_t* alphaDst = (uint8_t*)alpha->getMemoryBase();
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +0000124 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000125 uint32_t* src = bitmap.getAddr32(0, y);
vandebo@chromium.orgbefebb82011-01-29 01:38:50 +0000126 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
127 dst[0] = SkGetPackedR32(src[x]);
128 dst[1] = SkGetPackedG32(src[x]);
129 dst[2] = SkGetPackedB32(src[x]);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000130 dst += 3;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000131 alphaDst[0] = SkGetPackedA32(src[x]);
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000132 if (alphaDst[0] != 0xFF) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000133 hasAlpha = true;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000134 }
135 if (alphaDst[0]) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000136 isTransparent = false;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000137 }
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000138 alphaDst++;
139 }
140 }
141 break;
142 }
143 case SkBitmap::kA1_Config: {
144 isTransparent = true;
145 image = new SkMemoryStream(1);
146 ((uint8_t*)image->getMemoryBase())[0] = 0;
147
148 const int alphaRowBytes = (srcRect.width() + 7) / 8;
149 alpha = new SkMemoryStream(alphaRowBytes * srcRect.height());
150 uint8_t* alphaDst = (uint8_t*)alpha->getMemoryBase();
151 int offset1 = srcRect.fLeft % 8;
152 int offset2 = 8 - offset1;
153 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
154 uint8_t* src = bitmap.getAddr1(0, y);
ctguil@chromium.orga5c72342011-08-15 23:55:03 +0000155 // This may read up to one byte after src, but the potentially
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000156 // invalid bits are never used for computation.
157 for (int x = srcRect.fLeft; x < srcRect.fRight; x += 8) {
158 if (offset1) {
159 alphaDst[0] = src[x / 8] << offset1 |
160 src[x / 8 + 1] >> offset2;
161 } else {
162 alphaDst[0] = src[x / 8];
163 }
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000164 if (x + 7 < srcRect.fRight && alphaDst[0] != 0xFF) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000165 hasAlpha = true;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000166 }
167 if (x + 7 < srcRect.fRight && alphaDst[0]) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000168 isTransparent = false;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000169 }
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000170 alphaDst++;
171 }
172 // Calculate the mask of bits we're interested in within the
173 // last byte of alphaDst.
174 // width mod 8 == 1 -> 0x80 ... width mod 8 == 7 -> 0xFE
175 uint8_t mask = ~((1 << (8 - (srcRect.width() % 8))) - 1);
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000176 if (srcRect.width() % 8 && (alphaDst[-1] & mask) != mask) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000177 hasAlpha = true;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000178 }
179 if (srcRect.width() % 8 && (alphaDst[-1] & mask)) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000180 isTransparent = false;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000181 }
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000182 }
183 break;
184 }
185 case SkBitmap::kA8_Config: {
186 isTransparent = true;
187 image = new SkMemoryStream(1);
188 ((uint8_t*)image->getMemoryBase())[0] = 0;
189
190 const int alphaRowBytes = srcRect.width();
191 alpha = new SkMemoryStream(alphaRowBytes * srcRect.height());
192 uint8_t* alphaDst = (uint8_t*)alpha->getMemoryBase();
193 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
194 uint8_t* src = bitmap.getAddr8(0, y);
195 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
196 alphaDst[0] = src[x];
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000197 if (alphaDst[0] != 0xFF) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000198 hasAlpha = true;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000199 }
200 if (alphaDst[0]) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000201 isTransparent = false;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000202 }
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000203 alphaDst++;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000204 }
205 }
206 break;
207 }
208 default:
209 SkASSERT(false);
210 }
vandebo@chromium.orgad114952010-10-26 19:43:14 +0000211 bitmap.unlockPixels();
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000212
213 if (isTransparent) {
214 SkSafeUnref(image);
215 } else {
216 *imageData = image;
217 }
218
219 if (isTransparent || !hasAlpha) {
220 SkSafeUnref(alpha);
221 } else {
222 *alphaData = alpha;
223 }
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000224}
225
226SkPDFArray* makeIndexedColorSpace(SkColorTable* table) {
227 SkPDFArray* result = new SkPDFArray();
228 result->reserve(4);
vandebo@chromium.org06f7f402011-07-20 18:39:20 +0000229 result->appendName("Indexed");
230 result->appendName("DeviceRGB");
231 result->appendInt(table->count() - 1);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000232
233 // Potentially, this could be represented in fewer bytes with a stream.
234 // Max size as a string is 1.5k.
235 SkString index;
236 for (int i = 0; i < table->count(); i++) {
237 char buf[3];
238 SkColor color = SkUnPreMultiply::PMColorToColor((*table)[i]);
239 buf[0] = SkGetPackedR32(color);
240 buf[1] = SkGetPackedG32(color);
241 buf[2] = SkGetPackedB32(color);
242 index.append(buf, 3);
243 }
vandebo@chromium.orgf7c15762011-02-01 22:19:44 +0000244 result->append(new SkPDFString(index))->unref();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000245 return result;
246}
247
248}; // namespace
249
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000250// static
251SkPDFImage* SkPDFImage::CreateImage(const SkBitmap& bitmap,
sugoi@google.come2e81132013-03-05 18:35:55 +0000252 const SkIRect& srcRect) {
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000253 if (bitmap.getConfig() == SkBitmap::kNo_Config) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000254 return NULL;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000255 }
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000256
257 SkStream* imageData = NULL;
258 SkStream* alphaData = NULL;
259 extractImageData(bitmap, srcRect, &imageData, &alphaData);
260 SkAutoUnref unrefImageData(imageData);
261 SkAutoUnref unrefAlphaData(alphaData);
262 if (!imageData) {
263 SkASSERT(!alphaData);
264 return NULL;
265 }
266
267 SkPDFImage* image =
sugoi@google.come2e81132013-03-05 18:35:55 +0000268 new SkPDFImage(imageData, bitmap, srcRect, false);
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000269
270 if (alphaData != NULL) {
sugoi@google.come2e81132013-03-05 18:35:55 +0000271 image->addSMask(new SkPDFImage(alphaData, bitmap, srcRect, true))->unref();
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000272 }
273 return image;
274}
275
276SkPDFImage::~SkPDFImage() {
277 fResources.unrefAll();
278}
279
vandebo@chromium.orgf7c15762011-02-01 22:19:44 +0000280SkPDFImage* SkPDFImage::addSMask(SkPDFImage* mask) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000281 fResources.push(mask);
282 mask->ref();
vandebo@chromium.orgf7c15762011-02-01 22:19:44 +0000283 insert("SMask", new SkPDFObjRef(mask))->unref();
284 return mask;
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000285}
286
edisonn@google.com6addb192013-04-02 15:33:08 +0000287void SkPDFImage::getResources(const SkTSet<SkPDFObject*>& knownResourceObjects,
288 SkTSet<SkPDFObject*>* newResourceObjects) {
289 GetResourcesHelper(&fResources, knownResourceObjects, newResourceObjects);
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000290}
291
292SkPDFImage::SkPDFImage(SkStream* imageData, const SkBitmap& bitmap,
sugoi@google.come2e81132013-03-05 18:35:55 +0000293 const SkIRect& srcRect, bool doingAlpha) {
vandebo@chromium.org421d6442011-07-20 17:39:01 +0000294 this->setData(imageData);
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000295 SkBitmap::Config config = bitmap.getConfig();
296 bool alphaOnly = (config == SkBitmap::kA1_Config ||
297 config == SkBitmap::kA8_Config);
298
vandebo@chromium.org06f7f402011-07-20 18:39:20 +0000299 insertName("Type", "XObject");
300 insertName("Subtype", "Image");
vandebo@chromium.orgf7c15762011-02-01 22:19:44 +0000301
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000302 if (!doingAlpha && alphaOnly) {
303 // For alpha only images, we stretch a single pixel of black for
304 // the color/shape part.
vandebo@chromium.orgd96d17b2013-01-04 19:31:24 +0000305 SkAutoTUnref<SkPDFInt> one(new SkPDFInt(1));
vandebo@chromium.orgf7c15762011-02-01 22:19:44 +0000306 insert("Width", one.get());
307 insert("Height", one.get());
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000308 } else {
vandebo@chromium.org06f7f402011-07-20 18:39:20 +0000309 insertInt("Width", srcRect.width());
310 insertInt("Height", srcRect.height());
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000311 }
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000312
313 // if (!image mask) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000314 if (doingAlpha || alphaOnly) {
vandebo@chromium.org06f7f402011-07-20 18:39:20 +0000315 insertName("ColorSpace", "DeviceGray");
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000316 } else if (config == SkBitmap::kIndex8_Config ||
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000317 config == SkBitmap::kRLE_Index8_Config) {
vandebo@chromium.orgf7c15762011-02-01 22:19:44 +0000318 insert("ColorSpace",
319 makeIndexedColorSpace(bitmap.getColorTable()))->unref();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000320 } else {
vandebo@chromium.org06f7f402011-07-20 18:39:20 +0000321 insertName("ColorSpace", "DeviceRGB");
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000322 }
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000323 // }
324
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000325 int bitsPerComp = 8;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000326 if (config == SkBitmap::kARGB_4444_Config) {
vandebo@chromium.org1cfa2c42011-01-31 19:35:43 +0000327 bitsPerComp = 4;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000328 } else if (doingAlpha && config == SkBitmap::kA1_Config) {
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000329 bitsPerComp = 1;
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000330 }
vandebo@chromium.org06f7f402011-07-20 18:39:20 +0000331 insertInt("BitsPerComponent", bitsPerComp);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000332
333 if (config == SkBitmap::kRGB_565_Config) {
vandebo@chromium.orgd96d17b2013-01-04 19:31:24 +0000334 SkAutoTUnref<SkPDFInt> zeroVal(new SkPDFInt(0));
335 SkAutoTUnref<SkPDFScalar> scale5Val(
336 new SkPDFScalar(SkFloatToScalar(8.2258f))); // 255/2^5-1
337 SkAutoTUnref<SkPDFScalar> scale6Val(
338 new SkPDFScalar(SkFloatToScalar(4.0476f))); // 255/2^6-1
339 SkAutoTUnref<SkPDFArray> decodeValue(new SkPDFArray());
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000340 decodeValue->reserve(6);
341 decodeValue->append(zeroVal.get());
342 decodeValue->append(scale5Val.get());
343 decodeValue->append(zeroVal.get());
344 decodeValue->append(scale6Val.get());
345 decodeValue->append(zeroVal.get());
346 decodeValue->append(scale5Val.get());
347 insert("Decode", decodeValue.get());
348 }
349}