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


C++ CubeMapTexture::image方法代码示例

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


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

示例1: imageBuffer

void CubeMapTextureGLTest::imageBuffer() {
    CubeMapTexture texture;
    texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8,
        BufferImage2D(ColorFormat::RGBA, ColorType::UnsignedByte, Vector2i(2), Data, BufferUsage::StaticDraw));

    MAGNUM_VERIFY_NO_ERROR();

    /** @todo How to test this on ES? */
    #ifndef MAGNUM_TARGET_GLES
    BufferImage2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, {ColorFormat::RGBA, ColorType::UnsignedByte}, BufferUsage::StaticRead);
    const auto imageData = image.buffer().data<UnsignedByte>();

    MAGNUM_VERIFY_NO_ERROR();

    CORRADE_COMPARE(image.size(), Vector2i(2));
    CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container);
    #endif
}
开发者ID:NextGenIntelligence,项目名称:magnum,代码行数:18,代码来源:CubeMapTextureGLTest.cpp

示例2: imageFullBuffer

void CubeMapTextureGLTest::imageFullBuffer() {
    if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
        CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));

    CubeMapTexture texture;
    texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2})
        .setSubImage(0, {}, BufferImage3D{ColorFormat::RGBA, ColorType::UnsignedByte, Vector3i{2, 2, 6}, DataFull, BufferUsage::StaticDraw});

    MAGNUM_VERIFY_NO_ERROR();

    BufferImage3D image = texture.image(0, {ColorFormat::RGBA, ColorType::UnsignedByte}, BufferUsage::StaticRead);

    MAGNUM_VERIFY_NO_ERROR();

    CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6));
    const auto imageData = image.buffer().data<UnsignedByte>();
    CORRADE_COMPARE_AS(imageData, Containers::ArrayReference<const UnsignedByte>{DataFull}, TestSuite::Compare::Container);
}
开发者ID:NextGenIntelligence,项目名称:magnum,代码行数:18,代码来源:CubeMapTextureGLTest.cpp

示例3: image

void CubeMapTextureGLTest::image() {
    CubeMapTexture texture;
    texture.setImage(CubeMapTexture::Coordinate::PositiveX, 0, TextureFormat::RGBA8,
        ImageReference2D(ColorFormat::RGBA, ColorType::UnsignedByte, Vector2i(2), Data));

    MAGNUM_VERIFY_NO_ERROR();

    /** @todo How to test this on ES? */
    #ifndef MAGNUM_TARGET_GLES
    Image2D image = texture.image(CubeMapTexture::Coordinate::PositiveX, 0, {ColorFormat::RGBA, ColorType::UnsignedByte});

    MAGNUM_VERIFY_NO_ERROR();

    CORRADE_COMPARE(image.size(), Vector2i(2));
    CORRADE_COMPARE_AS(
        Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
        Containers::ArrayReference<const UnsignedByte>{Data}, TestSuite::Compare::Container);
    #endif
}
开发者ID:NextGenIntelligence,项目名称:magnum,代码行数:19,代码来源:CubeMapTextureGLTest.cpp

示例4: imageFull

void CubeMapTextureGLTest::imageFull() {
    if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
        CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));

    CubeMapTexture texture;
    texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2, 2})
        .setSubImage(0, {}, ImageReference3D{ColorFormat::RGBA, ColorType::UnsignedByte, Vector3i{2, 2, 6}, DataFull});

    MAGNUM_VERIFY_NO_ERROR();

    Image3D image = texture.image(0, {ColorFormat::RGBA, ColorType::UnsignedByte});

    MAGNUM_VERIFY_NO_ERROR();

    CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6));
    CORRADE_COMPARE_AS(
        Containers::ArrayReference<const UnsignedByte>(image.data<UnsignedByte>(), image.pixelSize()*image.size().product()),
        Containers::ArrayReference<const UnsignedByte>{DataFull}, TestSuite::Compare::Container);
}
开发者ID:NextGenIntelligence,项目名称:magnum,代码行数:19,代码来源:CubeMapTextureGLTest.cpp


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