package Ġde . eh mk ah . projects . img diff Ċ Ċ import Ġcom . intellij . diff . Diff Context Ċ import Ġcom . intellij . diff . contents . FileContent Impl Ċ import Ġcom . intellij . diff . requests . Content Diff Request Ċ import Ġcom . intellij . diff . requests . Simple Diff Request Ċ import Ġcom . intellij . diff . tools . binary . Th re es ide Binary Diff Viewer Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . intellij . openapi . vfs . Virtual File Ċ import Ġjava . awt . image . Buffered Image Ċ import Ġjava . io . ByteArray OutputStream Ċ import Ġjavax . image io . Image IO Ċ Ċ class ĠImg Diff B linking Diff Tool Ġ: ĠImg Diff Base Binary Diff Tool () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġdiff ed Image Creator Ġ= ĠDiff ed Image Creator () ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinstance Ġ= ĠImg Diff B linking Diff Tool () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Img Diff Diff Viewer ( request : ĠContent Diff Request , Ġproject : ĠProject ?, Ġcontext : ĠDiff Context , Ġfile content 0 : ĠVirtual File , Ġfile content 1 : ĠVirtual File , Ġcontent Title 0 : ĠString ?, Ġcontent Title 1 : ĠString ?): ĠTh re es ide Binary Diff Viewer Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbuffered Image 0 Ġ= ĠImage IO . read ( file content 0 . inputStream ) ĊĠĠĠĠĠĠĠ Ġval Ġbuffered Image 1 Ġ= ĠImage IO . read ( file content 1 . inputStream ) ĊĠĠĠĠĠĠĠ Ġval Ġdifference Image Ġ= Ġbuffered Image 0 ĊĠĠĠĠĠĠĠ Ġval Ġdiff Content 0 Ġ= ĠFile Content Impl ( project , Ġfile content 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġdiff Content 1 Ġ= ĠFile Content Impl ( project , Ġfile content 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġdiff Content Difference Ġ= ĠFile Content Impl ( project , Ġcreate Image File ( difference Image )) ĊĊĠĠĠĠĠĠĠ Ġval Ġmy Request Ġ= ĠSimple Diff Request ( request . title , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdiff Content 0 , Ġdiff Content Difference , Ġdiff Content 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcontent Title 0 , Ġ" Diff Ġimage ", Ġcontent Title 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= ĠImg Diff Viewer ( context , Ġmy Request ) ĊĠĠĠĠĠĠĠ Ġval ĠoutputStream Ġ= ĠByteArrayOutputStream () ĊĠĠĠĠĠĠĠ ĠoutputStream . use Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdiff ed Image Creator . create Gif Image ( buffered Image 0 , Ġbuffered Image 1 , ĠoutputStream ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresult . show B linking Diff ( output Stream . toByteArray ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġresult ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Diff Image ( buffered Image 0 : ĠBufferedImage , Ġbuffered Image 1 : ĠBufferedImage ): ĠBufferedImage Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġbuffered Image 0 ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetName (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ" Image Diff Ġ- ĠB linking ĠDiff Ġ( experimental )" ĊĠĠĠ Ġ} Ċ }