本文整理汇总了C++中resizeImage函数的典型用法代码示例。如果您正苦于以下问题:C++ resizeImage函数的具体用法?C++ resizeImage怎么用?C++ resizeImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resizeImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resizeImage
void ImageView::setZoom (bool zoomFit, double factor)
{
m_zoomFit = zoomFit;
m_zoomFactor = factor;
resizeImage();
update();
}
示例2: qMax
void DrawingBoard::resizeEvent(QResizeEvent * event){
if (width() > image.width() || height() > image.height()){
int newWidth = qMax(width() + 128, image.width());
int newHeight = qMax(height() + 128, image.height());
resizeImage(&image, QSize(newWidth, newHeight));
update();
}
QWidget::resizeEvent(event);
}
示例3: resizeImage
bool DrawArea::saveImage(const QString& fileName, const QString& fileFormat) {
QImage visibleImage = mImage;
resizeImage(&visibleImage, this->size());
if (visibleImage.save(fileName, fileFormat.toLatin1())) {
mModified = false;
return true;
} else
return false;
}
示例4: MRI
MRI(char const *inputFileName, VolumeType::SpacingType spacing, VolumeType::SizeType size, double initialResizeFactor):
resamplerSpacing(spacing),
resamplerSize(size) {
readFile(inputFileName);
rescaleIntensity();
resizeImage(initialResizeFactor);
buildOriginalMaskVolume();
initialiseFilters();
buildSlices();
buildMaskSlices();
}
示例5: setMinimumSize
void
RemapImage::setZoom(float z)
{
setMinimumSize(QSize(m_imgWidth, m_imgHeight));
m_zoom = qMax(0.01f, z);
resizeImage();
update();
emit zoomChanged();
}
示例6: resizeImage
void Canvas::resizeEvent(QResizeEvent *event)
{
QSize newSize = event->size();
if (newSize.height()>image.height()||
newSize.width()>image.width()) {
layers.resizeLayers(newSize);
resizeImage(&image, newSize);
update();
}
QWidget::resizeEvent(event);
}
示例7: qMax
void ScribbleArea::resizeEvent(QResizeEvent *event)
{
if (width() > image.width() || height() > image.height()) {
int newWidth = qMax(width() , image.width());
int newHeight = qMax(height() , image.height());
resizeImage(&image, QSize(newWidth, newHeight));
update();
}
QWidget::resizeEvent(event);
}
示例8: qDebug
void ComplexPlotter::paintEvent(QPaintEvent *e) {
if(mRepaintEnabled) {
qDebug() << "The image computation took " << mStopwatch->elapsed() << " milliseconds";
mStopwatch->invalidate();
resizeImage();
Plotter::paintEvent(e);
mLabel->setPixmap(QPixmap::fromImage(*mP.mImage));
setEnabledThreadStuff(true);
mRepaintEnabled = false;
}
}
示例9: resizeImage
bool Canvas::openImage(const QString &fileName)
{
QImage loadedImage;
if (!loadedImage.load(fileName))return false;
QSize newSize = loadedImage.size().expandedTo(size());
resizeImage(&loadedImage, newSize);
image = loadedImage;
modified = false;
update();
return true;
}
示例10: YUVtoGray
///
///Private methods
///
void Worker::transformImages(int n,const RoboCompCameraBus::Format& format,RoboCompCameraBus::Image &image)
{
uint8_t *temp;
RoboCompCameraBus::Format ftemp;
ftemp.width = busparams.width;
ftemp.height = busparams.height;
ftemp.modeImage = format.modeImage;
if(format.modeImage != RoboCompCameraBus::YUV422)
{
if(format.modeImage == RoboCompCameraBus::GRAY8)
YUVtoGray(ftemp.width,ftemp.height,pSour,pDes,n);
else
{
if(format.modeImage == RoboCompCameraBus::RGB888Packet)
YUVtoRGB(ftemp.width,ftemp.height, pSour, pDes,n);
else
{
if(format.modeImage == RoboCompCameraBus::RGB888Planar)
YUVtoRGBPtr(ftemp.width,ftemp.height,pSour,pDes,n);
}
}
for(int i=0;i<n;i++)
{
temp = pSour[i];
pSour[i] = pDes[i];
pDes[i] = temp;
}
}
if (ftemp.width != format.width or ftemp.height != format.height)
{
resizeImage(ftemp,pSour,format,pDes,n);
for(int i=0;i<n;i++)
{
temp = pSour[i];
pSour[i] = pDes[i];
pDes[i] = temp;
}
}
for(int i=0;i<n;i++)
{
if(cameraParamsList[i].invertedH != false or cameraParamsList[i].invertedV != false)
mirror(format,pSour[i],cameraParamsList[i].invertedH,cameraParamsList[i].invertedV);
}
int size = format.width*format.height;
if (format.modeImage == RoboCompCameraBus::RGB888Packet or format.modeImage == RoboCompCameraBus::RGB888Planar)
size *= 3;
if (format.modeImage == RoboCompCameraBus::YUV422)
size *= 2;
image.timeStamp = reloj.elapsed();
image.frmt = format;
image.frmt.size = size;
}
示例11: resizeImage
bool DrawingBoard::saveImage(const QString &fileName, const char *fileFormat)
{
QImage imageOnBoard = image;
resizeImage(&imageOnBoard, size());
if (imageOnBoard.save(fileName, fileFormat)) {
isChanged = false;
return true;
} else {
return false;
}
}
示例12: resizeImage
bool PaintWidget::saveImage(const QString fileName, const char *fileFormat)
{
QImage visibleImg = image;
resizeImage(&visibleImg, size());
if (visibleImg.save(fileName, fileFormat))
{
modified = false;
return true;
} else
return false;
}
示例13: qMax
void PaintCanvas::resizeEvent(QResizeEvent *event)
{
// if (width() > image.width() || height() > image.height()) {
//Earlier they wanted a safe margine that the image would draw outside of hence the Qmax
int newWidth = qMax(width() + 0, image.width());
int newHeight = qMax(height() + 0, image.height());
std::cout<<"RESIZEDEVENT "<<newHeight<<std::endl;
resizeImage(&image, QSize(newWidth, newHeight));
update();
// }
QWidget::resizeEvent(event);
}
示例14: setEnabledThreadStuff
void ComplexPlotter::doRepaint() {
setEnabledThreadStuff(false);
mRepaintEnabled = true;
resizeImage();
// call through to the superclass handler
mStopwatch->start();
for(int i=mP.mNThreads-1; i>=0; i--)
// paintThreads[i]->setPlotter(this);
paintThreads[i]->render(mP, computeCSParameters(mLabel), xMin(), yMin());
qDebug() << "started " << mP.mNThreads << " threads.";
}
示例15: resizeImage
//! [3]
bool ScribbleArea::saveImage(const QString &fileName, const char *fileFormat)
//! [3] //! [4]
{
QImage visibleImage = image;
resizeImage(&visibleImage, size());
if (visibleImage.save(fileName, fileFormat)) {
modified = false;
return true;
} else {
return false;
}
}