Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TROPCM_INCLUDED
Toshihiro Shimizu 890ddd
#define TROPCM_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "trop.h"
Toshihiro Shimizu 890ddd
//#include "trastercm.h"
Toshihiro Shimizu 890ddd
//#include "tpalette.h"
Toshihiro Shimizu 890ddd
//#include "ttile.h"
Toshihiro Shimizu 890ddd
#include "ttoonzimage.h"
Toshihiro Shimizu 890ddd
#include <set></set>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TROP_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
class TTile;
Toshihiro Shimizu 890ddd
class TLevelP;
Toshihiro Shimizu 890ddd
class TToonzImageP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
namespace TRop
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void convert(const TRaster32P &rasOut,
Toshihiro Shimizu 890ddd
				   const TRasterCM32P &rasIn,
Toshihiro Shimizu 890ddd
				   const TPaletteP palette,
Toshihiro Shimizu 890ddd
				   bool transparencyCheck = false);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void convert(const TRaster32P &rasOut,
Toshihiro Shimizu 890ddd
				   const TRasterCM32P &rasIn,
Toshihiro Shimizu 890ddd
				   TPaletteP palette,
Toshihiro Shimizu 890ddd
				   const TRect &theClipRect, // il rect su cui e' applicata la conversione
Toshihiro Shimizu 890ddd
				   bool transparencyCheck = false,
Toshihiro Shimizu 890ddd
				   bool applyFx = false);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void convert(const TTile &dst,
Toshihiro Shimizu 890ddd
				   const TTile &src,
Toshihiro Shimizu 890ddd
				   const TPaletteP plt,
Toshihiro Shimizu 890ddd
				   bool transparencyCheck,
Toshihiro Shimizu 890ddd
				   bool applyFxs);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//matchlinePrevalence ==0->always ink down; matchlinePrevalence == 100 always ink up;
Toshihiro Shimizu 890ddd
DVAPI void applyMatchLines(TRasterCM32P rasOut, const TRasterCM32P &rasUp, const TPaletteP &pltOut, int inkIndex, int matchlinePrevalence, std::map<int, int=""> &usedInks);</int,>
Toshihiro Shimizu 890ddd
DVAPI void mergeCmapped(TRasterCM32P rasOut, const TRasterCM32P &rasUp, const TPaletteP &pltOut, int matchlinePrevalence, std::map<int, int=""> &usedColors);</int,>
Toshihiro Shimizu 890ddd
DVAPI void overlayCmapped(TRasterCM32P rasOut, const TRasterCM32P &rasUp, const TPaletteP &pltOut, const TPaletteP &upPlt, std::map<int, int=""> &usedColors);</int,>
Toshihiro Shimizu 890ddd
//DVAPI void applyMatchline(const vector<matchlinepair>& matchingLevels, int inkIndex, int matchlinePrevalence);</matchlinepair>
Toshihiro Shimizu 890ddd
//DVAPI void deleteMatchline(const vector<ttoonzimagep>& level, const vector<int>& inkIndexes);</int></ttoonzimagep>
Toshihiro Shimizu 890ddd
//DVAPI void eraseInks(TRasterCM32P ras, vector<int>& inkIds, bool keepInks=false);</int>
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
DVAPI void eraseColors(TRasterCM32P ras, std::vector<int> *colorIds, bool eraseInks); //colorsId==0 ->erase ALL</int>
Toshihiro Shimizu 890ddd
																				 //DVAPI void  eraseColors(TRasterCM32P ras, vector<int>& colorIds, bool eraseInks, bool keepColor);</int>
Shinya Kitaoka 3bfa54
DVAPI void eraseStyleIds(TToonzImage *image, const std::vector<int> styleIds);</int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void resample(const TRasterP &out,
Toshihiro Shimizu 890ddd
					const TRasterCM32P &in,
Toshihiro Shimizu 890ddd
					const TPaletteP palette,
Toshihiro Shimizu 890ddd
					const TAffine &aff,
Toshihiro Shimizu 890ddd
					ResampleFilterType filterType = Triangle,
Toshihiro Shimizu 890ddd
					double blur = 1.);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void convolve_3_i(TRasterP rout,
Toshihiro Shimizu 890ddd
						TRasterCM32P rin,
Toshihiro Shimizu 890ddd
						const TPaletteP &palette,
Toshihiro Shimizu 890ddd
						int dx, int dy, double conv[]);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void convolve_i(TRasterP rout,
Toshihiro Shimizu 890ddd
					  TRasterCM32P rin,
Toshihiro Shimizu 890ddd
					  const TPaletteP &palette,
Toshihiro Shimizu 890ddd
					  int dx, int dy, double conv[], int radius);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void fracmove(TRasterP rout,
Toshihiro Shimizu 890ddd
					TRasterCM32P rin,
Toshihiro Shimizu 890ddd
					const TPaletteP &palette,
Toshihiro Shimizu 890ddd
					double dx, double dy);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void zoomOutCm32Rgbm(const TRasterCM32P &rin, TRaster32P &rout, const TPalette &plt,
Toshihiro Shimizu 890ddd
						   int x1, int y1, int x2, int y2,
Toshihiro Shimizu 890ddd
						   int newx, int newy, int absZoomLevel);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//these function create a small raster in rout shrinking rin, typically to make an icon.  the shrink method preserves pixels: even a single isolated pixel  is kept in the shrinked image.
Toshihiro Shimizu 890ddd
// shrinking is done without clipping  original image and preserving aspect ratio (no stretch!): therefore, horizontal or vertical transparent stripes on borders are added when needed.
Toshihiro Shimizu 890ddd
// warning: rout width must be <= rin width; same for height.
Toshihiro Shimizu 890ddd
//DVAPI void makeIcon(TRaster32P& rout,    const TRasterCM32P& rin, const TPaletteP& palette, bool onBlackBg);
Toshihiro Shimizu 890ddd
DVAPI void makeIcon(TRasterCM32P &rout, const TRasterCM32P &rin);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DVAPI void expandPaint(const TRasterCM32P &rasCM);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
} // namespace TRop
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif