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 <algorithm> |
| 8 |
7 #include "core/include/fxcrt/fx_ext.h" | 9 #include "core/include/fxcrt/fx_ext.h" |
8 #include "fpdfsdk/include/fsdk_baseannot.h" | 10 #include "fpdfsdk/include/fsdk_baseannot.h" |
9 #include "fpdfsdk/include/fsdk_define.h" | 11 #include "fpdfsdk/include/fsdk_define.h" |
10 #include "fpdfsdk/include/fsdk_mgr.h" | 12 #include "fpdfsdk/include/fsdk_mgr.h" |
11 | 13 |
12 int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { | 14 int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { |
13 return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60); | 15 return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60); |
14 } | 16 } |
15 | 17 |
16 FX_BOOL _gAfxIsLeapYear(int16_t year) { | 18 FX_BOOL _gAfxIsLeapYear(int16_t year) { |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 | 810 |
809 color = FXSYS_RGB((int)r, (int)g, (int)b); | 811 color = FXSYS_RGB((int)r, (int)g, (int)b); |
810 | 812 |
811 return TRUE; | 813 return TRUE; |
812 } else if (nCount == 4) { | 814 } else if (nCount == 4) { |
813 FX_FLOAT c = pEntry->GetNumber(0); | 815 FX_FLOAT c = pEntry->GetNumber(0); |
814 FX_FLOAT m = pEntry->GetNumber(1); | 816 FX_FLOAT m = pEntry->GetNumber(1); |
815 FX_FLOAT y = pEntry->GetNumber(2); | 817 FX_FLOAT y = pEntry->GetNumber(2); |
816 FX_FLOAT k = pEntry->GetNumber(3); | 818 FX_FLOAT k = pEntry->GetNumber(3); |
817 | 819 |
818 FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k); | 820 FX_FLOAT r = 1.0f - std::min(1.0f, c + k); |
819 FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k); | 821 FX_FLOAT g = 1.0f - std::min(1.0f, m + k); |
820 FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k); | 822 FX_FLOAT b = 1.0f - std::min(1.0f, y + k); |
821 | 823 |
822 color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255)); | 824 color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255)); |
823 | 825 |
824 return TRUE; | 826 return TRUE; |
825 } | 827 } |
826 } | 828 } |
827 | 829 |
828 return FALSE; | 830 return FALSE; |
829 } | 831 } |
830 | 832 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 963 |
962 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { | 964 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { |
963 return GetPDFPage(); | 965 return GetPDFPage(); |
964 } | 966 } |
965 | 967 |
966 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | 968 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { |
967 if (m_pPageView) | 969 if (m_pPageView) |
968 return m_pPageView->GetPDFPage(); | 970 return m_pPageView->GetPDFPage(); |
969 return NULL; | 971 return NULL; |
970 } | 972 } |
OLD | NEW |