Пример #1
0
bool
DPXInput::read_native_scanline (int y, int z, void *data)
{
    dpx::Block block(0, y, m_dpx.header.Width () - 1, y);

    if (m_wantRaw) {
        // fast path - just read the scanline in
        if (!m_dpx.ReadBlock (m_subimage, (unsigned char *)data, block))
            return false;
    } else {
        // read the scanline and convert to RGB
        void *ptr = m_dataPtr == NULL ? data : (void *)m_dataPtr;

        if (!m_dpx.ReadBlock (m_subimage, (unsigned char *)ptr, block))
            return false;

        if (!dpx::ConvertToRGB (m_dpx.header, m_subimage, ptr, data, block))
            return false;
    }
    
    return true;
}
Пример #2
0
bool
DPXInput::read_native_scanline (int y, int z, void *data)
{
    dpx::Block block(0, y, m_dpx.header.Width () - 1, y);

    if (m_wantRaw) {
        // fast path - just read the scanline in
        if (!m_dpx.ReadBlock (data, m_dpx.header.ComponentDataSize (m_subimage),
            block, m_dpx.header.ImageDescriptor (m_subimage)))
            return false;
    } else {
        // read the scanline and convert to RGB
        void *ptr = m_dataPtr == NULL ? data : (void *)m_dataPtr;

        if (!m_dpx.ReadBlock (ptr, m_dpx.header.ComponentDataSize (m_subimage),
            block, m_dpx.header.ImageDescriptor (m_subimage)))
            return false;

        if (!dpx::ConvertToRGB (m_dpx.header, m_subimage, ptr, data, block))
            return false;
    }
    
    return true;
}