Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TPALETTE_UTIL_H
Toshihiro Shimizu 890ddd
#define TPALETTE_UTIL_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tpalette.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <set></set>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef TVRENDER_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
// mergePalette
Toshihiro Shimizu 890ddd
//   input: sourcePalette, sourceIndices
Toshihiro Shimizu 890ddd
//   output: indexTable, modifies: targetPalette
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
// inserisce i colori di sourcePalette individuati da sourceIndices in targetPalette
Toshihiro Shimizu 890ddd
// per ogni colore prima cerca un colore identico (TColorStyle::operator==()) in targetPalette
Toshihiro Shimizu 890ddd
// se non c'e' ne crea uno nuovo (nella prima pagina di targetPalette)
Toshihiro Shimizu 890ddd
// indexTable assicura la conversione <indici in="" sourcepalette=""> -> <indici in="" targetpalette=""></indici></indici>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void mergePalette(
Toshihiro Shimizu 890ddd
	const TPaletteP &targetPalette,
Toshihiro Shimizu 890ddd
	std::map<int, int=""> &indexTable,</int,>
Toshihiro Shimizu 890ddd
	const TPaletteP &sourcePalette,
Toshihiro Shimizu 890ddd
	const std::set<int> &sourceIndices);</int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// replace palette and lacking amount of styles will be copied from the other one
Toshihiro Shimizu 890ddd
// return value will be true if the style amount is changed after the operation
Toshihiro Shimizu 890ddd
DVAPI bool mergePalette_Overlap(
Toshihiro Shimizu 890ddd
	const TPaletteP &dstPalette,
Toshihiro Shimizu 890ddd
	const TPaletteP &copiedPalette,
Toshihiro Shimizu 890ddd
	bool keepOriginalPalette);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif