Commit 14c7b41074906c409d605471729251aa5493d43c

Authored by Nikita Kulshreshtha
1 parent a7f89312

modesty in TB implementation is completed. Need to see the zIndex for resizing b…

…ecause TransModesty zIndex is greated then resizable so unable to rersize but if we lower the zIndex it is not visible properly
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -964,7 +964,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -964,7 +964,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
964 964
965 if (($rootScope.globalSetting.modesty == 'Y')) { 965 if (($rootScope.globalSetting.modesty == 'Y')) {
966 if ($('.modestyImg') != null) { 966 if ($('.modestyImg') != null) {
967 - // $('.modestyImg').css('visibility', 'visible'); 967 + $('.modestyImg').css('visibility', 'visible');
968 } 968 }
969 } 969 }
970 //set scrollbars on canvas and hide loading label 970 //set scrollbars on canvas and hide loading label
@@ -4298,7 +4298,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4298,7 +4298,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4298 4298
4299 4299
4300 tempImg.onload = function () { 4300 tempImg.onload = function () {
4301 - debugger;  
4302 var tempCtx = transparencyTempCanvas.getContext('2d'); 4301 var tempCtx = transparencyTempCanvas.getContext('2d');
4303 4302
4304 if (IsMirror == 'Yes') { 4303 if (IsMirror == 'Yes') {
@@ -4330,7 +4329,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4330,7 +4329,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4330 //check if transparency is activated 4329 //check if transparency is activated
4331 4330
4332 4331
4333 - var transNumber = 50;//$scope.transNumber;//txtTransparencyChange.value; 4332 + var transNumber = $scope.transNumber;//txtTransparencyChange.value;
4334 // debugger; 4333 // debugger;
4335 //this changes the transparency when transparency is already activated and user resizes or chage the layer 4334 //this changes the transparency when transparency is already activated and user resizes or chage the layer
4336 4335
@@ -4484,18 +4483,51 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4484,18 +4483,51 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4484 // if (isTransparencyChanged == true) { 4483 // if (isTransparencyChanged == true) {
4485 4484
4486 // var txtTransparencyChange = document.getElementById("txtTransparencyChange"); 4485 // var txtTransparencyChange = document.getElementById("txtTransparencyChange");
4487 - //var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");  
4488 - //if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {  
4489 - // debugger  
4490 - // for (var j = 0; j < modestyTransCanvases.length; j++) {  
4491 - // var ctx = document.getElementById(modestyTransCanvases[j]).getContext('2d');  
4492 - // var ImgData = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage);  
4493 - // //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]);  
4494 - // }  
4495 - //}  
4496 4486
4497 var transNumber = $scope.transNumber; 4487 var transNumber = $scope.transNumber;
4498 4488
  4489 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  4490 + var modestyTemCanvas = $("canvas[id*='tempCanvasModesty_']");
  4491 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  4492 +
  4493 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  4494 + var ctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d');
  4495 + var imageDa = ctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height);
  4496 + //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]);
  4497 +
  4498 + var imageData = imageDa.data;
  4499 + var length = imageData.length;
  4500 + // set every fourth value to 50
  4501 + for (var i = 3; i < length; i += 4) {
  4502 + //NIKITA
  4503 + if ($scope.voId == "9" || $scope.voId == "11") {
  4504 +
  4505 + if (imageData[i] == 0) {
  4506 +
  4507 + }
  4508 + else {
  4509 + imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  4510 + }
  4511 + }
  4512 + else {
  4513 + if (imageData[i] == 0) {
  4514 +
  4515 + }
  4516 + else
  4517 + imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  4518 + }
  4519 +
  4520 + // imageData[i] = ((255) * (parseInt(transNumber))) / 100;
  4521 + }
  4522 + // after the manipulation, reset the data
  4523 + // imageDa.data = imageData;
  4524 + // and put the imagedata back to the canvas
  4525 + //ctx.putImageData(imageDa, XforTransImage, YforTransImage);
  4526 + ctx.putImageData(imageDa, 0, 0);
  4527 + }
  4528 + }
  4529 +
  4530 +
4499 var ctx = document.getElementById('transparencyCanvas').getContext('2d'); 4531 var ctx = document.getElementById('transparencyCanvas').getContext('2d');
4500 4532
4501 // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); 4533 // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage);
@@ -5043,25 +5075,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5043,25 +5075,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5043 ctx.putImageData(originalTransparencyData, 0, 0); 5075 ctx.putImageData(originalTransparencyData, 0, 0);
5044 5076
5045 5077
5046 - var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;  
5047 -  
5048 - $scope.IncludedBodyRegions = [];  
5049 - var counter = 0;  
5050 - $.each(BodyRegionDictionary, function (index, value) {  
5051 -  
5052 - var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);  
5053 - var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);  
5054 -  
5055 -  
5056 -  
5057 - if (tBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && tBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { 5078 + //for modesty
5058 5079
5059 - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, true); 5080 + //for modesty
  5081 + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) {
  5082 + $.each($scope.modestyImageInfo, function (index, value) {
5060 5083
5061 - } 5084 + var brId = value.bodyRegionId;
5062 5085
5063 - }); 5086 + var modestyTransTempCanvasId = 'tempCanvasModesty_' + brId;
  5087 + var modestyTransCanvasId = 'modestyTransCanavs_' + brId;
  5088 + var tempCanvasContext = document.getElementById(modestyTransTempCanvasId).getContext('2d');
  5089 + var originalTransparencyData = tempCanvasContext.getImageData(0, 0, value.Width, value.Height);
  5090 + var ctx = document.getElementById(modestyTransCanvasId).getContext('2d');
  5091 + ctx.putImageData(originalTransparencyData, 0, 0);
  5092 + })
  5093 + }
5064 5094
  5095 + $scope.changeTransparency();
5065 5096
5066 5097
5067 // }); 5098 // });