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


C++ ImageDecoder::init方法代码示例

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


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

示例1: _SYS_image_memDrawRect

void _SYS_image_memDrawRect(uint16_t *dest, _SYSCubeID destCID,
    const _SYSAssetImage *im, unsigned dest_stride, unsigned frame,
    struct _SYSInt2 *srcXY, struct _SYSInt2 *size)
{
    if (!isAligned(dest, 2) || !isAligned(im) || !isAligned(srcXY) || !isAligned(size))
        return SvmRuntime::fault(F_SYSCALL_ADDR_ALIGN);

    struct _SYSInt2 lSrcXY, lSize;
    if (!SvmMemory::copyROData(lSrcXY, srcXY))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);
    if (!SvmMemory::copyROData(lSize, size))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);

    ImageDecoder decoder;
    if (destCID == _SYS_CUBE_ID_INVALID) {
        // Relocation disabled
        if (!decoder.init(im))
            return SvmRuntime::fault(F_BAD_ASSET_IMAGE);
    } else {
        // Relocate to a specific cube (validated by decoder.init)
        if (!decoder.init(im, destCID))
            return SvmRuntime::fault(F_BAD_ASSET_IMAGE);
    }

    ImageIter iter(decoder, frame, lSrcXY.x, lSrcXY.y, lSize.x, lSize.y);

    if (!SvmMemory::mapRAM(dest, iter.getDestBytes(dest_stride)))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);

    iter.copyToMem(dest, dest_stride);
}
开发者ID:andrewsmyk,项目名称:thundercracker,代码行数:31,代码来源:syscall_image.cpp

示例2: _SYS_image_BG1DrawRect

void _SYS_image_BG1DrawRect(struct _SYSAttachedVideoBuffer *vbuf,
    const _SYSAssetImage *im, struct _SYSInt2 *destXY, unsigned frame,
        struct _SYSInt2 *srcXY, struct _SYSInt2 *size)
{
    if (!isAligned(vbuf) || !isAligned(im) ||
        !isAligned(destXY) || !isAligned(srcXY) || !isAligned(size))
        return SvmRuntime::fault(F_SYSCALL_ADDR_ALIGN);

    if (!SvmMemory::mapRAM(vbuf))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);

    struct _SYSInt2 lDestXY, lSrcXY, lSize;
    if (!SvmMemory::copyROData(lDestXY, destXY))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);
    if (!SvmMemory::copyROData(lSrcXY, srcXY))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);
    if (!SvmMemory::copyROData(lSize, size))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);

    ImageDecoder decoder;
    if (!decoder.init(im, vbuf->cube))
        return SvmRuntime::fault(F_BAD_ASSET_IMAGE);

    ImageIter iter(decoder, frame, lSrcXY.x, lSrcXY.y, lSize.x, lSize.y);
    iter.copyToBG1(vbuf->vbuf, lDestXY.x, lDestXY.y);
}
开发者ID:andrewsmyk,项目名称:thundercracker,代码行数:26,代码来源:syscall_image.cpp

示例3: _SYS_image_BG0Draw

void _SYS_image_BG0Draw(struct _SYSAttachedVideoBuffer *vbuf,
    const _SYSAssetImage *im, uint16_t addr, unsigned frame)
{
    if (!isAligned(vbuf) || !isAligned(im))
        return SvmRuntime::fault(F_SYSCALL_ADDR_ALIGN);

    if (!SvmMemory::mapRAM(vbuf))
        return SvmRuntime::fault(F_SYSCALL_ADDRESS);

    ImageDecoder decoder;
    if (!decoder.init(im, vbuf->cube))
        return SvmRuntime::fault(F_BAD_ASSET_IMAGE);

    ImageIter iter(decoder, frame);
    iter.copyToVRAM(vbuf->vbuf, addr, _SYS_VRAM_BG0_WIDTH);
}
开发者ID:andrewsmyk,项目名称:thundercracker,代码行数:16,代码来源:syscall_image.cpp


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