Skip to content

Commit

Permalink
Add unit-tests for colorspace.js
Browse files Browse the repository at this point in the history
Added unit-tests for DeviceGray, DeviceRGB and DeviceCMYK

Added unit-tests for CalGray

Added unit-tests for CalRGB

Removed redundant code

Added unit-tests for LabCS

Added unit-tests for IndexedCS

Update comment

Change lookup to Uint8Array as mentioned in pdf specs(these tests will pass after PR mozilla#8666 is merged).

Added unit-tests for AlternateCS

Resolved code-style issues

Fixed code-style issues

Addressed issues pointed out in mozilla#8611 (review)
  • Loading branch information
apoorv-mishra committed Jul 28, 2017
1 parent 343b4dc commit a129de7
Show file tree
Hide file tree
Showing 4 changed files with 549 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/core/colorspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,11 +1111,7 @@ var CalRGBCS = (function CalRGBCSClosure() {
}

CalRGBCS.prototype = {
getRgb: function CalRGBCS_getRgb(src, srcOffset) {
var rgb = new Uint8Array(3);
this.getRgbItem(src, srcOffset, rgb, 0);
return rgb;
},
getRgb: ColorSpace.prototype.getRgb,
getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset,
dest, destOffset) {
convertToRgb(this, src, srcOffset, dest, destOffset, 1);
Expand Down
1 change: 1 addition & 0 deletions test/unit/clitests.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"bidi_spec.js",
"cff_parser_spec.js",
"cmap_spec.js",
"colorspace_spec.js",
"crypto_spec.js",
"display_svg_spec.js",
"document_spec.js",
Expand Down
Loading

0 comments on commit a129de7

Please sign in to comment.