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