Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2020-05-17 22:25:18 +0300
committerMarti Maria <marti.maria@littlecms.com>2020-05-17 22:25:18 +0300
commitea174b2f38b0cb782c61a603ca4117d4b2147cd7 (patch)
tree097a11a83d80dd7580d1693e925e730d356d0cf5 /plugins
parent4e37740976f89c829fe31be9ebd7745ba3e296de (diff)
get rid of bsc files & activate change format
- get rid of bsc files - activate change format feature on plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/fast_float/Projects/VC2019/lcms2_fast_float_plugin.vcxproj2
-rw-r--r--plugins/fast_float/src/fast_16_tethra.c4
-rw-r--r--plugins/fast_float/testbed/fast_float_testbed.c42
3 files changed, 43 insertions, 5 deletions
diff --git a/plugins/fast_float/Projects/VC2019/lcms2_fast_float_plugin.vcxproj b/plugins/fast_float/Projects/VC2019/lcms2_fast_float_plugin.vcxproj
index 7a1360c..904f049 100644
--- a/plugins/fast_float/Projects/VC2019/lcms2_fast_float_plugin.vcxproj
+++ b/plugins/fast_float/Projects/VC2019/lcms2_fast_float_plugin.vcxproj
@@ -151,7 +151,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\include;..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <BrowseInformation>true</BrowseInformation>
+ <BrowseInformation>false</BrowseInformation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
diff --git a/plugins/fast_float/src/fast_16_tethra.c b/plugins/fast_float/src/fast_16_tethra.c
index ce6a07f..6808fd3 100644
--- a/plugins/fast_float/src/fast_16_tethra.c
+++ b/plugins/fast_float/src/fast_16_tethra.c
@@ -71,7 +71,7 @@ void Performance16free(cmsContext ContextID, void* ptr)
#define TO_OUTPUT(d,v) do { if (out16) TO_OUTPUT_16(d,v); else TO_OUTPUT_8(d,v); } while(0)
-#define FROM_INPUT(v) in16 ? (*((const cmsUInt16Number*)v)) : *((const cmsUInt8Number*)v);
+#define FROM_INPUT(v) (in16 ? (*((const cmsUInt16Number*)(v))) : FROM_8_TO_16(*((const cmsUInt8Number*)(v))))
static
void PerformanceEval16(struct _cmstransform_struct *CMMcargo,
@@ -367,7 +367,7 @@ cmsBool Optimize16BitRGBTransform(_cmsTransformFn* TransformFn,
*FreeDataFn = Performance16free;
*InputFormat |= 0x02000000;
*OutputFormat |= 0x02000000;
- *dwFlags &= ~cmsFLAGS_CAN_CHANGE_FORMATTER;
+ *dwFlags |= cmsFLAGS_CAN_CHANGE_FORMATTER;
return TRUE;
}
diff --git a/plugins/fast_float/testbed/fast_float_testbed.c b/plugins/fast_float/testbed/fast_float_testbed.c
index d209fc0..59e1d68 100644
--- a/plugins/fast_float/testbed/fast_float_testbed.c
+++ b/plugins/fast_float/testbed/fast_float_testbed.c
@@ -544,7 +544,7 @@ void CheckAccuracy16Bits(void)
static
cmsBool ValidFloat(cmsFloat32Number a, cmsFloat32Number b)
{
- return fabs(a-b) < EPSILON_FLOAT_TESTS;
+ return fabsf(a-b) < EPSILON_FLOAT_TESTS;
}
// Do an in-depth test by checking all RGB cube of 8 bits, going from profilein to profileout.
@@ -784,6 +784,41 @@ void TryAllValuesFloatVs16(cmsHPROFILE hlcmsProfileIn, cmsHPROFILE hlcmsProfileO
}
+// Check change format feature
+static
+void CheckChangeFormat(void)
+{
+ cmsHPROFILE hsRGB, hLab;
+ cmsHTRANSFORM xform;
+ cmsUInt8Number rgb8[3] = { 10, 120, 40 };
+ cmsUInt16Number rgb16[3] = { 10* 257, 120*257, 40*257 };
+ cmsUInt16Number lab16_1[3], lab16_2[3];
+
+ printf("Checking change format feature...");
+
+ hsRGB = cmsCreate_sRGBProfile();
+ hLab = cmsCreateLab4Profile(NULL);
+
+
+ xform = cmsCreateTransform(hsRGB, TYPE_RGB_16, hLab, TYPE_Lab_16, INTENT_PERCEPTUAL, 0);
+
+ cmsCloseProfile(hsRGB);
+ cmsCloseProfile(hLab);
+
+ cmsDoTransform(xform, rgb16, lab16_1, 1);
+
+ cmsChangeBuffersFormat(xform, TYPE_RGB_8, TYPE_Lab_16);
+
+ cmsDoTransform(xform, rgb8, lab16_2, 1);
+ cmsDeleteTransform(xform);
+
+ if (memcmp(lab16_1, lab16_2, sizeof(lab16_1)) != 0)
+ Fail("Change format failed!");
+
+ printf("Ok\n");
+
+}
+
// Convert some known values
static
void CheckConversionFloat(void)
@@ -1666,6 +1701,9 @@ int main()
// 16 bits functionality
CheckAccuracy16Bits();
+ // Change format
+ CheckChangeFormat();
+
// Floating point functionality
CheckConversionFloat();
printf("All floating point tests passed OK\n");
@@ -1681,7 +1719,7 @@ int main()
// Test gray performance
printf("\n\n");
- printf("FLOAT GRAY conversions performance.\n");
+ printf("F L O A T G R A Y conversions performance.\n");
printf("====================================================================\n");
TestGrayTransformPerformance();
TestGrayTransformPerformance1();