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


C++ ColorBlock::colors方法代码示例

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


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

示例1: colours

void CompressorDXT5::compressBlock(ColorBlock & rgba, nvtt::AlphaMode alphaMode, const nvtt::CompressionOptions::Private & compressionOptions, void * output)
{
    BlockDXT5 * block = new(output) BlockDXT5;

    // Compress alpha.
    if (compressionOptions.quality == Quality_Highest)
    {
        OptimalCompress::compressDXT5A(rgba, &block->alpha);
    }
    else
    {
        QuickCompress::compressDXT5A(rgba, &block->alpha);
    }

    // Compress color.
    if (rgba.isSingleColor())
    {
        OptimalCompress::compressDXT1(rgba.color(0), &block->color);
    }
    else
    {
        nvsquish::WeightedClusterFit fit;
        fit.SetMetric(compressionOptions.colorWeight.x, compressionOptions.colorWeight.y, compressionOptions.colorWeight.z);

        int flags = 0;
        if (alphaMode == nvtt::AlphaMode_Transparency) flags |= nvsquish::kWeightColourByAlpha;

        nvsquish::ColourSet colours((uint8 *)rgba.colors(), flags);
        fit.SetColourSet(&colours, 0);
        fit.Compress(&block->color);
    }
}
开发者ID:August520,项目名称:nvidia-texture-tools,代码行数:32,代码来源:CompressorDX9.cpp

示例2: compressBlock

void RgEtcCompressor::compressBlock(ColorBlock & rgba, AlphaMode alphaMode, const CompressionOptions::Private & compressionOptions, void * output)
{
    rg_etc1::etc1_pack_params pack_params;

    pack_params.m_quality = rg_etc1::cMediumQuality;
    if (compressionOptions.quality == Quality_Fastest) pack_params.m_quality = rg_etc1::cLowQuality;
    else if (compressionOptions.quality == Quality_Production) pack_params.m_quality = rg_etc1::cHighQuality;
    else if (compressionOptions.quality == Quality_Highest) pack_params.m_quality = rg_etc1::cHighQuality;
    else if (compressionOptions.quality == Quality_Normal) pack_params.m_quality = rg_etc1::cMediumQuality;

    rgba.swizzle(2, 1, 0, 3);
    rg_etc1::pack_etc1_block(output, (uint *)rgba.colors(), pack_params);

    //Vector4 result[16];
    //nv::decompress_etc(output, result);

}
开发者ID:madscientist159,项目名称:nvidia-texture-tools,代码行数:17,代码来源:BlockCompressor.cpp

示例3:

void StbCompressorDXT1::compressBlock(ColorBlock & rgba, nvtt::AlphaMode alphaMode, const nvtt::CompressionOptions::Private & compressionOptions, void * output)
{
    rgba.swizzle(2, 1, 0, 3); // Swap R and B
    stb_compress_dxt_block((unsigned char *)output, (unsigned char *)rgba.colors(), 0, 0);
}
开发者ID:August520,项目名称:nvidia-texture-tools,代码行数:5,代码来源:CompressorDX9.cpp


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