Visitar URL original
PaletteGenerator: Optimize histogram creation by tarobins · Pull Request #67 · flutter/packages · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
140de2e
Add logs
tarobins Jan 18, 2020
5970861
Add timing to test
tarobins Jan 18, 2020
4550af2
add obama test
tarobins Jan 18, 2020
1867ce2
add obama to demo
tarobins Jan 19, 2020
9335412
track last color
tarobins Jan 18, 2020
207617f
Clean up code
tarobins Jan 19, 2020
869da5c
Clean up code
tarobins Jan 19, 2020
adde10c
Merge branch 'optimizeHistogram' of github.com:tarobins/packages into…
tarobins Jan 19, 2020
da3a598
Fix env file
tarobins Jan 19, 2020
f98b405
Switch to splay tree
tarobins Jan 19, 2020
0481cfd
Revert "Switch to splay tree"
tarobins Jan 19, 2020
b162805
Use multidimensional hashmap
tarobins Jan 20, 2020
659f279
Clean up code
tarobins Jan 19, 2020
9ae1747
Clean up code
tarobins Jan 19, 2020
bb6b281
Fix env file
tarobins Jan 19, 2020
9853557
Switch to splay tree
tarobins Jan 19, 2020
66228af
Revert "Switch to splay tree"
tarobins Jan 19, 2020
b654451
Merge branch 'optimizeHistogram' of github.com:tarobins/packages into…
tarobins Jan 20, 2020
d09db0f
fix type spec
tarobins Jan 20, 2020
027355c
Fix spacing
tarobins Jan 20, 2020
ac4034b
Use list for keys
tarobins Jan 21, 2020
6114c2f
Clean up code
tarobins Jan 19, 2020
11d896d
Clean up code
tarobins Jan 19, 2020
45794c6
Fix env file
tarobins Jan 19, 2020
a1bcf9b
Revert "Switch to splay tree"
tarobins Jan 19, 2020
61817d4
Clean up code
tarobins Jan 19, 2020
8de3b0a
Clean up code
tarobins Jan 19, 2020
2a7e71f
fix type spec
tarobins Jan 20, 2020
cd5c678
Fix spacing
tarobins Jan 20, 2020
8a11f81
Merge branch 'optimizeHistogram' of github.com:tarobins/packages into…
tarobins Jan 21, 2020
c9054b9
format fix
tarobins Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add obama test
  • Loading branch information
tarobins committed Jan 18, 2020
commit 4550af286520f92b52ebdf1939b7204f94a85a6b
Binary file added packages/palette_generator/test/assets/obama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions packages/palette_generator/test/palette_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Future<void> main() async {
'wide_red',
'dominant',
'landscape',
'large'
'large_landscape',
'obama',
];
final Map<String, ImageProvider> testImages = <String, ImageProvider>{};
for (String name in imageNames) {
Expand Down Expand Up @@ -138,11 +139,24 @@ Future<void> main() async {
});


test('PaletteGenerator works as expected on a large image', () async {
test('PaletteGenerator works as expected on a large landscape image', () async {
log.info('Start test');
DateTime start = DateTime.now();
final PaletteGenerator palette =
await PaletteGenerator.fromImageProvider(testImages['large']);
await PaletteGenerator.fromImageProvider(testImages['large_landscape']);
DateTime end = DateTime.now();


final runtime = end.difference(start);
log.info('Test took: $runtime');
log.info('Colors ${palette.colors}');
});

test('PaletteGenerator works as expected on a large obama image', () async {
log.info('Start test');
DateTime start = DateTime.now();
final PaletteGenerator palette =
await PaletteGenerator.fromImageProvider(testImages['obama']);
DateTime end = DateTime.now();


Expand Down