/* /-------------------------------------------------------------------- | | $Id: plsubbmp.cpp,v 1.5 2004/09/11 12:41:35 uzadow Exp $ | | Copyright (c) 1996-2002 Ulrich von Zadow | \-------------------------------------------------------------------- */ #include "plsubbmp.h" #include "plrect.h" #include "plexcept.h" #include using namespace std; PLSubBmp::PLSubBmp () { m_pLineArray=0; m_pClrTab=0; } PLSubBmp::~PLSubBmp () { // Free the memory. freeMembers(); } void PLSubBmp::Create ( PLBmpBase & SrcBmp, const PLRect & SrcRect ) { PLASSERT (!m_pLineArray); int bpp = SrcBmp.GetBitsPerPixel(); if (bpp <= 8) m_pClrTab = new PLPixel32 [1 << bpp]; else m_pClrTab = NULL; initLocals (SrcRect.Width(), SrcRect.Height(), SrcBmp.GetPixelFormat()); if (bpp <= 8) SetPalette (SrcBmp.GetPalette()); m_pLineArray = new PLBYTE * [m_Size.y]; PLBYTE** ppSrcLines = SrcBmp.GetLineArray(); int XOfs = SrcRect.tl.x*(bpp/8); for (int y=0; y