| 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 "pageint.h" | 7 #include "pageint.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/fpdf_page.h" | 9 #include "core/include/fpdfapi/fpdf_page.h" |
| 10 #include "core/include/fpdfapi/fpdf_pageobj.h" | 10 #include "core/include/fpdfapi/fpdf_pageobj.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 void CPDF_ImageObject::CopyData(const CPDF_PageObject* pSrc) { | 27 void CPDF_ImageObject::CopyData(const CPDF_PageObject* pSrc) { |
| 28 const CPDF_ImageObject* pSrcObj = (const CPDF_ImageObject*)pSrc; | 28 const CPDF_ImageObject* pSrcObj = (const CPDF_ImageObject*)pSrc; |
| 29 if (m_pImage) { | 29 if (m_pImage) { |
| 30 m_pImage->Release(); | 30 m_pImage->Release(); |
| 31 } | 31 } |
| 32 m_pImage = pSrcObj->m_pImage->Clone(); | 32 m_pImage = pSrcObj->m_pImage->Clone(); |
| 33 m_Matrix = pSrcObj->m_Matrix; | 33 m_Matrix = pSrcObj->m_Matrix; |
| 34 } | 34 } |
| 35 void CPDF_ImageObject::Transform(const CFX_AffineMatrix& matrix) { | 35 void CPDF_ImageObject::Transform(const CFX_Matrix& matrix) { |
| 36 m_Matrix.Concat(matrix); | 36 m_Matrix.Concat(matrix); |
| 37 CalcBoundingBox(); | 37 CalcBoundingBox(); |
| 38 } | 38 } |
| 39 void CPDF_ImageObject::CalcBoundingBox() { | 39 void CPDF_ImageObject::CalcBoundingBox() { |
| 40 m_Left = m_Bottom = 0; | 40 m_Left = m_Bottom = 0; |
| 41 m_Right = m_Top = 1.0f; | 41 m_Right = m_Top = 1.0f; |
| 42 m_Matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom); | 42 m_Matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom); |
| 43 } | 43 } |
| 44 void CPDF_Image::Release() { | 44 void CPDF_Image::Release() { |
| 45 if (m_bInline || (m_pStream && m_pStream->GetObjNum() == 0)) { | 45 if (m_bInline || (m_pStream && m_pStream->GetObjNum() == 0)) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 m_pInlineDict = ToDictionary(pDict->Clone()); | 89 m_pInlineDict = ToDictionary(pDict->Clone()); |
| 90 } | 90 } |
| 91 m_pOC = pDict->GetDict(FX_BSTRC("OC")); | 91 m_pOC = pDict->GetDict(FX_BSTRC("OC")); |
| 92 m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) || | 92 m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) || |
| 93 pDict->GetInteger(FX_BSTRC("ImageMask")); | 93 pDict->GetInteger(FX_BSTRC("ImageMask")); |
| 94 m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate")); | 94 m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate")); |
| 95 m_Height = pDict->GetInteger(FX_BSTRC("Height")); | 95 m_Height = pDict->GetInteger(FX_BSTRC("Height")); |
| 96 m_Width = pDict->GetInteger(FX_BSTRC("Width")); | 96 m_Width = pDict->GetInteger(FX_BSTRC("Width")); |
| 97 return TRUE; | 97 return TRUE; |
| 98 } | 98 } |
| OLD | NEW |