本文整理汇总了C++中TRasterImageP::getPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ TRasterImageP::getPointer方法的具体用法?C++ TRasterImageP::getPointer怎么用?C++ TRasterImageP::getPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRasterImageP
的用法示例。
在下文中一共展示了TRasterImageP::getPointer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintImage
void ImagePainter::paintImage(const TImageP &image, const TDimension &imageSize,
const TDimension &viewerSize, const TAffine &aff,
const VisualSettings &visualSettings,
const CompareSettings &compareSettings,
const TRect &loadbox) {
glDisable(GL_DEPTH_TEST);
if (visualSettings.m_drawExternalBG) {
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
}
GLenum error = glGetError();
// assert(error==GL_NO_ERROR);
if (error != GL_NO_ERROR) {
printf("ImagePainter::paintImage() gl_error:%d\n", error);
}
if (!image) return;
TRasterImageP rimg = (TRasterImageP)image;
TVectorImageP vimg = (TVectorImageP)image;
TToonzImageP timg = (TToonzImageP)image;
TRect clipRect(viewerSize);
clipRect -= TPoint(viewerSize.lx * 0.5, viewerSize.ly * 0.5);
Painter painter(viewerSize, imageSize, aff, image->getPalette(),
visualSettings);
if (rimg)
painter.onRasterImage(rimg.getPointer());
else if (vimg)
painter.onVectorImage(vimg.getPointer());
else if (timg)
painter.onToonzImage(timg.getPointer());
if (visualSettings.m_blankColor != TPixel::Transparent) {
painter.drawBlank();
return;
}
// if I have a color filter applied using a glmask, , drawing of images must
// be done on black bg!
if (!vimg)
painter.flushRasterImages(
loadbox, visualSettings.m_doCompare ? compareSettings.m_compareX
: DefaultCompareValue,
visualSettings.m_doCompare ? compareSettings.m_compareY
: DefaultCompareValue,
compareSettings.m_swapCompared);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
if (visualSettings.m_doCompare)
drawCompareLines(viewerSize, compareSettings.m_compareX,
compareSettings.m_compareY);
}
示例2: apply
void AdjustLevelsPopup::apply()
{
//Retrieve parameters
int in0[5], in1[5], out0[5], out1[5];
getParameters(in0, in1, out0, out1);
//Operate depending on the selection kind
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(TSelection::getCurrent());
if (cellSelection) {
std::set<TRasterImage *> images; //Multiple cells may yield the same image...
int r0, c0, r1, c1;
cellSelection->getSelectedCells(r0, c0, r1, c1);
TXsheet *xsheet = TApp::instance()->getCurrentXsheet()->getXsheet();
bool oneImageChanged = false;
TUndoManager::manager()->beginBlock();
{
int c, r;
for (c = c0; c <= c1; c++) {
for (r = r0; r <= r1; r++) {
const TXshCell &cell = xsheet->getCell(r, c);
TRasterImageP rasImage = (TRasterImageP)cell.getImage(true);
if (!rasImage)
continue;
if (images.find(rasImage.getPointer()) != images.end())
continue;
TRasterP ras = rasImage->getRaster();
if (!ras)
continue;
images.insert(rasImage.getPointer());
oneImageChanged = true;
TUndoManager::manager()->add(new AdjustLevelsUndo(in0, in1, out0, out1, r, c, ras->clone()));
TRop::rgbmAdjust(ras, ras, in0, in1, out0, out1);
TXshSimpleLevel *simpleLevel = cell.getSimpleLevel();
assert(simpleLevel);
simpleLevel->touchFrame(cell.getFrameId());
simpleLevel->setDirtyFlag(true);
IconGenerator::instance()->invalidate(simpleLevel, cell.getFrameId());
}
}
}
TUndoManager::manager()->endBlock();
if (oneImageChanged) {
close();
return;
}
}
TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(TSelection::getCurrent());
if (filmstripSelection) {
TXshSimpleLevel *simpleLevel = TApp::instance()->getCurrentLevel()->getSimpleLevel();
if (simpleLevel) {
std::set<TFrameId> fids = filmstripSelection->getSelectedFids();
bool oneImageChanged = false;
std::set<TFrameId>::iterator it = fids.begin();
for (it; it != fids.end(); it++) {
TRasterImageP rasImage = (TRasterImageP)simpleLevel->getFrame(*it, true);
if (!rasImage)
continue;
TRasterP ras = rasImage->getRaster();
if (!ras)
continue;
oneImageChanged = true;
TRop::rgbmAdjust(ras, ras, in0, in1, out0, out1);
simpleLevel->touchFrame(*it);
simpleLevel->setDirtyFlag(true);
IconGenerator::instance()->invalidate(simpleLevel, *it);
}
if (oneImageChanged) {
close();
return;
}
}
}
DVGui::error(QObject::tr("The current selection is invalid."));
return;
}
示例3: apply
void BrightnessAndContrastPopup::apply()
{
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(TSelection::getCurrent());
int brightness = m_brightnessField->getValue();
int contrast = m_contrastField->getValue();
if (cellSelection) {
std::set<TRasterImage *> images;
int r0, c0, r1, c1;
cellSelection->getSelectedCells(r0, c0, r1, c1);
TXsheet *xsheet = TApp::instance()->getCurrentXsheet()->getXsheet();
bool oneImageChanged = false;
int c, r;
TUndoManager::manager()->beginBlock();
for (c = c0; c <= c1; c++)
for (r = r0; r <= r1; r++) {
TXshCell cell = xsheet->getCell(r, c);
TRasterImageP rasImage = (TRasterImageP)cell.getImage(true);
if (!rasImage)
continue;
if (images.find(rasImage.getPointer()) != images.end())
continue;
TRasterP ras = rasImage->getRaster();
if (!ras)
continue;
images.insert(rasImage.getPointer());
oneImageChanged = true;
TUndoManager::manager()->add(new TRasterBrightnessUndo(brightness, contrast, r, c, ras->clone()));
onChange(ras, contrast, brightness);
TXshSimpleLevel *simpleLevel = cell.getSimpleLevel();
assert(simpleLevel);
simpleLevel->touchFrame(cell.getFrameId());
simpleLevel->setDirtyFlag(true);
IconGenerator::instance()->invalidate(simpleLevel, cell.getFrameId());
}
TUndoManager::manager()->endBlock();
if (oneImageChanged) {
close();
return;
}
}
TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(TSelection::getCurrent());
if (filmstripSelection) {
TXshSimpleLevel *simpleLevel = TApp::instance()->getCurrentLevel()->getSimpleLevel();
if (simpleLevel) {
std::set<TFrameId> fids = filmstripSelection->getSelectedFids();
std::set<TFrameId>::iterator it = fids.begin();
bool oneImageChanged = false;
for (it; it != fids.end(); it++) {
TRasterImageP rasImage = (TRasterImageP)simpleLevel->getFrame(*it, true);
;
if (!rasImage)
continue;
TRasterP ras = rasImage->getRaster();
if (!ras)
continue;
oneImageChanged = true;
onChange(ras, contrast, brightness);
simpleLevel->touchFrame(*it);
simpleLevel->setDirtyFlag(true);
IconGenerator::instance()->invalidate(simpleLevel, *it);
}
if (oneImageChanged) {
close();
return;
}
}
}
DVGui::error(QObject::tr("The current selection is invalid."));
return;
}
示例4: apply
void LinesFadePopup::apply()
{
TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(TSelection::getCurrent());
TPixel32 color = m_linesColorField->getColor();
int intensity = m_intensity->getValue();
if (cellSelection) {
std::set<TRasterImage *> images;
int r0, c0, r1, c1;
cellSelection->getSelectedCells(r0, c0, r1, c1);
TXsheet *xsheet = TApp::instance()->getCurrentXsheet()->getXsheet();
bool oneImageChanged = false;
int c, r;
TUndoManager::manager()->beginBlock();
for (c = c0; c <= c1; c++)
for (r = r0; r <= r1; r++) {
TXshCell cell = xsheet->getCell(r, c);
TRasterImageP rasImage = (TRasterImageP)cell.getImage(true);
if (!rasImage)
continue;
if (images.find(rasImage.getPointer()) != images.end())
continue;
TRaster32P ras = rasImage->getRaster();
if (!ras)
continue;
images.insert(rasImage.getPointer());
TUndoManager::manager()->add(new TLineFadeUndo(color, intensity, r, c, ras->clone()));
oneImageChanged = true;
onChange(ras, ras, color, intensity);
TXshSimpleLevel *simpleLevel = cell.getSimpleLevel();
assert(simpleLevel);
simpleLevel->touchFrame(cell.getFrameId());
simpleLevel->setDirtyFlag(true);
IconGenerator::instance()->invalidate(simpleLevel, cell.getFrameId());
}
TUndoManager::manager()->endBlock();
images.clear();
if (oneImageChanged) {
close();
return;
}
}
TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(TSelection::getCurrent());
if (filmstripSelection) {
TXshSimpleLevel *simpleLevel = TApp::instance()->getCurrentLevel()->getSimpleLevel();
if (simpleLevel) {
std::set<TFrameId> fids = filmstripSelection->getSelectedFids();
bool oneImageChanged = false;
for (auto const& fid : fids) {
TRasterImageP rasImage = (TRasterImageP)simpleLevel->getFrame(fid, true);
;
if (!rasImage)
continue;
TRaster32P ras = rasImage->getRaster();
if (!ras)
continue;
oneImageChanged = true;
onChange(ras, ras, color, intensity);
simpleLevel->touchFrame(fid);
simpleLevel->setDirtyFlag(true);
IconGenerator::instance()->invalidate(simpleLevel, fid);
}
if (oneImageChanged) {
close();
return;
}
}
}
DVGui::error(QObject::tr("The current selection is invalid."));
return;
}