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 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 public: | 428 public: |
429 static CPDF_ColorSpace* GetStockCS(int Family); | 429 static CPDF_ColorSpace* GetStockCS(int Family); |
430 | 430 |
431 static CPDF_ColorSpace* Load(CPDF_Document* pDoc, CPDF_Object* pCSObj); | 431 static CPDF_ColorSpace* Load(CPDF_Document* pDoc, CPDF_Object* pCSObj); |
432 | 432 |
433 void ReleaseCS(); | 433 void ReleaseCS(); |
434 | 434 |
435 int GetBufSize() const; | 435 int GetBufSize() const; |
436 FX_FLOAT* CreateBuf(); | 436 FX_FLOAT* CreateBuf(); |
437 void GetDefaultColor(FX_FLOAT* buf) const; | 437 void GetDefaultColor(FX_FLOAT* buf) const; |
438 int CountComponents() const { return m_nComponents; } | 438 FX_DWORD CountComponents() const { return m_nComponents; } |
439 int GetFamily() const { return m_Family; } | 439 int GetFamily() const { return m_Family; } |
440 virtual void GetDefaultValue(int iComponent, | 440 virtual void GetDefaultValue(int iComponent, |
441 FX_FLOAT& value, | 441 FX_FLOAT& value, |
442 FX_FLOAT& min, | 442 FX_FLOAT& min, |
443 FX_FLOAT& max) const { | 443 FX_FLOAT& max) const { |
444 value = 0; | 444 value = 0; |
445 min = 0; | 445 min = 0; |
446 max = 1.0f; | 446 max = 1.0f; |
447 } | 447 } |
448 | 448 |
(...skipping 29 matching lines...) Expand all Loading... |
478 | 478 |
479 CPDF_Array*& GetArray() { return m_pArray; } | 479 CPDF_Array*& GetArray() { return m_pArray; } |
480 int GetMaxIndex() const; | 480 int GetMaxIndex() const; |
481 virtual CPDF_ColorSpace* GetBaseCS() const { return NULL; } | 481 virtual CPDF_ColorSpace* GetBaseCS() const { return NULL; } |
482 | 482 |
483 virtual void EnableStdConversion(FX_BOOL bEnabled); | 483 virtual void EnableStdConversion(FX_BOOL bEnabled); |
484 | 484 |
485 CPDF_Document* const m_pDocument; | 485 CPDF_Document* const m_pDocument; |
486 | 486 |
487 protected: | 487 protected: |
488 CPDF_ColorSpace(CPDF_Document* pDoc, int family, int nComponents) | 488 CPDF_ColorSpace(CPDF_Document* pDoc, int family, FX_DWORD nComponents) |
489 : m_pDocument(pDoc), | 489 : m_pDocument(pDoc), |
490 m_Family(family), | 490 m_Family(family), |
491 m_nComponents(nComponents), | 491 m_nComponents(nComponents), |
492 m_pArray(nullptr), | 492 m_pArray(nullptr), |
493 m_dwStdConversion(0) {} | 493 m_dwStdConversion(0) {} |
494 virtual ~CPDF_ColorSpace() {} | 494 virtual ~CPDF_ColorSpace() {} |
495 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { | 495 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { |
496 return TRUE; | 496 return TRUE; |
497 } | 497 } |
498 virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, | 498 virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, |
499 FX_FLOAT& c, | 499 FX_FLOAT& c, |
500 FX_FLOAT& m, | 500 FX_FLOAT& m, |
501 FX_FLOAT& y, | 501 FX_FLOAT& y, |
502 FX_FLOAT& k) const { | 502 FX_FLOAT& k) const { |
503 return FALSE; | 503 return FALSE; |
504 } | 504 } |
505 virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, | 505 virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, |
506 FX_FLOAT c, | 506 FX_FLOAT c, |
507 FX_FLOAT m, | 507 FX_FLOAT m, |
508 FX_FLOAT y, | 508 FX_FLOAT y, |
509 FX_FLOAT k) const { | 509 FX_FLOAT k) const { |
510 return FALSE; | 510 return FALSE; |
511 } | 511 } |
512 | 512 |
513 int m_Family; | 513 int m_Family; |
514 | 514 FX_DWORD m_nComponents; |
515 int m_nComponents; | |
516 | |
517 CPDF_Array* m_pArray; | 515 CPDF_Array* m_pArray; |
518 | |
519 FX_DWORD m_dwStdConversion; | 516 FX_DWORD m_dwStdConversion; |
520 }; | 517 }; |
521 class CPDF_Color { | 518 class CPDF_Color { |
522 public: | 519 public: |
523 CPDF_Color() : m_pCS(NULL), m_pBuffer(NULL) {} | 520 CPDF_Color() : m_pCS(NULL), m_pBuffer(NULL) {} |
524 | 521 |
525 CPDF_Color(int family); | 522 CPDF_Color(int family); |
526 | 523 |
527 ~CPDF_Color(); | 524 ~CPDF_Color(); |
528 | 525 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 | 764 |
768 FX_BOOL m_bInterpolate; | 765 FX_BOOL m_bInterpolate; |
769 | 766 |
770 CPDF_Document* m_pDocument; | 767 CPDF_Document* m_pDocument; |
771 | 768 |
772 CPDF_Dictionary* m_pOC; | 769 CPDF_Dictionary* m_pOC; |
773 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); | 770 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); |
774 }; | 771 }; |
775 | 772 |
776 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 773 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
OLD | NEW |