2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef TPALETTE_UTIL_H
|
|
|
|
#define TPALETTE_UTIL_H
|
|
|
|
|
|
|
|
#include "tpalette.h"
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
#undef DVAPI
|
|
|
|
#undef DVVAR
|
|
|
|
|
|
|
|
#ifdef TVRENDER_EXPORTS
|
|
|
|
#define DVAPI DV_EXPORT_API
|
|
|
|
#define DVVAR DV_EXPORT_VAR
|
|
|
|
#else
|
|
|
|
#define DVAPI DV_IMPORT_API
|
|
|
|
#define DVVAR DV_IMPORT_VAR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// mergePalette
|
|
|
|
// input: sourcePalette, sourceIndices
|
|
|
|
// output: indexTable, modifies: targetPalette
|
|
|
|
//
|
2016-06-15 18:43:10 +12:00
|
|
|
// inserisce i colori di sourcePalette individuati da sourceIndices in
|
|
|
|
// targetPalette
|
|
|
|
// per ogni colore prima cerca un colore identico (TColorStyle::operator==()) in
|
|
|
|
// targetPalette
|
2016-03-19 06:57:51 +13:00
|
|
|
// se non c'e' ne crea uno nuovo (nella prima pagina di targetPalette)
|
2016-06-15 18:43:10 +12:00
|
|
|
// indexTable assicura la conversione <indici in sourcePalette> -> <indici in
|
|
|
|
// targetPalette>
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
DVAPI void mergePalette(const TPaletteP &targetPalette,
|
|
|
|
std::map<int, int> &indexTable,
|
|
|
|
const TPaletteP &sourcePalette,
|
|
|
|
const std::set<int> &sourceIndices);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
// replace palette and lacking amount of styles will be copied from the other
|
|
|
|
// one
|
2016-03-19 06:57:51 +13:00
|
|
|
// return value will be true if the style amount is changed after the operation
|
2016-06-15 18:43:10 +12:00
|
|
|
DVAPI bool mergePalette_Overlap(const TPaletteP &dstPalette,
|
|
|
|
const TPaletteP &copiedPalette,
|
|
|
|
bool keepOriginalPalette);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#endif
|