compactify layers

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

View file

@ -33,11 +33,17 @@ 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'},
{id: 'pHash', item: 'P Hash', title: 'P Hashes'},
{id: 'dct', item: '3D DCT Hash', title: '3D DCT Hashes'},
].map(function(layer) {
return {
id: layer.id,
item: layer.item,
items: data['json/hashes.json'].filter(function(value) { items: data['json/hashes.json'].filter(function(value) {
return value.type == 'shape'; return value.type == layer.id;
}).map(function(value) { }).map(function(value) {
return { return {
'in': value['in'], 'in': value['in'],
@ -49,63 +55,13 @@ Ox.load('UI', function() {
}).join('<br>') }).join('<br>')
}; };
}), }),
title: 'Shape Hashes', title: layer.title,
type: 'text' type: 'text'
}, { }
id: 'color',
item: 'Color Hash',
items: data['json/hashes.json'].filter(function(value) {
return value.type == 'color';
}).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: '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: ''};
}), }),