本文整理汇总了C++中TTile::getRaster方法的典型用法代码示例。如果您正苦于以下问题:C++ TTile::getRaster方法的具体用法?C++ TTile::getRaster怎么用?C++ TTile::getRaster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTile
的用法示例。
在下文中一共展示了TTile::getRaster方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onFrameFailed
void RenderTask::onFrameFailed(TException &e) {
// TRasterP evenRas(m_evenTile.getRaster());
TRenderPort::RenderData rd(m_frames, m_info, m_tileA.getRaster(),
m_tileB.getRaster(), m_renderId, m_taskId);
m_rendererImp->notifyRasterFailure(rd, e);
}
示例2: releaseTiles
void RenderTask::releaseTiles() {
m_rendererImp->m_rasterPool.releaseRaster(m_tileA.getRaster());
m_tileA.setRaster(TRasterP());
if (m_fieldRender || m_stereoscopic) {
m_rendererImp->m_rasterPool.releaseRaster(m_tileB.getRaster());
m_tileB.setRaster(TRasterP());
}
}
示例3: doCompute
void doCompute(TTile &tile, double frame, const TRenderSettings &ri)
{
if (!m_input.isConnected())
return;
m_input->compute(tile, frame, ri);
double v = 1 - m_value->getValue(frame) / 100;
TRop::rgbmScale(tile.getRaster(), tile.getRaster(), 1, 1, 1, v);
}
示例4: doCompute
void ColumnColorFilterFx::doCompute(TTile &tile, double frame,
const TRenderSettings &ri) {
if (!m_port.isConnected()) return;
if (!TRaster32P(tile.getRaster()) && !TRaster64P(tile.getRaster()))
throw TException("AffineFx unsupported pixel type");
TRasterFxP src = m_port.getFx();
src->compute(tile, frame, ri);
TRop::applyColorScale(tile.getRaster(), m_colorFilter);
}
示例5: composeWithNoMotion
/*------------------------------------------------------------
背景があり、前景が動かない場合、単純にOverする
------------------------------------------------------------*/
void Iwa_MotionBlurCompFx::composeWithNoMotion(
TTile &tile, double frame, const TRenderSettings &settings) {
assert(m_background.isConnected());
m_background->compute(tile, frame, settings);
TTile fore_tile;
m_input->allocateAndCompute(fore_tile, tile.m_pos,
tile.getRaster()->getSize(), tile.getRaster(),
frame, settings);
TRasterP up(fore_tile.getRaster()), down(tile.getRaster());
TRop::over(down, up);
}
示例6: downloadAll
bool TCacheResource::downloadAll(TTile &tile)
{
if (!checkTile(tile))
return false;
return downloadAll(TPoint(tile.m_pos.x, tile.m_pos.y), tile.getRaster());
}
示例7: upload
bool TCacheResource::upload(const TTile &tile)
{
if (!checkTile(tile))
return false;
return upload(TPoint(tile.m_pos.x, tile.m_pos.y), tile.getRaster());
}
示例8: download
QRegion TCacheResource::download(TTile &tile)
{
if (!checkTile(tile))
return QRegion();
return download(TPoint(tile.m_pos.x, tile.m_pos.y), tile.getRaster());
}
示例9: TPointD
void SwatchViewer::ContentRender::run()
{
if (suspendedRendering)
return;
unsigned long renderId = TRenderer::buildRenderId();
TPassiveCacheManager::instance()->setContextName(renderId, "S");
m_viewer->m_renderer.install(renderId);
m_viewer->m_renderer.declareRenderStart(renderId);
m_viewer->m_renderer.declareFrameStart(m_frame);
TRenderSettings info;
info.m_isSwatch = true;
info.m_affine = m_aff;
TTile tile;
m_fx->allocateAndCompute(tile, -0.5 * TPointD(m_size.lx, m_size.ly), m_size, 0, (double)m_frame, info);
m_raster = tile.getRaster();
m_viewer->m_renderer.declareFrameEnd(m_frame);
m_viewer->m_renderer.declareRenderEnd(renderId);
m_viewer->m_renderer.uninstall();
}
示例10: doCompute
void doCompute(TTile &tile, double frame, const TRenderSettings &ri) {
if (!m_port.isConnected()) {
tile.getRaster()->clear();
return;
}
// Exchange frame with the stored one
TRasterFxP(m_port.getFx())->compute(tile, m_frame, ri);
}
示例11: onFrameCompleted
void RenderTask::onFrameCompleted() {
TRasterP rasA(m_tileA.getRaster());
TRasterP rasB(m_tileB.getRaster());
if (m_fieldRender) {
assert(rasB);
double t = m_frames[0];
int f = (m_info.m_fieldPrevalence == TRenderSettings::EvenField) ? 0 : 1;
interlace(rasA, rasB, f);
rasB = TRasterP();
}
TRenderPort::RenderData rd(m_frames, m_info, rasA, rasB, m_renderId,
m_taskId);
m_rendererImp->notifyRasterCompleted(rd);
}
示例12: doCompute
void doCompute(TTile &tile, double frame,
const TRenderSettings &info) override {
bool isWarped = m_warped.isConnected();
if (!isWarped) return;
if (fabs(m_intensity->getValue(frame)) < 0.01) {
m_warped->compute(tile, frame, info);
return;
}
int shrink = (info.m_shrinkX + info.m_shrinkY) / 2;
double scale = sqrt(fabs(info.m_affine.det()));
double gridStep = 1.5 * m_gridStep->getValue(frame);
WarpParams params;
params.m_intensity = m_intensity->getValue(frame) / gridStep;
params.m_warperScale = scale * gridStep;
params.m_sharpen = m_sharpen->getValue();
params.m_shrink = shrink;
double period = m_period->getValue(frame) / info.m_shrinkX;
double count = m_count->getValue(frame);
double cycle = m_cycle->getValue(frame) / info.m_shrinkX;
double scaleX = m_scaleX->getValue(frame) / 100.0;
double scaleY = m_scaleY->getValue(frame) / 100.0;
double angle = -m_angle->getValue(frame);
TPointD center = m_center->getValue(frame) * (1.0 / info.m_shrinkX);
// The warper is calculated on a standard reference, with fixed dpi. This
// makes sure
// that the lattice created for the warp does not depend on camera
// transforms and resolution.
TRenderSettings warperInfo(info);
double warperScaleFactor = 1.0 / params.m_warperScale;
warperInfo.m_affine = TScale(warperScaleFactor) * info.m_affine;
// Retrieve tile's geometry
TRectD tileRect;
{
TRasterP tileRas = tile.getRaster();
tileRect =
TRectD(tile.m_pos, TDimensionD(tileRas->getLx(), tileRas->getLy()));
}
// Build the compute rect
TRectD warpedBox, warpedComputeRect, tileComputeRect;
m_warped->getBBox(frame, warpedBox, info);
getWarpComputeRects(tileComputeRect, warpedComputeRect, warpedBox, tileRect,
params);
if (tileComputeRect.getLx() <= 0 || tileComputeRect.getLy() <= 0) return;
if (warpedComputeRect.getLx() <= 0 || warpedComputeRect.getLy() <= 0)
return;
TRectD warperComputeRect(TScale(warperScaleFactor) * tileComputeRect);
double warperEnlargement = getWarperEnlargement(params);
warperComputeRect = warperComputeRect.enlarge(warperEnlargement);
warperComputeRect.x0 = tfloor(warperComputeRect.x0);
warperComputeRect.y0 = tfloor(warperComputeRect.y0);
warperComputeRect.x1 = tceil(warperComputeRect.x1);
warperComputeRect.y1 = tceil(warperComputeRect.y1);
// Compute the warped tile
TTile tileIn;
m_warped->allocateAndCompute(
tileIn, warpedComputeRect.getP00(),
TDimension(warpedComputeRect.getLx(), warpedComputeRect.getLy()),
tile.getRaster(), frame, info);
TRasterP rasIn = tileIn.getRaster();
// Compute the warper tile
TSpectrum::ColorKey colors[] = {TSpectrum::ColorKey(0, TPixel32::White),
TSpectrum::ColorKey(0.5, TPixel32::Black),
TSpectrum::ColorKey(1, TPixel32::White)};
TSpectrumParamP ripplecolors = TSpectrumParamP(tArrayCount(colors), colors);
// Build the multiradial
warperInfo.m_affine = warperInfo.m_affine * TTranslation(center) *
TRotation(angle) * TScale(scaleX, scaleY);
TAffine aff = warperInfo.m_affine.inv();
TPointD posTrasf = aff * (warperComputeRect.getP00());
TRasterP rasWarper =
rasIn->create(warperComputeRect.getLx(), warperComputeRect.getLy());
multiRadial(rasWarper, posTrasf, ripplecolors, period, count, cycle, aff,
frame);
// TImageWriter::save(TFilePath("C:\\ripple.tif"), rasWarper);
// Warp
TPointD db;
TRect rasComputeRectI(convert(tileComputeRect - tileRect.getP00(), db));
TRasterP tileRas = tile.getRaster()->extract(rasComputeRectI);
TPointD rasInPos(warpedComputeRect.getP00() - tileComputeRect.getP00());
TPointD warperPos(
(TScale(params.m_warperScale) * warperComputeRect.getP00()) -
tileComputeRect.getP00());
warp(tileRas, rasIn, rasWarper, rasInPos, warperPos, params);
}
示例13: doCompute_CPU
void Iwa_MotionBlurCompFx::doCompute_CPU(
TTile &tile, double frame, const TRenderSettings &settings,
float4 *pointsTable, int pointAmount, double hardness, double shutterStart,
double shutterEnd, int traceResolution, float startValue, float startCurve,
float endValue, float endCurve, int marginLeft, int marginRight,
int marginTop, int marginBottom, TDimensionI &enlargedDimIn,
TTile &enlarge_tile, TDimensionI &dimOut, TDimensionI &filterDim,
TTile &back_tile) {
/*- 処理を行うメモリ -*/
float4 *in_tile_p; /*- マージンあり -*/
float4 *out_tile_p; /*- マージンあり -*/
/*- フィルタ -*/
float *filter_p;
/*- メモリ確保 -*/
TRasterGR8P in_tile_ras(sizeof(float4) * enlargedDimIn.lx, enlargedDimIn.ly);
in_tile_ras->lock();
in_tile_p = (float4 *)in_tile_ras->getRawData();
TRasterGR8P out_tile_ras(sizeof(float4) * enlargedDimIn.lx, enlargedDimIn.ly);
out_tile_ras->lock();
out_tile_p = (float4 *)out_tile_ras->getRawData();
TRasterGR8P filter_ras(sizeof(float) * filterDim.lx, filterDim.ly);
filter_ras->lock();
filter_p = (float *)filter_ras->getRawData();
bool sourceIsPremultiplied;
/*- ソース画像を0〜1に正規化してメモリに読み込む -*/
TRaster32P ras32 = (TRaster32P)enlarge_tile.getRaster();
TRaster64P ras64 = (TRaster64P)enlarge_tile.getRaster();
if (ras32)
sourceIsPremultiplied = setSourceRaster<TRaster32P, TPixel32>(
ras32, in_tile_p, enlargedDimIn,
(PremultiTypes)m_premultiType->getValue());
else if (ras64)
sourceIsPremultiplied = setSourceRaster<TRaster64P, TPixel64>(
ras64, in_tile_p, enlargedDimIn,
(PremultiTypes)m_premultiType->getValue());
/*- 残像モードがオフのとき -*/
if (!m_zanzoMode->getValue()) {
/*- フィルタをつくり、正規化する -*/
makeMotionBlurFilter_CPU(filter_p, filterDim, marginLeft, marginBottom,
pointsTable, pointAmount, startValue, startCurve,
endValue, endCurve);
}
/*- 残像モードがオンのとき -*/
else {
/*- 残像フィルタをつくる/正規化する -*/
makeZanzoFilter_CPU(filter_p, filterDim, marginLeft, marginBottom,
pointsTable, pointAmount, startValue, startCurve,
endValue, endCurve);
}
delete[] pointsTable;
/*- RGB値(0〜1)をdepremultiply→露光値に変換→再びpremultiply -*/
convertRGBtoExposure_CPU(in_tile_p, enlargedDimIn, hardness,
sourceIsPremultiplied);
/*- 露光値をフィルタリングしてぼかす -*/
applyBlurFilter_CPU(in_tile_p, out_tile_p, enlargedDimIn, filter_p, filterDim,
marginLeft, marginBottom, marginRight, marginTop, dimOut);
/*- メモリ解放 -*/
in_tile_ras->unlock();
filter_ras->unlock();
/*- 背景がある場合、Exposureの乗算を行う -*/
if (m_background.isConnected()) {
composeBackgroundExposure_CPU(out_tile_p, enlargedDimIn, marginRight,
marginTop, back_tile, dimOut,
(float)hardness);
}
/*- 露光値をdepremultipy→RGB値(0〜1)に戻す→premultiply -*/
convertExposureToRGB_CPU(out_tile_p, enlargedDimIn, hardness);
/*- ラスタのクリア -*/
tile.getRaster()->clear();
TRaster32P outRas32 = (TRaster32P)tile.getRaster();
TRaster64P outRas64 = (TRaster64P)tile.getRaster();
int2 margin = {marginRight, marginTop};
if (outRas32)
setOutputRaster<TRaster32P, TPixel32>(out_tile_p, outRas32, enlargedDimIn,
margin);
else if (outRas64)
setOutputRaster<TRaster64P, TPixel64>(out_tile_p, outRas64, enlargedDimIn,
margin);
/*- メモリ解放 -*/
out_tile_ras->unlock();
}
示例14: canUpload
bool TCacheResource::canUpload(const TTile &tile) const
{
int tileType;
return checkTile(tile) && checkRasterType(tile.getRaster(), tileType);
}
示例15: do_render
/*- render_particles から呼ばれる。粒子の数だけ繰り返し -*/
void Particles_Engine::do_render(
TFlash *flash, Particle *part, TTile *tile,
std::vector<TRasterFxPort *> part_ports, std::map<int, TTile *> porttiles,
const TRenderSettings &ri, TDimension &p_size, TPointD &p_offset,
int lastframe, std::vector<TLevelP> partLevel,
struct particles_values &values, double opacity_range, int dist_frame,
std::map<std::pair<int, int>, double> &partScales) {
// Retrieve the particle frame - that is, the *column frame* from which we are
// picking
// the particle to be rendered.
int ndx = part->frame % lastframe;
TRasterP tileRas(tile->getRaster());
std::string levelid;
double aim_angle = 0;
if (values.pathaim_val) {
double arctan = atan2(part->vy, part->vx);
aim_angle = arctan * M_180_PI;
}
// Calculate the rotational and scale components we have to apply on the
// particle
TRotation rotM(part->angle + aim_angle);
TScale scaleM(part->scale);
TAffine M(rotM * scaleM);
// Particles deal with dpi affines on their own
TAffine scaleAff(m_parent->handledAffine(ri, m_frame));
double partScale =
scaleAff.a11 * partScales[std::pair<int, int>(part->level, ndx)];
TDimensionD partResolution(0, 0);
TRenderSettings riNew(ri);
// Retrieve the bounding box in the standard reference
TRectD bbox(-5.0, -5.0, 5.0, 5.0), standardRefBBox;
if (part->level <
(int)part_ports.size() && // Not the default levelless cases
part_ports[part->level]->isConnected()) {
TRenderSettings riIdentity(ri);
riIdentity.m_affine = TAffine();
(*part_ports[part->level])->getBBox(ndx, bbox, riIdentity);
// A particle's bbox MUST be finite. Gradients and such which have an
// infinite bbox
// are just NOT rendered.
// NOTE: No fx returns half-planes or similar (ie if any coordinate is
// either
// (std::numeric_limits<double>::max)() or its opposite, then the rect IS
// THE infiniteRectD)
if (bbox == TConsts::infiniteRectD) return;
}
// Now, these are the particle rendering specifications
bbox = bbox.enlarge(3);
standardRefBBox = bbox;
riNew.m_affine = TScale(partScale);
bbox = riNew.m_affine * bbox;
/*- 縮小済みのParticleのサイズ -*/
partResolution = TDimensionD(tceil(bbox.getLx()), tceil(bbox.getLy()));
if (flash) {
if (!partLevel[part->level]->frame(ndx)) {
if (part_ports[0]->isConnected()) {
TTile auxTile;
TRaster32P tmp;
tmp = TRaster32P(p_size);
(*part_ports[0])
->allocateAndCompute(auxTile, p_offset, p_size, tmp, ndx, ri);
partLevel[part->level]->setFrame(ndx,
TRasterImageP(auxTile.getRaster()));
}
}
flash->pushMatrix();
const TAffine aff;
flash->multMatrix(scaleM * aff.place(0, 0, part->x, part->y));
// if(curr_opacity!=1.0 || part->gencol.fadecol || part->fincol.fadecol ||
// part->foutcol.fadecol)
{
TColorFader cf(TPixel32::Red, .5);
flash->draw(partLevel[part->level]->frame(ndx), &cf);
}
// flash->draw(partLevel->frame(ndx), 0);
flash->popMatrix();
} else {
TRasterP ras;
std::string alias;
TRasterImageP rimg;
if (rimg = partLevel[part->level]->frame(ndx)) {
ras = rimg->getRaster();
} else {
//.........这里部分代码省略.........