summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/color.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/color.cpp')
-rw-r--r--fpdfsdk/javascript/color.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/fpdfsdk/javascript/color.cpp b/fpdfsdk/javascript/color.cpp
index 376eefa248..7bf3cc9c6f 100644
--- a/fpdfsdk/javascript/color.cpp
+++ b/fpdfsdk/javascript/color.cpp
@@ -39,24 +39,24 @@ JSMethodSpec CJS_Color::MethodSpecs[] = {{"convert", convert_static},
IMPLEMENT_JS_CLASS(CJS_Color, color)
color::color(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {
- m_crTransparent = CPWL_Color(COLORTYPE_TRANSPARENT);
- m_crBlack = CPWL_Color(COLORTYPE_GRAY, 0);
- m_crWhite = CPWL_Color(COLORTYPE_GRAY, 1);
- m_crRed = CPWL_Color(COLORTYPE_RGB, 1, 0, 0);
- m_crGreen = CPWL_Color(COLORTYPE_RGB, 0, 1, 0);
- m_crBlue = CPWL_Color(COLORTYPE_RGB, 0, 0, 1);
- m_crCyan = CPWL_Color(COLORTYPE_CMYK, 1, 0, 0, 0);
- m_crMagenta = CPWL_Color(COLORTYPE_CMYK, 0, 1, 0, 0);
- m_crYellow = CPWL_Color(COLORTYPE_CMYK, 0, 0, 1, 0);
- m_crDKGray = CPWL_Color(COLORTYPE_GRAY, 0.25);
- m_crGray = CPWL_Color(COLORTYPE_GRAY, 0.5);
- m_crLTGray = CPWL_Color(COLORTYPE_GRAY, 0.75);
+ m_crTransparent = CFX_Color(COLORTYPE_TRANSPARENT);
+ m_crBlack = CFX_Color(COLORTYPE_GRAY, 0);
+ m_crWhite = CFX_Color(COLORTYPE_GRAY, 1);
+ m_crRed = CFX_Color(COLORTYPE_RGB, 1, 0, 0);
+ m_crGreen = CFX_Color(COLORTYPE_RGB, 0, 1, 0);
+ m_crBlue = CFX_Color(COLORTYPE_RGB, 0, 0, 1);
+ m_crCyan = CFX_Color(COLORTYPE_CMYK, 1, 0, 0, 0);
+ m_crMagenta = CFX_Color(COLORTYPE_CMYK, 0, 1, 0, 0);
+ m_crYellow = CFX_Color(COLORTYPE_CMYK, 0, 0, 1, 0);
+ m_crDKGray = CFX_Color(COLORTYPE_GRAY, 0.25);
+ m_crGray = CFX_Color(COLORTYPE_GRAY, 0.5);
+ m_crLTGray = CFX_Color(COLORTYPE_GRAY, 0.75);
}
color::~color() {}
void color::ConvertPWLColorToArray(CJS_Runtime* pRuntime,
- const CPWL_Color& color,
+ const CFX_Color& color,
CJS_Array* array) {
switch (color.nColorType) {
case COLORTYPE_TRANSPARENT:
@@ -84,7 +84,7 @@ void color::ConvertPWLColorToArray(CJS_Runtime* pRuntime,
void color::ConvertArrayToPWLColor(CJS_Runtime* pRuntime,
const CJS_Array& array,
- CPWL_Color* color) {
+ CFX_Color* color) {
int nArrayLen = array.GetLength(pRuntime);
if (nArrayLen < 1)
return;
@@ -119,14 +119,14 @@ void color::ConvertArrayToPWLColor(CJS_Runtime* pRuntime,
}
if (sSpace == "T") {
- *color = CPWL_Color(COLORTYPE_TRANSPARENT);
+ *color = CFX_Color(COLORTYPE_TRANSPARENT);
} else if (sSpace == "G") {
- *color = CPWL_Color(COLORTYPE_GRAY, (float)d1);
+ *color = CFX_Color(COLORTYPE_GRAY, (float)d1);
} else if (sSpace == "RGB") {
- *color = CPWL_Color(COLORTYPE_RGB, (float)d1, (float)d2, (float)d3);
+ *color = CFX_Color(COLORTYPE_RGB, (float)d1, (float)d2, (float)d3);
} else if (sSpace == "CMYK") {
*color =
- CPWL_Color(COLORTYPE_CMYK, (float)d1, (float)d2, (float)d3, (float)d4);
+ CFX_Color(COLORTYPE_CMYK, (float)d1, (float)d2, (float)d3, (float)d4);
}
}
@@ -204,7 +204,7 @@ bool color::ltGray(CJS_Runtime* pRuntime,
bool color::PropertyHelper(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
- CPWL_Color* var) {
+ CFX_Color* var) {
CJS_Array array;
if (vp.IsGetting()) {
ConvertPWLColorToArray(pRuntime, *var, &array);
@@ -230,7 +230,7 @@ bool color::convert(CJS_Runtime* pRuntime,
if (!params[0].ConvertToArray(pRuntime, aSource))
return false;
- CPWL_Color crSource;
+ CFX_Color crSource;
ConvertArrayToPWLColor(pRuntime, aSource, &crSource);
CFX_ByteString sDestSpace = params[1].ToCFXByteString(pRuntime);
@@ -247,7 +247,7 @@ bool color::convert(CJS_Runtime* pRuntime,
}
CJS_Array aDest;
- CPWL_Color crDest = crSource.ConvertColorType(nColorType);
+ CFX_Color crDest = crSource.ConvertColorType(nColorType);
ConvertPWLColorToArray(pRuntime, crDest, &aDest);
vRet = CJS_Value(pRuntime, aDest);
@@ -268,8 +268,8 @@ bool color::equal(CJS_Runtime* pRuntime,
if (!params[1].ConvertToArray(pRuntime, array2))
return false;
- CPWL_Color color1;
- CPWL_Color color2;
+ CFX_Color color1;
+ CFX_Color color2;
ConvertArrayToPWLColor(pRuntime, array1, &color1);
ConvertArrayToPWLColor(pRuntime, array2, &color2);
color1 = color1.ConvertColorType(color2.nColorType);