Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of RGBA buffers in CalRGB colorspace (issue 5270) #5276

Merged
merged 1 commit into from
Sep 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/core/colorspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,20 +1080,21 @@ var CalRGBCS = (function CalRGBCSClosure() {
convertToRgb(this, src, srcOffset, dest, destOffset, 1);
},
getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count,
dest, destOffset, bits) {
dest, destOffset, bits,
alpha01) {
var scale = 1 / ((1 << bits) - 1);

for (var i = 0; i < count; ++i) {
convertToRgb(this, src, srcOffset, dest, destOffset, scale);
srcOffset += 3;
destOffset += 3;
destOffset += 3 + alpha01;
}
},
getOutputLength: function CalRGBCS_getOutputLength(inputLength) {
return inputLength;
getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) {
return (inputLength * (3 + alpha01) / 3) | 0;
},
isPassthrough: ColorSpace.prototype.isPassthrough,
createRgbBuffer: ColorSpace.prototype.createRgbBuffer,
fillRgb: ColorSpace.prototype.fillRgb,
isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
},
Expand Down