tahoma2d/toonz/sources/stdfx/iwa_perspectivedistortfx.h

60 lines
2 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
/*------------------------------------
2016-06-15 18:43:10 +12:00
Iwa_PerspectiveDistortFx
2016-03-19 06:57:51 +13:00
------------------------------------*/
#ifndef IWA_PERSPECTIVE_DISTORT_H
#define IWA_PERSPECTIVE_DISTORT_H
#include "tfxparam.h"
#include "stdfx.h"
#include "tparamset.h"
struct float4 {
2016-06-15 18:43:10 +12:00
float x, y, z, w;
2016-03-19 06:57:51 +13:00
};
class Iwa_PerspectiveDistortFx final : public TStandardRasterFx {
2016-06-15 18:43:10 +12:00
FX_PLUGIN_DECLARATION(Iwa_PerspectiveDistortFx)
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
TRasterFxPort m_source; /*- 入力画像 -*/
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TPointParamP m_vanishingPoint; /*- 消失点 -*/
TPointParamP m_anchorPoint; /*- 基準点 -*/
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TDoubleParamP m_precision; /*- 細かさ。解像度の引き上げ度合い -*/
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
/*- 出力結果をChannel値に変換して格納 -*/
template <typename RASTER, typename PIXEL>
void setOutputRaster(float4 *srcMem, const RASTER dstRas, TDimensionI dim,
int drawLevel);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
/*- タイルの画像を0〜1に正規化してホストメモリに読み込む -*/
template <typename RASTER, typename PIXEL>
void setSourceRaster(const RASTER srcRas, float4 *dstMem, TDimensionI dim);
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
Iwa_PerspectiveDistortFx();
2016-06-20 14:23:05 +12:00
bool doGetBBox(double frame, TRectD &bBox,
const TRenderSettings &info) override;
2016-06-15 18:43:10 +12:00
2016-06-19 20:06:29 +12:00
bool canHandle(const TRenderSettings &info, double frame) override;
2016-06-15 18:43:10 +12:00
2016-06-20 14:23:05 +12:00
void doCompute(TTile &tile, double frame,
const TRenderSettings &rend_sets) override;
2016-06-15 18:43:10 +12:00
void doCompute_CPU(TTile &tile, const double frame,
const TRenderSettings &settings, TPointD &vanishingPoint,
TPointD &anchorPoint, float4 *source_host,
float4 *result_host, TDimensionI &sourceDim,
TDimensionI &resultDim, const double precision,
const double offs);
2016-06-19 20:06:29 +12:00
void getParamUIs(TParamUIConcept *&concepts, int &length) override;
2016-03-19 06:57:51 +13:00
};
#endif