compactify layers

This commit is contained in:
rolux 2013-07-26 23:12:23 +02:00
parent 478e9f8b80
commit 7c4270d03f

View file

@ -33,79 +33,35 @@ Ox.load('UI', function() {
+ '/timeline' + type + '16p' + i + '.jpg'; + '/timeline' + type + '16p' + i + '.jpg';
}, },
height: window.innerHeight - 24, height: window.innerHeight - 24,
layers: [{ layers: [
id: 'shape', {id: 'shape', item: 'Shape Hash', title: 'Shape Hashes'},
item: 'Shape Hash', {id: 'color', item: 'Color Hash', title: 'Color Hashes'},
items: data['json/hashes.json'].filter(function(value) { {id: 'pHash', item: 'P Hash', title: 'P Hashes'},
return value.type == 'shape'; {id: 'dct', item: '3D DCT Hash', title: '3D DCT Hashes'},
}).map(function(value) { ].map(function(layer) {
return { return {
'in': value['in'], id: layer.id,
out: value.out, item: layer.item,
value: '<img src="' + value.composite + '"><br>' + value.hash + '<br>' items: data['json/hashes.json'].filter(function(value) {
+ value.similar.map(function(value) { return value.type == layer.id;
var position = Ox.formatDuration(value.position, 3); }).map(function(value) {
return '<a href="#' + position + '">' + position +'</a> ' + value.distance; return {
}).join('<br>') 'in': value['in'],
}; out: value.out,
}), value: '<img src="' + value.composite + '"><br>' + value.hash + '<br>'
title: 'Shape Hashes', + value.similar.map(function(value) {
type: 'text' var position = Ox.formatDuration(value.position, 3);
}, { return '<a href="#' + position + '">' + position +'</a> ' + value.distance;
id: 'color', }).join('<br>')
item: 'Color Hash', };
items: data['json/hashes.json'].filter(function(value) { }),
return value.type == 'color'; title: layer.title,
}).map(function(value) { type: 'text'
return { }
'in': value['in'], }),
out: value.out,
value: value.hash + '<br>' + value.similar.map(function(value) {
var position = Ox.formatDuration(value.position, 3);
return '<a href="#' + position + '">' + position +'</a> ' + value.distance;
}).join('<br>')
};
}),
title: 'Color Hashes',
type: 'text'
},{
id: 'p',
item: 'P Hash',
items: data['json/hashes.json'].filter(function(value) {
return value.type == 'pHash';
}).map(function(value) {
return {
'in': value['in'],
out: value.out,
value: value.hash + '<br>' + value.similar.map(function(value) {
var position = Ox.formatDuration(value.position, 3);
return '<a href="#' + position + '">' + position +'</a> ' + value.distance;
}).join('<br>')
};
}),
title: 'P Hashes',
type: 'text'
}, {
id: 'dct',
item: 'DCT Hash',
items: data['json/hashes.json'].filter(function(value) {
return value.type == 'dct';
}).map(function(value) {
return {
'in': value['in'],
out: value.out,
value: value.hash + '<br>' + value.similar.map(function(value) {
var position = Ox.formatDuration(value.position, 3);
return '<a href="#' + position + '">' + position +'</a> ' + value.distance;
}).join('<br>')
};
}),
title: 'DCT Hashes',
type: 'text'
}],
resolution: video.resolution, resolution: video.resolution,
showAnnotations: true, showAnnotations: true,
showLayers: {shape: true, color: true, dct: true}, showLayers: {shape: true, color: true, p: true, dct: true},
subtitles: data['json/cuts1.json'].map(function(position) { subtitles: data['json/cuts1.json'].map(function(position) {
return {'in': position - 0.08, out: position - 0.04, text: ''}; return {'in': position - 0.08, out: position - 0.04, text: ''};
}), }),