当前位置: 首页>>代码示例>>C++>>正文


C++ DImg::sixteenBit方法代码示例

本文整理汇总了C++中DImg::sixteenBit方法的典型用法代码示例。如果您正苦于以下问题:C++ DImg::sixteenBit方法的具体用法?C++ DImg::sixteenBit怎么用?C++ DImg::sixteenBit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DImg的用法示例。


在下文中一共展示了DImg::sixteenBit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: putData

bool UndoCache::putData(int level, const DImg& img) const
{
    QFile file(d->cacheFile(level));
    KDiskFreeSpaceInfo info = KDiskFreeSpaceInfo::freeSpaceInfo(d->cacheDir);
    
    unsigned long fspace = (unsigned long)(info.available()/1024.0/1024.0);
    kDebug() << "Free space available in Editor cache [" << d->cacheDir << "] in Mbytes: " << fspace;
    
    if (file.exists() || 
        !file.open(QIODevice::WriteOnly) || 
        fspace < 1024) // Check if free space is over 1 Gb to put data in cache. 
    {
        return false;
    }

    QDataStream ds(&file);
    ds << img.width();
    ds << img.height();
    ds << img.sixteenBit();
    ds << img.hasAlpha();

    QByteArray ba((const char*)img.bits(), img.numBytes());
    ds << ba;

    file.close();

    d->cachedLevels << level;

    return true;
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:30,代码来源:undocache.cpp

示例2: getSnapshot

void UndoManager::getSnapshot(int index, DImg* const img) const
{
    DImg data = d->undoCache->getData(index);

    // Pass ownership of buffer. If data is null, img will be null
    img->putImageData(data.width(), data.height(), data.sixteenBit(), data.hasAlpha(), data.bits(), true);
}
开发者ID:KDE,项目名称:digikam,代码行数:7,代码来源:undomanager.cpp

示例3: DImg

void BorderFilter::solid2(DImg& src, DImg& dest, const DColor& fg, int borderWidth)
{
    dest = DImg(src.width() + borderWidth * 2, src.height() + borderWidth * 2,
                src.sixteenBit(), src.hasAlpha());
    dest.fill(fg);
    dest.bitBltImage(&src, borderWidth, borderWidth);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例4: solid

void BorderFilter::solid(DImg& src, DImg& dest, const DColor& fg, int borderWidth)
{
    if (d->settings.orgWidth > d->settings.orgHeight)
    {
        int height = src.height() + borderWidth * 2;
        dest       = DImg((int)(height * d->orgRatio), height, src.sixteenBit(), src.hasAlpha());
        dest.fill(fg);
        dest.bitBltImage(&src, (dest.width() - src.width()) / 2, borderWidth);
    }
    else
    {
        int width = src.width() + borderWidth * 2;
        dest      = DImg(width, (int)(width / d->orgRatio), src.sixteenBit(), src.hasAlpha());
        dest.fill(fg);
        dest.bitBltImage(&src, borderWidth, (dest.height() - src.height()) / 2);
    }
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例5: applyBCG

void BCGFilter::applyBCG(DImg& image)
{
    if (image.isNull())
    {
        return;
    }

    applyBCG(image.bits(), image.width(), image.height(), image.sixteenBit());
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:9,代码来源:bcgfilter.cpp

示例6: applyToneFilter

void BWSepiaFilter::applyToneFilter(DImg& img, TonalityContainer& settings)
{
    // Value to multiply RGB 8 bits component of mask used by TonalityFilter.
    int mul            = img.sixteenBit() ? 255 : 1;
    settings.redMask   = settings.redMask   * mul;
    settings.greenMask = settings.greenMask * mul;
    settings.blueMask  = settings.blueMask  * mul;
    TonalityFilter tone(&img, 0L, settings);
    tone.startFilterDirectly();
    img.putImageData(tone.getTargetImage().bits());
}
开发者ID:KDE,项目名称:digikam,代码行数:11,代码来源:bwsepiafilter.cpp

示例7: setPreviewImage

void RawImport::setPreviewImage()
{
    // Preserve metadata from loaded image, and take post-processed image data
    d->postProcessedImage = d->previewWidget->demosaicedImage().copyMetaData();
    DImg data             = filter()->getTargetImage();
    d->postProcessedImage.putImageData(data.width(), data.height(), data.sixteenBit(), data.hasAlpha(),
                                       data.stripImageData(), false);
    d->previewWidget->setPostProcessedImage(d->postProcessedImage);
    d->settingsBox->setPostProcessedImage(d->postProcessedImage);
    EditorToolIface::editorToolIface()->setToolStopProgress();
    setBusy(false);
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:12,代码来源:rawimport.cpp

示例8: pattern

void BorderFilter::pattern(DImg& src, DImg& dest, int borderWidth,
                           const DColor& firstColor, const DColor& secondColor,
                           int firstWidth, int secondWidth)
{
    // Original image with the first solid border around.
    DImg tmp;
    solid(src, tmp, firstColor, firstWidth);

    // Border tiled image using pattern with second solid border around.
    int width, height;

    if (d->settings.orgWidth > d->settings.orgHeight)
    {
        height = tmp.height() + borderWidth * 2;
        width  = (int)(height * d->orgRatio);
    }
    else
    {
        width  = tmp.width() + borderWidth * 2;
        height = (int)(width / d->orgRatio);
    }

    DImg tmp2(width, height, tmp.sixteenBit(), tmp.hasAlpha());
    qCDebug(DIGIKAM_DIMG_LOG) << "Border File:" << d->settings.borderPath;
    DImg border(d->settings.borderPath);

    if (border.isNull())
    {
        return;
    }

    border.convertToDepthOfImage(&tmp2);

    for (int x = 0 ; x < width ; x += border.width())
    {
        for (int y = 0 ; y < height ; y += border.height())
        {
            tmp2.bitBltImage(&border, x, y);
        }
    }

    solid(tmp2, dest, secondColor, secondWidth);

    // Merge both images to one.
    if (d->settings.orgWidth > d->settings.orgHeight)
    {
        dest.bitBltImage(&tmp, (dest.width() - tmp.width()) / 2, borderWidth);
    }
    else
    {
        dest.bitBltImage(&tmp, borderWidth, (dest.height() - tmp.height()) / 2);
    }
}
开发者ID:,项目名称:,代码行数:53,代码来源:

示例9: DColor

void BorderFilter::Private::setup(const DImg& m_orgImage)
{
    solidColor            = DColor(settings.solidColor,            m_orgImage.sixteenBit());
    niepceBorderColor     = DColor(settings.niepceBorderColor,     m_orgImage.sixteenBit());
    niepceLineColor       = DColor(settings.niepceLineColor,       m_orgImage.sixteenBit());
    bevelUpperLeftColor   = DColor(settings.bevelUpperLeftColor,   m_orgImage.sixteenBit());
    bevelLowerRightColor  = DColor(settings.bevelLowerRightColor,  m_orgImage.sixteenBit());
    decorativeFirstColor  = DColor(settings.decorativeFirstColor,  m_orgImage.sixteenBit());
    decorativeSecondColor = DColor(settings.decorativeSecondColor, m_orgImage.sixteenBit());

    if (settings.preserveAspectRatio)
    {
        orgRatio        = (float)settings.orgWidth / (float)settings.orgHeight;
        int size        = qMin(m_orgImage.height(), m_orgImage.width());
        borderMainWidth = (int)(size * settings.borderPercent);
        border2ndWidth  = (int)(size * 0.005);

        // Clamp internal border with to 1 pixel to be visible with small image.
        if (border2ndWidth < 1)
        {
            border2ndWidth = 1;
        }
    }
}
开发者ID:,项目名称:,代码行数:24,代码来源:

示例10: copyQImage

QImage DImg::copyQImage(int x, int y, int w, int h) const
{
    if (isNull())
    {
        return QImage();
    }

    DImg img = copy(x, y, w, h);

    if (img.sixteenBit())
    {
        img.convertDepth(32);
    }

    return img.copyQImage();
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例11: getDescription

TransformDescription IccTransform::getDescription(const DImg& image)
{
    TransformDescription description;

    description.inputProfile  = d->effectiveInputProfile();
    description.outputProfile = d->outputProfile;
    description.intent        = renderingIntentToLcmsIntent(d->intent);

    if (d->useBPC)
    {
        description.transformFlags |= cmsFLAGS_WHITEBLACKCOMPENSATION;
    }

    LcmsLock lock;

    // Do not use TYPE_BGR_ - this implies 3 bytes per pixel, but even if !image.hasAlpha(),
    // our image data has 4 bytes per pixel with the fourth byte filled with 0xFF.
    if (image.sixteenBit())
    {
/*
        switch (dkCmsGetColorSpace(description.inputProfile))
        {
            case icSigGrayData:
                description.inputFormat = TYPE_GRAYA_16;
                break;
            case icSigCmykData:
                description.inputFormat = TYPE_CMYK_16;
                break;
            default:
                description.inputFormat = TYPE_BGRA_16;
        }
*/

        // A Dimg is always BGRA, converted by the loader
        description.inputFormat  = TYPE_BGRA_16;
        description.outputFormat = TYPE_BGRA_16;
    }
    else
    {
        description.inputFormat  = TYPE_BGRA_8;
        description.outputFormat = TYPE_BGRA_8;
    }

    return description;
}
开发者ID:KDE,项目名称:digikam,代码行数:45,代码来源:icctransform.cpp

示例12: setSelection

void ImageIface::setSelection(const QString& caller, const FilterAction& action, const DImg& img)
{
    if (img.hasAlpha()   != originalHasAlpha()     ||
        img.sixteenBit() != originalSixteenBit()   ||
        img.size()       != selectionRect().size()
       )
    {
        kDebug() << "Properties of image to overwrite selection differs than original image";
        return;
    }

    if (img.isNull())
    {
        kDebug() << "No image data to handle";
        return;
    }

    d->core->putImgSelection(caller, action, img);
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:19,代码来源:imageiface.cpp

示例13: border

void BorderFilter::pattern2(DImg& src, DImg& dest, int borderWidth,
                            const DColor& firstColor, const DColor& secondColor,
                            int firstWidth, int secondWidth)
{
    // Border tile.

    int w = d->settings.orgWidth + borderWidth * 2;
    int h = d->settings.orgHeight + borderWidth * 2;

    qCDebug(DIGIKAM_DIMG_LOG) << "Border File:" << d->settings.borderPath;
    DImg border(d->settings.borderPath);

    if (border.isNull())
    {
        return;
    }

    DImg borderImg(w, h, src.sixteenBit(), src.hasAlpha());
    border.convertToDepthOfImage(&borderImg);

    for (int x = 0 ; x < w ; x += border.width())
    {
        for (int y = 0 ; y < h ; y += border.height())
        {
            borderImg.bitBltImage(&border, x, y);
        }
    }

    // First line around the pattern tile.
    DImg tmp = borderImg.smoothScale(src.width() + borderWidth * 2,
                                     src.height() + borderWidth * 2);

    solid2(tmp, dest, firstColor, firstWidth);

    // Second line around original image.
    tmp.reset();
    solid2(src, tmp, secondColor, secondWidth);

    // Copy original image.
    dest.bitBltImage(&tmp, borderWidth, borderWidth);
}
开发者ID:,项目名称:,代码行数:41,代码来源:

示例14: setPreview

void ImageIface::setPreview(const DImg& img)
{
    if (img.hasAlpha()   != previewHasAlpha()   ||
        img.sixteenBit() != previewSixteenBit()
       )
    {
        kDebug() << "Properties of image differs than preview";
        return;
    }

    uchar* const data = img.bits();

    if (!data)
    {
        kDebug() << "No preview image data to handle";
        return;
    }

    d->targetPreviewImage.detach();
    d->targetPreviewImage.putImageData(data);
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:21,代码来源:imageiface.cpp

示例15: DImgThreadedFilter

SharpenFilter::SharpenFilter(DImgThreadedFilter* const parentFilter,
                             const DImg& orgImage, const DImg& destImage,
                             int progressBegin, int progressEnd, double radius, double sigma)
    : DImgThreadedFilter(parentFilter, orgImage, destImage, progressBegin, progressEnd,
                         parentFilter->filterName() + QLatin1String(": Sharpen"))
{
    m_radius = radius;
    m_sigma  = sigma;

    // We need to provide support for orgImage == destImage.
    // The algorithm does not support this out of the box, so use a temporary.
    if (orgImage.bits() == destImage.bits())
    {
        m_destImage = DImg(destImage.width(), destImage.height(), destImage.sixteenBit());
    }

    filterImage();

    if (orgImage.bits() == destImage.bits())
    {
        memcpy(destImage.bits(), m_destImage.bits(), m_destImage.numBytes());
    }
}
开发者ID:Match-Yang,项目名称:digikam,代码行数:23,代码来源:sharpenfilter.cpp


注:本文中的DImg::sixteenBit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。