本文整理汇总了C++中SmartPointer::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPointer::Get方法的具体用法?C++ SmartPointer::Get怎么用?C++ SmartPointer::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPointer
的用法示例。
在下文中一共展示了SmartPointer::Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
DibChunkerImpl::EndChunk ()
{
// cut off white lines
numScanLines -= blankLines;
long bytesInChunk = (rightPos - leftPos + 1);
int x;
long biWidth;
long bytesPerLine;
bool monochromize24 = false;
switch (bitmapInfoHeader.biBitCount)
{
case 1:
x = leftPos * 8;
biWidth = bytesInChunk * 8;
bytesPerLine = BytesPerLine(biWidth, 1);
break;
case 4:
x = leftPos * 2;
biWidth = bytesInChunk * 2;
bytesPerLine = BytesPerLine(biWidth, 4);
break;
case 8:
x = leftPos;
biWidth = bytesInChunk;
bytesPerLine = BytesPerLine(biWidth, 8);
break;
case 24:
MIKTEX_ASSERT (leftPos % 3 == 0);
x = leftPos / 3;
MIKTEX_ASSERT (bytesInChunk % 3 == 0);
biWidth = bytesInChunk / 3;
#if 1
if (isBlackAndWhite)
{
monochromize24 = true;
bytesPerLine = BytesPerLine(biWidth, 1);
}
else
#endif
{
bytesPerLine = BytesPerLine(biWidth, 24);
}
break;
default:
UNEXPECTED_CONDITION ("DibChunkerImpl::EndChunk");
}
SmartPointer<DibChunkImpl>
pChunk (new DibChunkImpl(bytesPerLine, numScanLines));
pChunk->SetX (x);
// make chunked bitmap info header
BITMAPINFOHEADER bitmapinfoheader;
bitmapinfoheader = this->bitmapInfoHeader;
bitmapinfoheader.biHeight = numScanLines;
bitmapinfoheader.biWidth = biWidth;
bitmapinfoheader.biSizeImage = 0;
const RGBQUAD * pColors = 0;
unsigned numColors = 0;
if (monochromize24)
{
bitmapinfoheader.biBitCount = 1;
numColors = 2;
pColors = &whiteAndBlack[0];
}
else
{
numColors = this->numColors;
pColors = this->pColors;
}
// <fixme>okay?
int y = yPosChunk;
y += bitmapinfoheader.biHeight - 1;
y = this->bitmapInfoHeader.biHeight - y;
pChunk->SetY (y);
// </fixme>
unsigned char * pBits =
reinterpret_cast<unsigned char*>(pChunk->GetBits2());
for (unsigned long i = 0; i < numScanLines; ++ i)
{
const unsigned char * pSrc = this->pBits + i * BytesPerLine() + leftPos;
unsigned char * pDest = pBits + i * bytesPerLine;
memset (pDest, 0, bytesPerLine);
if (monochromize24)
{
Monochromize24 (pSrc, pDest, biWidth);
}
else
{
memcpy (pDest, pSrc, bytesInChunk);
}
}
trace_dib->WriteFormattedLine
("libdib",
T_("shipping chunk: x=%ld, y=%ld, w=%ld, h=%ld, monochromized=%s"),
pChunk->GetX(),
pChunk->GetY(),
//.........这里部分代码省略.........