diff --git a/src/main/resources/PhotoConverterManualTester_structure.puml b/src/main/resources/PhotoConverterManualTester_structure.puml index c3f74ba..cc4aa98 100644 --- a/src/main/resources/PhotoConverterManualTester_structure.puml +++ b/src/main/resources/PhotoConverterManualTester_structure.puml @@ -1,273 +1,79 @@ @startuml -/' diagram meta data start -config=StructureConfiguration; -{ - "projectClassification": { - "searchMode": "OpenProject", // OpenProject, AllProjects - "includedProjects": "", - "pathEndKeywords": "*.impl", - "isClientPath": "", - "isClientName": "", - "isTestPath": "", - "isTestName": "", - "isMappingPath": "", - "isMappingName": "", - "isDataAccessPath": "", - "isDataAccessName": "", - "isDataStructurePath": "", - "isDataStructureName": "", - "isInterfaceStructuresPath": "", - "isInterfaceStructuresName": "", - "isEntryPointPath": "", - "isEntryPointName": "", - "treatFinalFieldsAsMandatory": false - }, - "graphRestriction": { - "classPackageExcludeFilter": "", - "classPackageIncludeFilter": "", - "classNameExcludeFilter": "", - "classNameIncludeFilter": "", - "methodNameExcludeFilter": "", - "methodNameIncludeFilter": "", - "removeByInheritance": "", // inheritance/annotation based filtering is done in a second step - "removeByAnnotation": "", - "removeByClassPackage": "", // cleanup the graph after inheritance/annotation based filtering is done - "removeByClassName": "", - "cutMappings": false, - "cutEnum": true, - "cutTests": true, - "cutClient": true, - "cutDataAccess": true, - "cutInterfaceStructures": true, - "cutDataStructures": true, - "cutGetterAndSetter": true, - "cutConstructors": true - }, - "graphTraversal": { - "forwardDepth": 3, - "backwardDepth": 3, - "classPackageExcludeFilter": "", - "classPackageIncludeFilter": "", - "classNameExcludeFilter": "", - "classNameIncludeFilter": "", - "methodNameExcludeFilter": "", - "methodNameIncludeFilter": "", - "hideMappings": false, - "hideDataStructures": false, - "hidePrivateMethods": true, - "hideInterfaceCalls": true, // indirection: implementation -> interface (is hidden) -> implementation - "onlyShowApplicationEntryPoints": false, // root node is included - "useMethodCallsForStructureDiagram": "ForwardOnly" // ForwardOnly, BothDirections, No - }, - "details": { - "aggregation": "GroupByClass", // ByClass, GroupByClass, None - "showClassGenericTypes": true, - "showMethods": true, - "showMethodParameterNames": true, - "showMethodParameterTypes": true, - "showMethodReturnType": true, - "showPackageLevels": 2, - "showDetailedClassStructure": true - }, - "rootClass": "com.rutuj.photofiltersapp.PhotoConverterManualTester", - "extensionCallbackMethod": "" // qualified.class.name#methodName - signature: public static String method(String) +class Builder { + + build(): ServiceComponent } -diagram meta data end '/ +class ConcurrentConverter { + - convertedImageLocation: String + - converter: PhotoConverter + - fileName: String + - inputImage: Photo + + run() +} +class ConvertPhotoActivity { + - conversionResults: Map> + - converterMapper: ConverterStrategyMapper + - executorService: ExecutorService + - gatherResults(): List + + handleRequest(filePath: String, conversionTypes: List): List + - shutDownExecutorService() + - submitConcurrentConverter(concurrentConverter: ConcurrentConverter) +} -digraph g { - rankdir="TB" - splines=polyline - - -'nodes -subgraph cluster_108882150 { - label=rutuj - labeljust=l - fillcolor="#ececec" - style=filled - - subgraph cluster_1685228816 { - label=photofiltersapp - labeljust=l - fillcolor="#d8d8d8" - style=filled - - Builder1911043414[ - label=< - -
- -
(C)Builder
+ build(): ServiceComponent
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; - -ConcurrentConverter1577323120[ - label=< - -
- - - - -
- -
(C)ConcurrentConverter
- convertedImageLocation: String [0..1]
- converter: PhotoConverter [0..1]
- fileName: String [0..1]
- inputImage: Photo [0..1]
+ run()
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; - -ConvertPhotoActivity1526362[ - label=< - -
- - - -
- - - - -
(C)ConvertPhotoActivity
- conversionResults: Map<ConcurrentConverter, Future<Void>> [0..1]
- converterMapper: ConverterStrategyMapper [0..1]
- executorService: ExecutorService [0..1]
- gatherResults(): List<String>
+ handleRequest(filePath: String, conversionTypes: List<ConversionType>): List<String>
- shutDownExecutorService()
- submitConcurrentConverter(concurrentConverter: ConcurrentConverter)
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class ConverterStrategyMapper { + - converterMap: Map + + getImageConverter(conversionType: ConversionType): PhotoConverter +} -ConverterStrategyMapper507044939[ - label=< - -
- -
- -
(C)ConverterStrategyMapper
- converterMap: Map<ConversionType, PhotoConverter> [0..1]
+ getImageConverter(conversionType: ConversionType): PhotoConverter
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class DaggerServiceComponent { + - serviceComponent: DaggerServiceComponent + + builder(): Builder + + create(): ServiceComponent + + provideConvertPhotoActivity(): ConvertPhotoActivity +} -DaggerServiceComponent608074794[ - label=< - -
- -
- - - -
(C)DaggerServiceComponent
- serviceComponent: DaggerServiceComponent [0..1]
+ builder(): Builder
+ create(): ServiceComponent
+ provideConvertPhotoActivity(): ConvertPhotoActivity
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class GreyscaleConverter { + + convert(image: Photo, imageName: String): String +} -GreyscaleConverter507044939[ - label=< - -
- -
(C)GreyscaleConverter
+ convert(image: Photo, imageName: String): String
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class InversionConverter { + + convert(image: Photo, imageName: String): String +} -InversionConverter507044939[ - label=< - -
- -
(C)InversionConverter
+ convert(image: Photo, imageName: String): String
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class Photo { + - height: int + - pixels: List + - type: int + - width: int +} -Photo1372463170[ - label=< - -
- - - - -
(C)Photo
- height: int [1]
- pixels: List<Pixel> [0..1]
- type: int [1]
- width: int [1]
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class PhotoConverterManualTester { + + main(args: String[]) + - runTest(filePath: String, conversions: ImmutableList) +} -PhotoConverterManualTester1039272381[ - label=< - -
- - -
(C)PhotoConverterManualTester
+ main(args: String[])
- runTest(filePath: String, conversions: ImmutableList<ConversionType>)
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class PhotoUtil { + - createRGB(bufferedImageRGBValue: int): RGB + + fromFile(filePath: String): Photo + - getRGBIntValue(rgb: RGB): int + + savePhoto(image: Photo, imageName: String, conversionType: ConversionType): String +} -PhotoUtil1152408371[ - label=< - -
- - - - -
(C)PhotoUtil
- createRGB(bufferedImageRGBValue: int): RGB
+ fromFile(filePath: String): Photo
- getRGBIntValue(rgb: RGB): int
+ savePhoto(image: Photo, imageName: String, conversionType: ConversionType): String
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; +class SepiaConverter { + + convert(image: Photo, imageName: String): String +} -SepiaConverter507044939[ - label=< - -
- -
(C)SepiaConverter
+ convert(image: Photo, imageName: String): String
> - style=filled - margin=0 - shape=plaintext - fillcolor="#FFFFFF" -]; -} -} +ConcurrentConverter --> GreyscaleConverter : convert() +ConcurrentConverter --> InversionConverter : convert() +ConcurrentConverter --> Photo +ConcurrentConverter --> SepiaConverter : convert() +ConvertPhotoActivity --> ConcurrentConverter : submitConcurrentConverter() +ConvertPhotoActivity --> ConverterStrategyMapper : getImageConverter() +ConvertPhotoActivity --> PhotoUtil : fromFile() +DaggerServiceComponent --> Builder : builder() +PhotoConverterManualTester --> ConvertPhotoActivity : handleRequest() +PhotoConverterManualTester --> DaggerServiceComponent : provideConvertPhotoActivity() -'edges -ConcurrentConverter1577323120 -> GreyscaleConverter507044939[arrowhead=none]; -ConcurrentConverter1577323120 -> InversionConverter507044939[arrowhead=none]; -ConcurrentConverter1577323120 -> Photo1372463170[label="inputImage -[0..1]"]; -ConcurrentConverter1577323120 -> SepiaConverter507044939[arrowhead=none]; -ConvertPhotoActivity1526362 -> ConcurrentConverter1577323120[label="conversionResults -[0..1]"]; -ConvertPhotoActivity1526362 -> ConverterStrategyMapper507044939[label="converterMapper -[0..1]"]; -ConvertPhotoActivity1526362 -> PhotoUtil1152408371[label="handleRequest() -> fromFile()"]; -DaggerServiceComponent608074794 -> Builder1911043414[label="create() -> build()"]; -PhotoConverterManualTester1039272381 -> ConvertPhotoActivity1526362[label="runTest() -> handleRequest()"]; -PhotoConverterManualTester1039272381 -> DaggerServiceComponent608074794[arrowhead=none]; - -} @enduml \ No newline at end of file diff --git a/src/output/Photographing-NYC-skyline_1717898211810_inversion.jpg b/src/output/Photographing-NYC-skyline_1717898211810_inversion.jpg new file mode 100644 index 0000000..9a5aac2 Binary files /dev/null and b/src/output/Photographing-NYC-skyline_1717898211810_inversion.jpg differ diff --git a/src/output/Photographing-NYC-skyline_1717898211811_greyscale.jpg b/src/output/Photographing-NYC-skyline_1717898211811_greyscale.jpg new file mode 100644 index 0000000..d627926 Binary files /dev/null and b/src/output/Photographing-NYC-skyline_1717898211811_greyscale.jpg differ diff --git a/src/output/Photographing-NYC-skyline_1717898211813_sepia.jpg b/src/output/Photographing-NYC-skyline_1717898211813_sepia.jpg new file mode 100644 index 0000000..4629438 Binary files /dev/null and b/src/output/Photographing-NYC-skyline_1717898211813_sepia.jpg differ