Guest User

Untitled

a guest
Nov 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. char * colorType = getStringValue(env, funcParams[2], SPACELen);
  2. // m is either the value srgb | adobeRgb
  3. Matrix m = getEnumFromStr(colorType);
  4. Rgb * rgb = getRGBFromJSObj(env, funcParams[0]);
  5. xyz = generateXyzFromRgb(rgb, m);
  6.  
  7. const rgb = {
  8. r: 255,
  9. g: 255,
  10. b: 255
  11. };
  12.  
  13. const xyz = lib.getXyzFromRgb(rgb, "srgb", 10000);
  14. expect(xyz).to.be.deep.equal({
  15. x: 0.9504,
  16. y: 1,
  17. z: 1.0888
  18. });
  19.  
  20. {
  21. x: 0.9504,
  22. y: 1,
  23. z: 1.0888
  24. }
  25.  
  26. {
  27. x: 0.9502,
  28. y: 0.9997,
  29. z: 1.0886
  30. }
  31.  
  32. // RGB and & m variable is outputing the same value as the conversion done by the C code above
  33. xyz = generateXyzFromRgb(rgb, m);
Add Comment
Please, Sign In to add comment