Produced by Araxis Merge on 12/5/2017 12:06:41 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\Hi5\src\gov\va\med\imaging\hi5\client | PixelTransform.java | Mon Dec 4 21:34:26 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\Hi5\src\gov\va\med\imaging\hi5\client | PixelTransform.java | Mon Dec 4 22:00:53 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 200 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /** | |
| 2 | * | |
| 3 | */ | |
| 4 | package go v.va.med.i maging.hi5 .client; | |
| 5 | ||
| 6 | import org .apache.lo gging.log4 j.LogManag er; | |
| 7 | import org .apache.lo gging.log4 j.Logger; | |
| 8 | ||
| 9 | import com .google.gw t.canvas.d om.client. CanvasPixe lArray; | |
| 10 | ||
| 11 | /** | |
| 12 | * @author
|
|
| 13 | * | |
| 14 | */ | |
| 15 | public cla ss PixelTr ansform | |
| 16 | { | |
| 17 | Logger logger = LogManager .getLogger ("PixelTra nsformatio n"); | |
| 18 | ||
| 19 | privat e final Im ageStatist ics imageS tats; | |
| 20 | privat e boolean invert = f alse; | |
| 21 | ||
| 22 | public PixelTran sform(Imag eStatistic s imageSta ts) | |
| 23 | { | |
| 24 | th is.imageSt ats = imag eStats; | |
| 25 | } | |
| 26 | ||
| 27 | public ImageStat istics get ImageStats () | |
| 28 | { | |
| 29 | re turn image Stats; | |
| 30 | } | |
| 31 | ||
| 32 | public boolean i sInvert() | |
| 33 | { | |
| 34 | re turn inver t; | |
| 35 | } | |
| 36 | ||
| 37 | public void setI nvert(bool ean invert ) | |
| 38 | { | |
| 39 | th is.invert = invert; | |
| 40 | } | |
| 41 | ||
| 42 | /** | |
| 43 | * Set everythin g back so this becom es an iden tity trans formation | |
| 44 | */ | |
| 45 | public void reve rt() | |
| 46 | { | |
| 47 | se tInvert(fa lse); | |
| 48 | } | |
| 49 | ||
| 50 | /** | |
| 51 | * | |
| 52 | * @pa ram cpa | |
| 53 | * @pa ram height | |
| 54 | * @pa ram width | |
| 55 | * @pa ram bitDep th | |
| 56 | */ | |
| 57 | public void exec ute(Canvas PixelArray cpa) | |
| 58 | { | |
| 59 | if (invert) | |
| 60 | { | |
| 61 | int gray Scales = i mageStats. getGraySca leLevels() ; | |
| 62 | ||
| 63 | logger.i nfo("Inver ting " + c pa.getLeng th() + " p ixels (" + cpa.get(0 ) + "->" + (grayScal es - cpa.g et(0)) + " )" ); | |
| 64 | for(int pixelIndex = 0; pixe lIndex < c pa.getLeng th(); ++pi xelIndex) | |
| 65 | { | |
| 66 | int pixelOffse t = (int)p ixelIndex * 4; | |
| 67 | RGBP ixel sourc ePixel = n ew RGBPixe l(cpa, pix elOffset); | |
| 68 | RGBP ixel destP ixel = tra nsformPixe l(sourcePi xel); | |
| 69 | ||
| 70 | //lo gger.fine( "\t invert (" + sour ceRedValue + "->" + destRedVal ue + ")"); | |
| 71 | ||
| 72 | cpa. set(pixelO ffset + RG BPixel.RED _OFFSET, d estPixel.g etRed() ); // r ed channel value | |
| 73 | cpa. set(pixelO ffset + RG BPixel.GRE EN_OFFSET, destPixel .getGreen( ) ); // g reen chann el value | |
| 74 | cpa. set(pixelO ffset + RG BPixel.BLU E_OFFSET, destPixel. getBlue() ); // b lue channe l value | |
| 75 | cpa. set(pixelO ffset + RG BPixel.ALP HA_OFFSET, destPixel .getAlpha( ) ); // alpha cha nnel value | |
| 76 | } | |
| 77 | } | |
| 78 | } | |
| 79 | ||
| 80 | /** | |
| 81 | * Ret urn the in verse of t he pixel v alues, tha t is the m aximum pix el depth - the curre nt value. | |
| 82 | * The alpha cha nnel is th e same as the origin al value. | |
| 83 | * | |
| 84 | * @pa ram origin Pixel | |
| 85 | * @re turn | |
| 86 | */ | |
| 87 | public RGBPixel transformP ixel(RGBPi xel origin Pixel) | |
| 88 | { | |
| 89 | RG BPixel tra nsformedPi xel = orig inPixel; | |
| 90 | ||
| 91 | if (isInvert( )) | |
| 92 | transfor medPixel = new RGBPi xel( | |
| 93 | imag eStats.get DisplayGra yScaleLeve ls() - ori ginPixel.g etRed(), | |
| 94 | imag eStats.get DisplayGra yScaleLeve ls() - ori ginPixel.g etGreen(), | |
| 95 | imag eStats.get DisplayGra yScaleLeve ls() - ori ginPixel.g etBlue(), | |
| 96 | orig inPixel.ge tAlpha() | |
| 97 | ); | |
| 98 | ||
| 99 | re turn trans formedPixe l; | |
| 100 | } | |
| 101 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.