OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfapi/fpdf_page/include/cpdf_image.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 CPDF_Image* CPDF_Image::Clone() { | 65 CPDF_Image* CPDF_Image::Clone() { |
66 if (m_pStream->GetObjNum()) | 66 if (m_pStream->GetObjNum()) |
67 return m_pDocument->GetPageData()->GetImage(m_pStream); | 67 return m_pDocument->GetPageData()->GetImage(m_pStream); |
68 | 68 |
69 CPDF_Image* pImage = | 69 CPDF_Image* pImage = |
70 new CPDF_Image(m_pDocument, ToStream(m_pStream->Clone()), m_bInline); | 70 new CPDF_Image(m_pDocument, ToStream(m_pStream->Clone()), m_bInline); |
71 if (m_bInline) | 71 if (m_bInline) |
72 pImage->SetInlineDict(ToDictionary(m_pInlineDict->Clone(TRUE))); | 72 pImage->SetInlineDict(ToDictionary(m_pInlineDict->CloneDirectObject())); |
73 | 73 |
74 return pImage; | 74 return pImage; |
75 } | 75 } |
76 | 76 |
77 CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) { | 77 CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) { |
78 int32_t width; | 78 int32_t width; |
79 int32_t height; | 79 int32_t height; |
80 int32_t num_comps; | 80 int32_t num_comps; |
81 int32_t bits; | 81 int32_t bits; |
82 bool color_trans; | 82 bool color_trans; |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } | 400 } |
401 if (!ret) { | 401 if (!ret) { |
402 delete m_pDIBSource; | 402 delete m_pDIBSource; |
403 m_pDIBSource = nullptr; | 403 m_pDIBSource = nullptr; |
404 return FALSE; | 404 return FALSE; |
405 } | 405 } |
406 m_pMask = pSource->DetachMask(); | 406 m_pMask = pSource->DetachMask(); |
407 m_MatteColor = pSource->GetMatteColor(); | 407 m_MatteColor = pSource->GetMatteColor(); |
408 return FALSE; | 408 return FALSE; |
409 } | 409 } |
OLD | NEW |