예제 #1
0
bool ImageLoaderTGA::ReadData() {
  Targa tga;
  if (targa_loadFromData(&tga, m_RawData, m_NumRawDataBytes) < 0) {
    return false;
  }

  m_Width = tga.width;
  m_Height = tga.height;

  assert(static_cast<uint32>(tga.imageLength) == m_Width * m_Height * 4);

  return LoadFromPixelBuffer(reinterpret_cast<uint32 *>(tga.image), true);
}
예제 #2
0
bool ImageLoaderPVR::ReadData() {
  pvrtexture::CPVRTexture pvrTex((const void *)m_RawData);
  if(!pvrtexture::Transcode(pvrTex,
                            pvrtexture::PVRStandard8PixelType,
                            ePVRTVarTypeUnsignedByte,
                            ePVRTCSpacelRGB)) {
    ReportError("Unable to convert PVRTexture... possibly failed to load file");
    return false;
  }

  const pvrtexture::CPVRTextureHeader &hdr = pvrTex.getHeader();

  m_Width = hdr.getWidth();
  m_Height = hdr.getHeight();

  return LoadFromPixelBuffer(reinterpret_cast<uint32 *>(pvrTex.getDataPtr()));
}