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

Unified Diff: core/src/fxcrt/fx_basic_util.cpp

Issue 403163002: CalRGB color correction (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Clean up Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_util.cpp
diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp
index dc5eea782187b039775b165301575ace295e902a..5a40c2b4be6e34bd4bffb0dfd2ef13556a58d1d1 100644
--- a/core/src/fxcrt/fx_basic_util.cpp
+++ b/core/src/fxcrt/fx_basic_util.cpp
@@ -442,3 +442,46 @@ FX_WCHAR FX_GetFolderSeparator()
return '/';
#endif
}
+
+CFX_Matrix_3by3 CFX_Matrix_3by3::Inverse()
+{
+ FX_FLOAT det = a*(e*i - f*h) - b*(i*d - f*g) + c*(d*h - e*g);
+ if (FXSYS_fabs(det) < 0.0000001)
+ return CFX_Matrix_3by3();
+ else
+ return CFX_Matrix_3by3(
+ (e*i - f*h) / det,
+ -(b*i - c*h) / det,
+ (b*f - c*e) / det,
+ -(d*i - f*g) / det,
+ (a*i - c*g) / det,
+ -(a*f - c*d) / det,
+ (d*h - e*g) / det,
+ -(a*h - b*g) / det,
+ (a*e - b*d) / det
+ );
+}
+
+CFX_Matrix_3by3 CFX_Matrix_3by3::Multiply(const CFX_Matrix_3by3 &m)
+{
+ return CFX_Matrix_3by3(
+ a*m.a + b*m.d + c*m.g,
+ a*m.b + b*m.e + c*m.h,
+ a*m.c + b*m.f + c*m.i,
+ d*m.a + e*m.d + f*m.g,
+ d*m.b + e*m.e + f*m.h,
+ d*m.c + e*m.f + f*m.i,
+ g*m.a + h*m.d + i*m.g,
+ g*m.b + h*m.e + i*m.h,
+ g*m.c + h*m.f + i*m.i
+ );
+}
+
+CFX_Vector_3by1 CFX_Matrix_3by3::TransformVector(const CFX_Vector_3by1 &v)
+{
+ return CFX_Vector_3by1(
+ a * v.a + b * v.b + c * v.c,
+ d * v.a + e * v.b + f * v.c,
+ g * v.a + h * v.b + i * v.c
+ );
+}
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698