1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Introduce ImageKind constants.

This commit is contained in:
Nicholas Nethercote 2014-02-25 15:11:15 -08:00
parent 4e1f92a893
commit 42cbb5b440
4 changed files with 21 additions and 15 deletions

View file

@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals ColorSpace, error, isArray, isStream, JpegStream, Name, Promise,
Stream, warn, LegacyPromise */
/* globals ColorSpace, error, isArray, ImageKind, isStream, JpegStream, Name,
Promise, Stream, warn, LegacyPromise */
'use strict';
@ -444,9 +444,9 @@ var PDFImage = (function PDFImageClosure() {
// complications, we avoid expanding by 1.333x to RGBA form.
var kind;
if (this.colorSpace.name === 'DeviceGray' && bpc === 1) {
kind = 'grayscale_1bpp';
kind = ImageKind.GRAYSCALE_1BPP;
} else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8) {
kind = 'rgb_24bpp';
kind = ImageKind.RGB_24BPP;
}
if (kind && !this.smask && !this.mask && !this.needsDecode &&
drawWidth === originalWidth && drawHeight === originalHeight) {
@ -482,7 +482,7 @@ var PDFImage = (function PDFImageClosure() {
this.undoPreblend(rgbaBuf, drawWidth, actualHeight);
imgData.kind = 'rgba_32bpp';
imgData.kind = ImageKind.RGBA_32BPP;
imgData.data = rgbaBuf;
return imgData;
},