equal
deleted
inserted
replaced
2172 ) |
2172 ) |
2173 (MenuItem |
2173 (MenuItem |
2174 label: 'Clear Masked Pixels' |
2174 label: 'Clear Masked Pixels' |
2175 itemValue: clearMaskedPixels |
2175 itemValue: clearMaskedPixels |
2176 translateLabel: true |
2176 translateLabel: true |
|
2177 enabled: hasMask |
2177 ) |
2178 ) |
2178 ) |
2179 ) |
2179 nil |
2180 nil |
2180 nil |
2181 nil |
2181 ) |
2182 ) |
3359 ! |
3360 ! |
3360 |
3361 |
3361 updateImagePreView |
3362 updateImagePreView |
3362 self tileModeHolder value ifTrue:[ |
3363 self tileModeHolder value ifTrue:[ |
3363 self imagePreView tileMode:true tileOffset:(self image extent). |
3364 self imagePreView tileMode:true tileOffset:(self image extent). |
3364 ] |
3365 ]. |
|
3366 self imagePreView image:self image. |
3365 ! ! |
3367 ! ! |
3366 |
3368 |
3367 !ImageEditor methodsFor:'queries'! |
3369 !ImageEditor methodsFor:'queries'! |
3368 |
3370 |
3369 hasMask |
3371 hasMask |
3573 |
3575 |
3574 changeHLS |
3576 changeHLS |
3575 "interactive Hue/Light/Saturation editing" |
3577 "interactive Hue/Light/Saturation editing" |
3576 |
3578 |
3577 |bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
3579 |bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
3578 shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema| |
3580 shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema |
|
3581 originalPixels p| |
3579 |
3582 |
3580 "/ compute the averageColor in the background (while asking user) |
3583 "/ compute the averageColor in the background (while asking user) |
3581 readySema := Semaphore new. |
3584 readySema := Semaphore new. |
3582 [ |
3585 [ |
3583 originalColormap := imageEditView image colorMap copy. |
3586 |image| |
3584 avgColor := imageEditView image averageColor. |
3587 |
|
3588 image := imageEditView image. |
|
3589 originalColormap := image colorMap copy. |
|
3590 avgColor := image averageColor. |
|
3591 originalPixels := image bits. |
3585 readySema signal. |
3592 readySema signal. |
3586 ] forkAt:7. |
3593 ] forkAt:7. |
3587 |
3594 |
3588 acceptChannel := TriggerValue new. |
3595 acceptChannel := TriggerValue new. |
3589 avgColorHolder := avgColor asValue. |
3596 avgColorHolder := avgColor asValue. |
3622 shiftProcess := |
3629 shiftProcess := |
3623 [ |
3630 [ |
3624 [ |
3631 [ |
3625 imageEditView image |
3632 imageEditView image |
3626 colorMap:originalColormap copy; |
3633 colorMap:originalColormap copy; |
|
3634 bits:originalPixels copy; |
|
3635 release; |
3627 colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
3636 colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
3628 self updateImage. |
3637 self updateImage. |
3629 self updateInfoLabel. |
3638 self updateInfoLabel. |
|
3639 self updateImagePreView. |
3630 ] ensure:[ shiftProcess := nil ]. |
3640 ] ensure:[ shiftProcess := nil ]. |
3631 ] forkAt:7. |
3641 ] forkAt:7. |
3632 ]. |
3642 ]. |
3633 |
3643 |
3634 bindings := IdentityDictionary new. |
3644 bindings := IdentityDictionary new. |
3648 ifFalse:[ |
3658 ifFalse:[ |
3649 firstChange ~~ true ifTrue:[ |
3659 firstChange ~~ true ifTrue:[ |
3650 imageEditView undo |
3660 imageEditView undo |
3651 ] |
3661 ] |
3652 ]. |
3662 ]. |
3653 self updateImage |
3663 |
|
3664 (p := shiftProcess) notNil ifTrue:[ |
|
3665 p waitUntilTerminated. |
|
3666 ]. |
|
3667 self updateImage. |
|
3668 self updateImagePreView. |
3654 ! |
3669 ! |
3655 |
3670 |
3656 clearMaskedPixels |
3671 clearMaskedPixels |
3657 "clear all masked pixels (to pixelValue 0)" |
3672 "clear all masked pixels (to pixelValue 0)" |
3658 |
3673 |