📄 rgb4k216m.cpp
字号:
//
// Rgb4K216M
// Pipeline stage converts a 12-bit per pixel RGB image to 24-bit per pixel.
// Each 4-bit color value is shifted 4 bits to the left.
//
// Copyright (C) 2003, 2006 by Jon A. Webb (Contact via GMail; username is jonawebb)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#include "Rgb4K216M.h"
#include "Debug.h"
#include "Image.h"
#include "ImageSize.h"
#include "Replicate.h"
#include "RGBImageIter.h"
#include "RGB12bppImageIter.h"
#include <e32std.h>
#include <fbs.h>
using namespace Core;
namespace Algorithm
{
EXPORT_C CRgb4K216M* CRgb4K216M::NewL()
{
return new (ELeave) CRgb4K216M();
}
CRgb4K216M::~CRgb4K216M()
{
}
CRgb4K216M::CRgb4K216M() :
ibEmpty(true)
{
}
CImage CRgb4K216M::FrontL()
{
if (ibEmpty) {
User::Leave(KErrGeneral);
return CImage();
}
ibEmpty = true;
return iImage;
}
void CRgb4K216M::PushL(CImage image)
{
IReplicate rRepl(image);
rRepl.CastL(iImage, EColor16M);
image.LockLC();
IRgbImageIter rOutput(iImage);
IRgb12bppImageIter rInput(image);
for (; !rInput.End(); rInput.NextRow(), rOutput.NextRow()) {
for (; !rInput.REnd(); rInput++, rOutput++) {
rOutput[R] = rInput[R];
rOutput[G] = rInput[G];
rOutput[B] = rInput[B];
}
}
CleanupStack::PopAndDestroy(); // unlock bitmaps
CDebug::ShowImage(iImage);
ibEmpty = false;
}
bool CRgb4K216M::Empty() const
{
return ibEmpty;
}
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -