| #pragma once |
| |
| #include "trastercm.h" |
| #include "texception.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TROP_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| class TPalette; |
| typedef TSmartPointerT<TPalette> TPaletteP; |
| |
| extern "C" { |
| struct _RASTER; |
| } |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI TRopException final : public TException { |
| std::string message; |
| |
| public: |
| TRopException(const std::string &s) : message(s) {} |
| ~TRopException() {} |
| |
| TString getMessage() const override; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| namespace TRop { |
| |
| enum ResampleFilterType { |
| None, |
| |
| Triangle, |
| |
| Mitchell, |
| |
| Cubic5, |
| |
| Cubic75, |
| |
| Cubic1, |
| |
| Hann2, |
| |
| Hann3, |
| |
| Hamming2, |
| |
| Hamming3, |
| |
| Lanczos2, |
| |
| Lanczos3, |
| |
| Gauss, |
| |
| ClosestPixel, |
| |
| Bilinear, |
| |
| HowMany |
| }; |
| |
| enum ColorMask { RChan = 0x1, GChan = 0x2, BChan = 0x4, MChan = 0x8 }; |
| |
| enum ErodilateMaskType { ED_rectangular, ED_circular }; |
| |
| |
| |
| |
| DVAPI void rgbmScale(TRasterP rout, TRasterP rin, const double *k, |
| const double *a, const int *out0, const int *out1); |
| |
| DVAPI void rgbmScale(TRasterP rout, TRasterP rin, double kr, double kg, |
| double kb, double km, double ar = 0.0, double ag = 0.0, |
| double ab = 0.0, double am = 0.0); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| DVAPI void rgbmAdjust(TRasterP rout, TRasterP rin, const int *in0, |
| const int *in1, const int *out0, const int *out1); |
| |
| |
| |
| |
| |
| DVAPI void checkBoard(TRasterP rout, const TPixel32 &, const TPixel32 &, |
| const TDimensionD &, const TPointD &); |
| |
| |
| |
| |
| DVAPI void over(const TRasterP &out, const TRasterP &dn, const TRasterP &up); |
| |
| |
| DVAPI void over(const TRasterP &out, const TRasterP &up, |
| const TPoint &pos = TPoint()); |
| |
| DVAPI void over(const TRasterP &out, const TRasterP &up, const TAffine &aff, |
| ResampleFilterType filterType = Triangle); |
| |
| |
| |
| DVAPI void over(const TRasterP &out, const TRasterP &up, const TPoint &pos, |
| const TAffine &aff, ResampleFilterType filterType = Triangle); |
| |
| |
| DVAPI void over(const TRasterP &out, const TRasterP &dn, const TRasterP &up, |
| const TRasterGR8P &mask); |
| |
| |
| |
| DVAPI void over(TRaster32P rout, const TRasterGR8P &rup, const TPixel32 &color); |
| |
| DVAPI void over(TRasterP rout, const TRasterCM32P &rup, TPalette *palette, |
| const TPoint &point = TPoint(), const TAffine &aff = TAffine()); |
| |
| |
| |
| |
| |
| |
| |
| DVAPI void resample(const TRasterP &out, const TRasterP &in, const TAffine &aff, |
| ResampleFilterType filterType = Triangle, double blur = 1.); |
| |
| |
| DVAPI void quickPut(const TRasterP &out, const TRasterP &up, const TAffine &aff, |
| const TPixel32 &colorScale = TPixel::Black, |
| bool doPremultiply = false, bool whiteTransp = false, |
| bool firstColumn = false, |
| bool doRasterDarkenBlendedView = false); |
| |
| |
| |
| |
| |
| |
| DVAPI void quickPut(const TRasterP &out, const TRasterCM32P &up, |
| const TPaletteP &plt, const TAffine &aff, |
| const TPixel32 &globalColorScale = TPixel::Black, |
| bool inksOnly = false); |
| |
| |
| |
| class CmappedQuickputSettings { |
| public: |
| TPixel32 m_globalColorScale, m_transpCheckPaint, m_transpCheckBg, |
| m_transpCheckInk; |
| |
| int m_inkIndex, m_paintIndex; |
| |
| bool m_inksOnly, m_transparencyCheck, m_blackBgCheck; |
| |
| CmappedQuickputSettings() |
| : m_globalColorScale(TPixel32::Black) |
| , m_inksOnly(false) |
| , m_transparencyCheck(false) |
| , m_blackBgCheck(false) |
| , m_inkIndex(-1) |
| , m_paintIndex(-1) {} |
| }; |
| |
| DVAPI void quickPut(const TRasterP &dn, const TRasterCM32P &upCM32, |
| const TPaletteP &plt, const TAffine &aff, |
| const CmappedQuickputSettings &settings); |
| |
| DVAPI void quickResampleColorFilter(const TRasterP &dn, const TRasterP &up, |
| const TAffine &aff, const TPaletteP &plt, |
| UCHAR colorMask); |
| |
| DVAPI void convolve_3_i(TRasterP rout, TRasterP rin, int dx, int dy, |
| double conv[]); |
| |
| DVAPI void convolve_i(TRasterP rout, TRasterP rin, int dx, int dy, |
| double conv[], int radius); |
| |
| DVAPI void fracmove(TRasterP rout, TRasterP rin, double dx, double dy); |
| |
| |
| DVAPI void convert(TRasterP dst, const TRasterP &src); |
| |
| |
| DVAPI void copy(TRasterP dst, const TRasterP &src); |
| |
| DVAPI void brush(TRaster32P ras, const TPoint &a, const TPoint &b, int radius, |
| const TPixel32 &color); |
| |
| |
| DVAPI void computeBBox(TRasterP ras, TRect &bbox); |
| |
| |
| DVAPI void addBackground(TRasterP ras, const TPixel32 &col); |
| |
| |
| DVAPI bool isOpaque(TRasterP ras); |
| |
| |
| |
| DVAPI void invert(TRasterP ras, bool invRed = true, bool invGreen = true, |
| bool invBlue = true, bool invMatte = false); |
| |
| |
| |
| DVAPI void add(const TRasterP &rup, const TRasterP &rdown, const TRasterP &rout, |
| double v); |
| |
| |
| DVAPI void add(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void colordodge(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void colorburn(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void screen(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| |
| |
| DVAPI void sub(const TRasterP &rup, const TRasterP &rdown, const TRasterP &rout, |
| bool matte); |
| |
| DVAPI void mult(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout, int v, bool matte); |
| |
| DVAPI void ropin(const TRasterP &source, const TRasterP &matte, |
| const TRasterP &rout); |
| |
| DVAPI void ropout(const TRasterP &source, const TRasterP &matte, |
| const TRasterP &rout); |
| |
| DVAPI void atop(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void txor(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void crossDissolve(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout, UCHAR v); |
| |
| DVAPI void lighten(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void darken(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| DVAPI void ropmin(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout, bool matte); |
| |
| DVAPI void ropmax(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| DVAPI void linearburn(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| DVAPI void overlay(const TRasterP &rup, const TRasterP &rdown, |
| const TRasterP &rout); |
| |
| |
| DVAPI void premultiply(const TRasterP &ras); |
| |
| |
| DVAPI void depremultiply(const TRasterP &ras); |
| |
| |
| |
| |
| |
| |
| |
| DVAPI void expandColor(const TRaster32P &ras32, bool precise); |
| |
| |
| DVAPI void whiteTransp(const TRasterP &ras); |
| |
| |
| |
| DVAPI void applyColorScale(const TRasterP &ras, const TPixel32 &colorScale); |
| |
| DVAPI TRasterP shrink(TRasterP rin, int shrink); |
| |
| |
| DVAPI void gammaCorrect(TRasterP raster, double gamma); |
| |
| |
| DVAPI void gammaCorrectRGBM(TRasterP raster, double gammar, double gammag, |
| double gammab, double gammam); |
| |
| |
| DVAPI int getBlurBorder(double blur); |
| |
| |
| |
| |
| DVAPI void antialias(const TRasterP &src, const TRasterP &dst, int threshold, |
| int softness); |
| |
| |
| |
| |
| |
| DVAPI void majorityDespeckle(const TRasterP &ras, int sizeThreshold); |
| |
| |
| DVAPI void blur(const TRasterP &dstRas, const TRasterP &srcRas, double blur, |
| int dx, int dy, bool useSSE = false); |
| |
| struct RaylitParams { |
| TPixel m_color; |
| T3DPoint m_lightOriginSrc; |
| T3DPoint m_lightOriginDst; |
| double m_smoothness; |
| double m_decay; |
| double m_intensity; |
| double m_scale; |
| bool m_invert; |
| bool m_includeInput; |
| }; |
| |
| |
| DVAPI void raylit(const TRasterP &dstRas, const TRasterP &srcRas, |
| const RaylitParams ¶ms); |
| DVAPI void glassRaylit(const TRasterP &dstRas, const TRasterP &srcRas, |
| const RaylitParams ¶ms); |
| |
| DVAPI void despeckle(const TRasterP &ras, int sizeThreshold, bool check, |
| bool trasparentIsWhite = false); |
| DVAPI void despeckle(const TRasterP &rout, const TRasterP &rin, |
| int sizeThreshold, bool check); |
| |
| |
| DVAPI TRaster32P copyAndSwapRBChannels(const TRaster32P &srcRaster); |
| |
| |
| DVAPI void makeStereoRaster(const TRasterP &left, const TRasterP &right); |
| |
| DVAPI void setChannel(const TRasterP &rin, TRasterP rout, UCHAR chan, |
| bool greytones); |
| |
| |
| |
| |
| |
| |
| DVAPI void erodilate(const TRasterP &rin, const TRasterP &rout, double radius, |
| ErodilateMaskType type); |
| |
| #ifdef TNZ_MACHINE_CHANNEL_ORDER_MRGB |
| DVAPI void swapRBChannels(const TRaster32P &r); |
| #endif |
| |
| |
| |
| |
| |
| |
| |
| |
| DVAPI _RASTER *convertRaster50to46(const TRasterP &inRas, |
| const TPaletteP &inPalette); |
| |
| |
| |
| |
| |
| DVAPI void releaseRaster46(_RASTER *&r, bool doReleaseBuffer = false); |
| |
| |
| DVAPI _RASTER *readRaster46(const char *filename); |
| |
| |
| |
| DVAPI void lockRaster(_RASTER *raster); |
| |
| |
| |
| DVAPI void unlockRaster(_RASTER *raster); |
| |
| } |