Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Side by Side Diff: core/fpdfapi/fpdf_page/pageint.h

Issue 1828283002: support gradients and stroke+fill (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_FPDFAPI_FPDF_PAGE_PAGEINT_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_
8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ 8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 }; 376 };
377 377
378 class CPDF_Function { 378 class CPDF_Function {
379 public: 379 public:
380 static CPDF_Function* Load(CPDF_Object* pFuncObj); 380 static CPDF_Function* Load(CPDF_Object* pFuncObj);
381 virtual ~CPDF_Function(); 381 virtual ~CPDF_Function();
382 FX_BOOL Call(FX_FLOAT* inputs, 382 FX_BOOL Call(FX_FLOAT* inputs,
383 int ninputs, 383 int ninputs,
384 FX_FLOAT* results, 384 FX_FLOAT* results,
385 int& nresults) const; 385 int& nresults) const;
386 int CountInputs() { return m_nInputs; } 386 int CountInputs() const { return m_nInputs; }
387 int CountOutputs() { return m_nOutputs; } 387 int CountOutputs() const { return m_nOutputs; }
388 FX_FLOAT GetDomain(int i) const { return m_pDomains[i]; }
389 int GetType() const { return m_nType; }
388 390
389 protected: 391 protected:
390 CPDF_Function(); 392 CPDF_Function();
Tom Sepez 2016/03/24 18:07:07 nit: probably should take the type as a parameter,
caryclark 2016/03/25 20:47:56 Done.
391 int m_nInputs, m_nOutputs; 393 int m_nInputs, m_nOutputs;
Tom Sepez 2016/03/24 18:07:07 nit: one per line, also blank line between methods
caryclark 2016/03/25 20:47:56 Done.
392 FX_FLOAT* m_pDomains; 394 FX_FLOAT* m_pDomains;
393 FX_FLOAT* m_pRanges; 395 FX_FLOAT* m_pRanges;
396 int m_nType;
Tom Sepez 2016/03/24 18:07:08 nit: I'd put this as the first member.
caryclark 2016/03/25 20:47:55 Done.
394 FX_BOOL Init(CPDF_Object* pObj); 397 FX_BOOL Init(CPDF_Object* pObj);
Tom Sepez 2016/03/24 18:07:07 nit: move these to line 393.
caryclark 2016/03/25 20:47:55 Done.
395 virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0; 398 virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
396 virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0; 399 virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
397 }; 400 };
401
402 class CPDF_ExpIntFunc : public CPDF_Function {
403 public:
404 CPDF_ExpIntFunc();
405 ~CPDF_ExpIntFunc() override;
406
407 // CPDF_Function
408 FX_BOOL v_Init(CPDF_Object* pObj) override;
409 FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
410
411 FX_FLOAT m_Exponent;
412 FX_FLOAT* m_pBeginValues;
413 FX_FLOAT* m_pEndValues;
414 int m_nOrigOutputs;
Tom Sepez 2016/03/24 18:07:08 nit: may save 8 bytes per instance on 64 bits if t
caryclark 2016/03/25 20:47:55 Done.
415 };
416
417 class CPDF_StitchFunc : public CPDF_Function {
418 public:
419 CPDF_StitchFunc();
420 ~CPDF_StitchFunc() override;
421
422 // CPDF_Function
423 FX_BOOL v_Init(CPDF_Object* pObj) override;
424 FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
425
426 std::vector<CPDF_Function*> m_pSubFunctions;
427 FX_FLOAT* m_pBounds;
428 FX_FLOAT* m_pEncode;
429
430 static const int kRequiredNumInputs = 1;
431 };
432
398 class CPDF_IccProfile { 433 class CPDF_IccProfile {
399 public: 434 public:
400 CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize); 435 CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize);
401 ~CPDF_IccProfile(); 436 ~CPDF_IccProfile();
402 FX_DWORD GetComponents() const { return m_nSrcComponents; } 437 FX_DWORD GetComponents() const { return m_nSrcComponents; }
403 FX_BOOL m_bsRGB; 438 FX_BOOL m_bsRGB;
404 void* m_pTransform; 439 void* m_pTransform;
405 440
406 private: 441 private:
407 FX_DWORD m_nSrcComponents; 442 FX_DWORD m_nSrcComponents;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 CPDF_Pattern* m_pPattern; 493 CPDF_Pattern* m_pPattern;
459 CPDF_CountedPattern* m_pCountedPattern; 494 CPDF_CountedPattern* m_pCountedPattern;
460 int m_nComps; 495 int m_nComps;
461 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS]; 496 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS];
462 }; 497 };
463 498
464 void PDF_ReplaceAbbr(CPDF_Object* pObj); 499 void PDF_ReplaceAbbr(CPDF_Object* pObj);
465 bool IsPathOperator(const uint8_t* buf, size_t len); 500 bool IsPathOperator(const uint8_t* buf, size_t len);
466 501
467 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ 502 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698