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

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: address comments 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 CPDF_ColorSpaceMap m_ColorSpaceMap; 370 CPDF_ColorSpaceMap m_ColorSpaceMap;
371 CPDF_FontFileMap m_FontFileMap; 371 CPDF_FontFileMap m_FontFileMap;
372 CPDF_FontMap m_FontMap; 372 CPDF_FontMap m_FontMap;
373 CPDF_IccProfileMap m_IccProfileMap; 373 CPDF_IccProfileMap m_IccProfileMap;
374 CPDF_ImageMap m_ImageMap; 374 CPDF_ImageMap m_ImageMap;
375 CPDF_PatternMap m_PatternMap; 375 CPDF_PatternMap m_PatternMap;
376 }; 376 };
377 377
378 class CPDF_Function { 378 class CPDF_Function {
379 public: 379 public:
380 enum class Type {
381 kType0Sampled,
382 kType2ExpotentialInterpolation,
383 kType3Stitching,
384 kType4PostScript,
385 };
386
380 static CPDF_Function* Load(CPDF_Object* pFuncObj); 387 static CPDF_Function* Load(CPDF_Object* pFuncObj);
381 virtual ~CPDF_Function(); 388 virtual ~CPDF_Function();
382 FX_BOOL Call(FX_FLOAT* inputs, 389 FX_BOOL Call(FX_FLOAT* inputs,
383 int ninputs, 390 int ninputs,
384 FX_FLOAT* results, 391 FX_FLOAT* results,
385 int& nresults) const; 392 int& nresults) const;
386 int CountInputs() { return m_nInputs; } 393 int CountInputs() const { return m_nInputs; }
387 int CountOutputs() { return m_nOutputs; } 394 int CountOutputs() const { return m_nOutputs; }
395 FX_FLOAT GetDomain(int i) const { return m_pDomains[i]; }
396 Type GetType() const { return m_Type; }
388 397
389 protected: 398 protected:
390 CPDF_Function(); 399 CPDF_Function(Type type);
391 int m_nInputs, m_nOutputs;
392 FX_FLOAT* m_pDomains;
393 FX_FLOAT* m_pRanges;
394 FX_BOOL Init(CPDF_Object* pObj); 400 FX_BOOL Init(CPDF_Object* pObj);
395 virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0; 401 virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
396 virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0; 402 virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
403
404 int m_nInputs;
405 int m_nOutputs;
406 FX_FLOAT* m_pDomains;
407 FX_FLOAT* m_pRanges;
408 Type m_Type;
397 }; 409 };
410
411 class CPDF_ExpIntFunc : public CPDF_Function {
412 public:
413 CPDF_ExpIntFunc();
414 ~CPDF_ExpIntFunc() override;
415
416 // CPDF_Function
417 FX_BOOL v_Init(CPDF_Object* pObj) override;
418 FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
419
420 int m_nOrigOutputs;
421 FX_FLOAT m_Exponent;
422 FX_FLOAT* m_pBeginValues;
423 FX_FLOAT* m_pEndValues;
424 };
425
426 class CPDF_StitchFunc : public CPDF_Function {
427 public:
428 CPDF_StitchFunc();
429 ~CPDF_StitchFunc() override;
430
431 // CPDF_Function
432 FX_BOOL v_Init(CPDF_Object* pObj) override;
433 FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
434
435 std::vector<CPDF_Function*> m_pSubFunctions;
436 FX_FLOAT* m_pBounds;
437 FX_FLOAT* m_pEncode;
438
439 static const int kRequiredNumInputs = 1;
440 };
441
398 class CPDF_IccProfile { 442 class CPDF_IccProfile {
399 public: 443 public:
400 CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize); 444 CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize);
401 ~CPDF_IccProfile(); 445 ~CPDF_IccProfile();
402 FX_DWORD GetComponents() const { return m_nSrcComponents; } 446 FX_DWORD GetComponents() const { return m_nSrcComponents; }
403 FX_BOOL m_bsRGB; 447 FX_BOOL m_bsRGB;
404 void* m_pTransform; 448 void* m_pTransform;
405 449
406 private: 450 private:
407 FX_DWORD m_nSrcComponents; 451 FX_DWORD m_nSrcComponents;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 CPDF_Pattern* m_pPattern; 502 CPDF_Pattern* m_pPattern;
459 CPDF_CountedPattern* m_pCountedPattern; 503 CPDF_CountedPattern* m_pCountedPattern;
460 int m_nComps; 504 int m_nComps;
461 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS]; 505 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS];
462 }; 506 };
463 507
464 void PDF_ReplaceAbbr(CPDF_Object* pObj); 508 void PDF_ReplaceAbbr(CPDF_Object* pObj);
465 bool IsPathOperator(const uint8_t* buf, size_t len); 509 bool IsPathOperator(const uint8_t* buf, size_t len);
466 510
467 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ 511 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698