Commit d7a2de7a94984c64a4fef3505d4e36086154cc50

Authored by Amrita Vishnoi
1 parent ee2cc884

Refactored code for highlight.

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -3767,22 +3767,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3767 3767  
3768 3768 var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
3769 3769 DAData.draw(img);
3770   - var RED = 0.3086; // luminance contrast value for red
3771   - var GREEN = 0.694; // luminance contrast value for green
3772   - var BLUE = 0.0820; // luminance contrast value for blue
3773 3770  
3774   - var RGB = [RED, GREEN, BLUE, 0, 0];
3775   - var RGB2 = [RED, GREEN, BLUE, 0, 0];
3776   - var RGB3 = [RED, GREEN, BLUE, 0, 0];
3777   - var ALPHA = [0, 0, 0, 1, 0];
  3771 + var colorMode;
3778 3772  
3779   - var rgbPx = RGB.concat(RGB2);
3780   - var rgbPx2 = rgbPx.concat(RGB3);
3781   - var matrix = rgbPx2.concat(ALPHA);
  3773 + //if ($scope.isExtract == true)
  3774 + //{
  3775 + // colorMode = $scope.applyWhiteMatrix(img,context_gray);
  3776 + //}
  3777 + //else
  3778 + //{
  3779 + colorMode = $scope.applyGrayMatrix(img, context_gray);
  3780 + //}
3782 3781  
3783 3782 var zeroPoint = new Point();
3784   - var grayScale = new ColorMatrixFilter(matrix);
3785   - DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
  3783 +
  3784 + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
3786 3785  
3787 3786 context_gray.putImageData(DAData.data, 0, 0)
3788 3787  
... ...