OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fxge/win32/cfx_psrenderer.h" | 7 #include "core/fxge/win32/cfx_psrenderer.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 }; | 32 }; |
33 | 33 |
34 CFX_PSRenderer::CFX_PSRenderer() { | 34 CFX_PSRenderer::CFX_PSRenderer() { |
35 m_pOutput = nullptr; | 35 m_pOutput = nullptr; |
36 m_bColorSet = m_bGraphStateSet = false; | 36 m_bColorSet = m_bGraphStateSet = false; |
37 m_bInited = false; | 37 m_bInited = false; |
38 } | 38 } |
39 | 39 |
40 CFX_PSRenderer::~CFX_PSRenderer() {} | 40 CFX_PSRenderer::~CFX_PSRenderer() {} |
41 | 41 |
42 #define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof str - 1) | 42 #define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof(str) - 1) |
43 | 43 |
44 void CFX_PSRenderer::Init(CPSOutput* pOutput, | 44 void CFX_PSRenderer::Init(CPSOutput* pOutput, |
45 int pslevel, | 45 int pslevel, |
46 int width, | 46 int width, |
47 int height, | 47 int height, |
48 bool bCmykOutput) { | 48 bool bCmykOutput) { |
49 m_PSLevel = pslevel; | 49 m_PSLevel = pslevel; |
50 m_pOutput = pOutput; | 50 m_pOutput = pOutput; |
51 m_ClipBox.left = m_ClipBox.top = 0; | 51 m_ClipBox.left = m_ClipBox.top = 0; |
52 m_ClipBox.right = width; | 52 m_ClipBox.right = width; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 FX_FLOAT y = pPathData->GetPointY(i); | 118 FX_FLOAT y = pPathData->GetPointY(i); |
119 if (pObject2Device) { | 119 if (pObject2Device) { |
120 pObject2Device->Transform(x, y); | 120 pObject2Device->Transform(x, y); |
121 } | 121 } |
122 buf << x << " " << y; | 122 buf << x << " " << y; |
123 switch (flag & FXPT_TYPE) { | 123 switch (flag & FXPT_TYPE) { |
124 case FXPT_MOVETO: | 124 case FXPT_MOVETO: |
125 buf << " m "; | 125 buf << " m "; |
126 break; | 126 break; |
127 case FXPT_LINETO: | 127 case FXPT_LINETO: |
128 if (flag & FXPT_CLOSEFIGURE) { | 128 buf << " l "; |
129 buf << " l h "; | 129 if (flag & FXPT_CLOSEFIGURE) |
130 } else { | 130 buf << "h "; |
131 buf << " l "; | |
132 } | |
133 break; | 131 break; |
134 case FXPT_BEZIERTO: { | 132 case FXPT_BEZIERTO: { |
135 FX_FLOAT x1 = pPathData->GetPointX(i + 1); | 133 FX_FLOAT x1 = pPathData->GetPointX(i + 1); |
136 FX_FLOAT x2 = pPathData->GetPointX(i + 2); | 134 FX_FLOAT x2 = pPathData->GetPointX(i + 2); |
137 FX_FLOAT y1 = pPathData->GetPointY(i + 1); | 135 FX_FLOAT y1 = pPathData->GetPointY(i + 1); |
138 FX_FLOAT y2 = pPathData->GetPointY(i + 2); | 136 FX_FLOAT y2 = pPathData->GetPointY(i + 2); |
139 if (pObject2Device) { | 137 if (pObject2Device) { |
140 pObject2Device->Transform(x1, y1); | 138 pObject2Device->Transform(x1, y1); |
141 pObject2Device->Transform(x2, y2); | 139 pObject2Device->Transform(x2, y2); |
142 } | 140 } |
143 buf << " " << x1 << " " << y1 << " " << x2 << " " << y2; | 141 buf << " " << x1 << " " << y1 << " " << x2 << " " << y2 << " c"; |
144 if (flag & FXPT_CLOSEFIGURE) { | 142 if (flag & FXPT_CLOSEFIGURE) |
145 buf << " c h\n"; | 143 buf << " h"; |
146 } else { | 144 buf << "\n"; |
147 buf << " c\n"; | |
148 } | |
149 i += 2; | 145 i += 2; |
150 break; | 146 break; |
151 } | 147 } |
152 } | 148 } |
153 } | 149 } |
154 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); | 150 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); |
155 } | 151 } |
156 | 152 |
157 void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData, | 153 void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData, |
158 const CFX_Matrix* pObject2Device, | 154 const CFX_Matrix* pObject2Device, |
159 int fill_mode) { | 155 int fill_mode) { |
160 StartRendering(); | 156 StartRendering(); |
161 OutputPath(pPathData, pObject2Device); | 157 OutputPath(pPathData, pObject2Device); |
162 CFX_FloatRect rect = pPathData->GetBoundingBox(); | 158 CFX_FloatRect rect = pPathData->GetBoundingBox(); |
163 if (pObject2Device) { | 159 if (pObject2Device) |
164 rect.Transform(pObject2Device); | 160 rect.Transform(pObject2Device); |
165 } | 161 m_ClipBox.left = static_cast<int>(rect.left); |
166 m_ClipBox.Intersect(rect.GetOuterRect()); | 162 m_ClipBox.right = static_cast<int>(rect.left + rect.right); |
| 163 m_ClipBox.top = static_cast<int>(rect.top + rect.bottom); |
| 164 m_ClipBox.bottom = static_cast<int>(rect.bottom); |
167 if ((fill_mode & 3) == FXFILL_WINDING) { | 165 if ((fill_mode & 3) == FXFILL_WINDING) { |
168 OUTPUT_PS("W n\n"); | 166 OUTPUT_PS("W n\n"); |
169 } else { | 167 } else { |
170 OUTPUT_PS("W* n\n"); | 168 OUTPUT_PS("W* n\n"); |
171 } | 169 } |
172 } | 170 } |
173 | 171 |
174 void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData, | 172 void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData, |
175 const CFX_Matrix* pObject2Device, | 173 const CFX_Matrix* pObject2Device, |
176 const CFX_GraphStateData* pGraphState) { | 174 const CFX_GraphStateData* pGraphState) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 CFX_ByteTextBuf buf; | 254 CFX_ByteTextBuf buf; |
257 if (!m_bGraphStateSet || | 255 if (!m_bGraphStateSet || |
258 m_CurGraphState.m_LineCap != pGraphState->m_LineCap) { | 256 m_CurGraphState.m_LineCap != pGraphState->m_LineCap) { |
259 buf << pGraphState->m_LineCap << " J\n"; | 257 buf << pGraphState->m_LineCap << " J\n"; |
260 } | 258 } |
261 if (!m_bGraphStateSet || | 259 if (!m_bGraphStateSet || |
262 m_CurGraphState.m_DashCount != pGraphState->m_DashCount || | 260 m_CurGraphState.m_DashCount != pGraphState->m_DashCount || |
263 FXSYS_memcmp(m_CurGraphState.m_DashArray, pGraphState->m_DashArray, | 261 FXSYS_memcmp(m_CurGraphState.m_DashArray, pGraphState->m_DashArray, |
264 sizeof(FX_FLOAT) * m_CurGraphState.m_DashCount)) { | 262 sizeof(FX_FLOAT) * m_CurGraphState.m_DashCount)) { |
265 buf << "["; | 263 buf << "["; |
266 for (int i = 0; i < pGraphState->m_DashCount; i++) { | 264 for (int i = 0; i < pGraphState->m_DashCount; ++i) { |
267 buf << pGraphState->m_DashArray[i] << " "; | 265 buf << pGraphState->m_DashArray[i] << " "; |
268 } | 266 } |
269 buf << "]" << pGraphState->m_DashPhase << " d\n"; | 267 buf << "]" << pGraphState->m_DashPhase << " d\n"; |
270 } | 268 } |
271 if (!m_bGraphStateSet || | 269 if (!m_bGraphStateSet || |
272 m_CurGraphState.m_LineJoin != pGraphState->m_LineJoin) { | 270 m_CurGraphState.m_LineJoin != pGraphState->m_LineJoin) { |
273 buf << pGraphState->m_LineJoin << " j\n"; | 271 buf << pGraphState->m_LineJoin << " j\n"; |
274 } | 272 } |
275 if (!m_bGraphStateSet || | 273 if (!m_bGraphStateSet || |
276 m_CurGraphState.m_LineWidth != pGraphState->m_LineWidth) { | 274 m_CurGraphState.m_LineWidth != pGraphState->m_LineWidth) { |
277 buf << pGraphState->m_LineWidth << " w\n"; | 275 buf << pGraphState->m_LineWidth << " w\n"; |
278 } | 276 } |
279 if (!m_bGraphStateSet || | 277 if (!m_bGraphStateSet || |
280 m_CurGraphState.m_MiterLimit != pGraphState->m_MiterLimit) { | 278 m_CurGraphState.m_MiterLimit != pGraphState->m_MiterLimit) { |
281 buf << pGraphState->m_MiterLimit << " M\n"; | 279 buf << pGraphState->m_MiterLimit << " M\n"; |
282 } | 280 } |
283 m_CurGraphState.Copy(*pGraphState); | 281 m_CurGraphState.Copy(*pGraphState); |
284 m_bGraphStateSet = TRUE; | 282 m_bGraphStateSet = true; |
285 if (buf.GetSize()) { | 283 if (buf.GetSize()) { |
286 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); | 284 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); |
287 } | 285 } |
288 } | 286 } |
289 | 287 |
290 static void FaxCompressData(uint8_t* src_buf, | 288 static void FaxCompressData(uint8_t* src_buf, |
291 int width, | 289 int width, |
292 int height, | 290 int height, |
293 std::unique_ptr<uint8_t, FxFreeDeleter>* dest_buf, | 291 std::unique_ptr<uint8_t, FxFreeDeleter>* dest_buf, |
294 uint32_t* dest_size) { | 292 uint32_t* dest_size) { |
295 if (width * height > 128) { | 293 if (width * height > 128) { |
296 CCodec_FaxModule::FaxEncode(src_buf, width, height, (width + 7) / 8, | 294 CCodec_FaxModule::FaxEncode(src_buf, width, height, (width + 7) / 8, |
297 dest_buf, dest_size); | 295 dest_buf, dest_size); |
298 FX_Free(src_buf); | 296 FX_Free(src_buf); |
299 } else { | 297 } else { |
300 (*dest_buf).reset(src_buf); | 298 dest_buf->reset(src_buf); |
301 *dest_size = (width + 7) / 8 * height; | 299 *dest_size = (width + 7) / 8 * height; |
302 } | 300 } |
303 } | 301 } |
304 | 302 |
305 static void PSCompressData(int PSLevel, | 303 static void PSCompressData(int PSLevel, |
306 uint8_t* src_buf, | 304 uint8_t* src_buf, |
307 uint32_t src_size, | 305 uint32_t src_size, |
308 uint8_t** output_buf, | 306 uint8_t** output_buf, |
309 uint32_t* output_size, | 307 uint32_t* output_size, |
310 const FX_CHAR** filter) { | 308 const FX_CHAR** filter) { |
311 *output_buf = src_buf; | 309 *output_buf = src_buf; |
312 *output_size = src_size; | 310 *output_size = src_size; |
313 *filter = ""; | 311 *filter = ""; |
314 if (src_size < 1024) { | 312 if (src_size < 1024) { |
315 return; | 313 return; |
316 } | 314 } |
317 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); | 315 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); |
318 uint8_t* dest_buf = NULL; | 316 uint8_t* dest_buf = nullptr; |
319 uint32_t dest_size = src_size; | 317 uint32_t dest_size = src_size; |
320 if (PSLevel >= 3) { | 318 if (PSLevel >= 3) { |
321 if (pEncoders && | 319 if (pEncoders && |
322 pEncoders->GetFlateModule()->Encode(src_buf, src_size, &dest_buf, | 320 pEncoders->GetFlateModule()->Encode(src_buf, src_size, &dest_buf, |
323 &dest_size)) { | 321 &dest_size)) { |
324 *filter = "/FlateDecode filter "; | 322 *filter = "/FlateDecode filter "; |
325 } | 323 } |
326 } else { | 324 } else { |
327 if (pEncoders && | 325 if (pEncoders && |
328 pEncoders->GetBasicModule()->RunLengthEncode(src_buf, src_size, | 326 pEncoders->GetBasicModule()->RunLengthEncode(src_buf, src_size, |
329 &dest_buf, &dest_size)) { | 327 &dest_buf, &dest_size)) { |
330 *filter = "/RunLengthDecode filter "; | 328 *filter = "/RunLengthDecode filter "; |
331 } | 329 } |
332 } | 330 } |
333 if (dest_size < src_size) { | 331 if (dest_size < src_size) { |
334 *output_buf = dest_buf; | 332 *output_buf = dest_buf; |
335 *output_size = dest_size; | 333 *output_size = dest_size; |
336 } else { | 334 } else { |
337 *filter = NULL; | 335 *filter = nullptr; |
338 FX_Free(dest_buf); | 336 FX_Free(dest_buf); |
339 } | 337 } |
340 } | 338 } |
341 | 339 |
342 bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, | 340 bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, |
343 uint32_t color, | 341 uint32_t color, |
344 int left, | 342 int left, |
345 int top) { | 343 int top) { |
346 StartRendering(); | 344 StartRendering(); |
347 CFX_Matrix matrix((FX_FLOAT)(pSource->GetWidth()), 0.0f, 0.0f, | 345 CFX_Matrix matrix((FX_FLOAT)(pSource->GetWidth()), 0.0f, 0.0f, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 FaxCompressData(src_buf, width, height, &output_buf, &output_size); | 398 FaxCompressData(src_buf, width, height, &output_buf, &output_size); |
401 if (pSource->IsAlphaMask()) { | 399 if (pSource->IsAlphaMask()) { |
402 SetColor(color); | 400 SetColor(color); |
403 m_bColorSet = false; | 401 m_bColorSet = false; |
404 buf << " true["; | 402 buf << " true["; |
405 } else { | 403 } else { |
406 buf << " 1["; | 404 buf << " 1["; |
407 } | 405 } |
408 buf << width << " 0 0 -" << height << " 0 " << height | 406 buf << width << " 0 0 -" << height << " 0 " << height |
409 << "]currentfile/ASCII85Decode filter "; | 407 << "]currentfile/ASCII85Decode filter "; |
410 if (output_buf.get() != src_buf) | 408 if (output_buf.get() != src_buf) { |
411 buf << "<</K -1/EndOfBlock false/Columns " << width << "/Rows " << height | 409 buf << "<</K -1/EndOfBlock false/Columns " << width << "/Rows " << height |
412 << ">>/CCITTFaxDecode filter "; | 410 << ">>/CCITTFaxDecode filter "; |
| 411 } |
413 if (pSource->IsAlphaMask()) { | 412 if (pSource->IsAlphaMask()) { |
414 buf << "iM\n"; | 413 buf << "iM\n"; |
415 } else { | 414 } else { |
416 buf << "false 1 colorimage\n"; | 415 buf << "false 1 colorimage\n"; |
417 } | 416 } |
418 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); | 417 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); |
419 WritePSBinary(output_buf.get(), output_size); | 418 WritePSBinary(output_buf.get(), output_size); |
420 output_buf.release(); | 419 output_buf.release(); |
421 } else { | 420 } else { |
422 CFX_MaybeOwned<CFX_DIBSource> pConverted((CFX_DIBSource*)pSource); | 421 CFX_DIBExtractor source_extractor(pSource); |
| 422 CFX_MaybeOwned<CFX_DIBSource> pConverted(source_extractor.GetBitmap()); |
| 423 if (!pConverted.Get()) |
| 424 return false; |
423 switch (pSource->GetFormat()) { | 425 switch (pSource->GetFormat()) { |
424 case FXDIB_1bppRgb: | 426 case FXDIB_1bppRgb: |
425 case FXDIB_Rgb32: | 427 case FXDIB_Rgb32: |
426 pConverted = pSource->CloneConvert(FXDIB_Rgb); | 428 pConverted = pConverted->CloneConvert(FXDIB_Rgb).release(); |
427 break; | 429 break; |
428 case FXDIB_8bppRgb: | 430 case FXDIB_8bppRgb: |
429 if (pSource->GetPalette()) { | 431 if (pSource->GetPalette()) { |
430 pConverted = pSource->CloneConvert(FXDIB_Rgb); | 432 pConverted = pConverted->CloneConvert(FXDIB_Rgb).release(); |
431 } | 433 } |
432 break; | 434 break; |
433 case FXDIB_1bppCmyk: | 435 case FXDIB_1bppCmyk: |
434 pConverted = pSource->CloneConvert(FXDIB_Cmyk); | 436 pConverted = pConverted->CloneConvert(FXDIB_Cmyk).release(); |
435 break; | 437 break; |
436 case FXDIB_8bppCmyk: | 438 case FXDIB_8bppCmyk: |
437 if (pSource->GetPalette()) { | 439 if (pSource->GetPalette()) { |
438 pConverted = pSource->CloneConvert(FXDIB_Cmyk); | 440 pConverted = pConverted->CloneConvert(FXDIB_Cmyk).release(); |
439 } | 441 } |
440 break; | 442 break; |
441 default: | 443 default: |
442 break; | 444 break; |
443 } | 445 } |
444 if (!pConverted) { | 446 if (!pConverted) { |
445 OUTPUT_PS("\nQ\n"); | 447 OUTPUT_PS("\nQ\n"); |
446 return false; | 448 return false; |
447 } | 449 } |
448 int Bpp = pConverted->GetBPP() / 8; | 450 int bpp = pConverted->GetBPP() / 8; |
449 uint8_t* output_buf = nullptr; | 451 uint8_t* output_buf = nullptr; |
450 FX_STRSIZE output_size = 0; | 452 FX_STRSIZE output_size = 0; |
451 const FX_CHAR* filter = nullptr; | 453 const FX_CHAR* filter = nullptr; |
452 if (flags & FXRENDER_IMAGE_LOSSY) { | 454 if ((m_PSLevel == 2 || flags & FXRENDER_IMAGE_LOSSY) && |
453 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); | 455 CCodec_JpegModule::JpegEncode(pConverted.Get(), &output_buf, |
454 if (pEncoders && | 456 &output_size)) { |
455 pEncoders->GetJpegModule()->JpegEncode(pConverted.Get(), &output_buf, | 457 filter = "/DCTDecode filter "; |
456 &output_size)) { | |
457 filter = "/DCTDecode filter "; | |
458 } | |
459 } | 458 } |
460 if (!filter) { | 459 if (!filter) { |
461 int src_pitch = width * Bpp; | 460 int src_pitch = width * bpp; |
462 output_size = height * src_pitch; | 461 output_size = height * src_pitch; |
463 output_buf = FX_Alloc(uint8_t, output_size); | 462 output_buf = FX_Alloc(uint8_t, output_size); |
464 for (int row = 0; row < height; row++) { | 463 for (int row = 0; row < height; row++) { |
465 const uint8_t* src_scan = pConverted->GetScanline(row); | 464 const uint8_t* src_scan = pConverted->GetScanline(row); |
466 uint8_t* dest_scan = output_buf + row * src_pitch; | 465 uint8_t* dest_scan = output_buf + row * src_pitch; |
467 if (Bpp == 3) { | 466 if (bpp == 3) { |
468 for (int col = 0; col < width; col++) { | 467 for (int col = 0; col < width; col++) { |
469 *dest_scan++ = src_scan[2]; | 468 *dest_scan++ = src_scan[2]; |
470 *dest_scan++ = src_scan[1]; | 469 *dest_scan++ = src_scan[1]; |
471 *dest_scan++ = *src_scan; | 470 *dest_scan++ = *src_scan; |
472 src_scan += 3; | 471 src_scan += 3; |
473 } | 472 } |
474 } else { | 473 } else { |
475 FXSYS_memcpy(dest_scan, src_scan, src_pitch); | 474 FXSYS_memcpy(dest_scan, src_scan, src_pitch); |
476 } | 475 } |
477 } | 476 } |
478 uint8_t* compressed_buf; | 477 uint8_t* compressed_buf; |
479 uint32_t compressed_size; | 478 uint32_t compressed_size; |
480 PSCompressData(m_PSLevel, output_buf, output_size, &compressed_buf, | 479 PSCompressData(m_PSLevel, output_buf, output_size, &compressed_buf, |
481 &compressed_size, &filter); | 480 &compressed_size, &filter); |
482 if (output_buf != compressed_buf) { | 481 if (output_buf != compressed_buf) { |
483 FX_Free(output_buf); | 482 FX_Free(output_buf); |
484 } | 483 } |
485 output_buf = compressed_buf; | 484 output_buf = compressed_buf; |
486 output_size = compressed_size; | 485 output_size = compressed_size; |
487 } | 486 } |
488 CFX_DIBSource* converted = pConverted.Get(); | |
489 if (converted != pSource) { | |
490 delete converted; | |
491 pConverted.Reset(); | |
492 } | |
493 buf << " 8["; | 487 buf << " 8["; |
494 buf << width << " 0 0 -" << height << " 0 " << height << "]"; | 488 buf << width << " 0 0 -" << height << " 0 " << height << "]"; |
495 buf << "currentfile/ASCII85Decode filter "; | 489 buf << "currentfile/ASCII85Decode filter "; |
496 if (filter) { | 490 if (filter) { |
497 buf << filter; | 491 buf << filter; |
498 } | 492 } |
499 buf << "false " << Bpp; | 493 buf << "false " << bpp; |
500 buf << " colorimage\n"; | 494 buf << " colorimage\n"; |
501 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); | 495 m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize()); |
502 WritePSBinary(output_buf, output_size); | 496 WritePSBinary(output_buf, output_size); |
503 FX_Free(output_buf); | 497 FX_Free(output_buf); |
504 } | 498 } |
505 OUTPUT_PS("\nQ\n"); | 499 OUTPUT_PS("\nQ\n"); |
506 return true; | 500 return true; |
507 } | 501 } |
508 | 502 |
509 void CFX_PSRenderer::SetColor(uint32_t color) { | 503 void CFX_PSRenderer::SetColor(uint32_t color) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); | 673 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); |
680 if (pEncoders && | 674 if (pEncoders && |
681 pEncoders->GetBasicModule()->A85Encode(data, len, &dest_buf, | 675 pEncoders->GetBasicModule()->A85Encode(data, len, &dest_buf, |
682 &dest_size)) { | 676 &dest_size)) { |
683 m_pOutput->OutputPS((const FX_CHAR*)dest_buf, dest_size); | 677 m_pOutput->OutputPS((const FX_CHAR*)dest_buf, dest_size); |
684 FX_Free(dest_buf); | 678 FX_Free(dest_buf); |
685 } else { | 679 } else { |
686 m_pOutput->OutputPS((const FX_CHAR*)data, len); | 680 m_pOutput->OutputPS((const FX_CHAR*)data, len); |
687 } | 681 } |
688 } | 682 } |
OLD | NEW |