本文整理汇总了C++中LLPointer::biasedScaleToPowerOfTwo方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPointer::biasedScaleToPowerOfTwo方法的具体用法?C++ LLPointer::biasedScaleToPowerOfTwo怎么用?C++ LLPointer::biasedScaleToPowerOfTwo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPointer
的用法示例。
在下文中一共展示了LLPointer::biasedScaleToPowerOfTwo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// note: modifies the argument raw_image!!!!
LLPointer<LLImageJ2C> LLViewerImageList::convertToUploadFile(LLPointer<LLImageRaw> raw_image)
{
raw_image->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT);
LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C();
compressedImage->setRate(0.f);
if (gSavedSettings.getBOOL("LosslessJ2CUpload") &&
(raw_image->getWidth() * raw_image->getHeight() <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF))
compressedImage->setReversible(TRUE);
compressedImage->encode(raw_image, 0.0f);
return compressedImage;
}
示例2: onClickSnapshot
// static
void LLFloaterAuction::onClickSnapshot(void* data)
{
LLFloaterAuction* self = (LLFloaterAuction*)(data);
LLPointer<LLImageRaw> raw = new LLImageRaw;
gForceRenderLandFence = self->getChild<LLUICtrl>("fence_check")->getValue().asBoolean();
BOOL success = gViewerWindow->rawSnapshot(raw,
gViewerWindow->getWindowWidthScaled(),
gViewerWindow->getWindowHeightScaled(),
TRUE, FALSE,
FALSE, FALSE);
gForceRenderLandFence = FALSE;
if (success)
{
self->mTransactionID.generate();
self->mImageID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID());
// <FS:PP> FIRE-8190: Preview function for "UI Sounds" Panel
// if(!gSavedSettings.getBOOL("QuietSnapshotsToDisk"))
if(!gSavedSettings.getBOOL("PlayModeUISndSnapshot"))
// </FS:PP> FIRE-8190: Preview function for "UI Sounds" Panel
{
gViewerWindow->playSnapshotAnimAndSound();
}
llinfos << "Writing TGA..." << llendl;
LLPointer<LLImageTGA> tga = new LLImageTGA;
tga->encode(raw);
LLVFile::writeFile(tga->getData(), tga->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_IMAGE_TGA);
raw->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
llinfos << "Writing J2C..." << llendl;
LLPointer<LLImageJ2C> j2c = new LLImageJ2C;
j2c->encode(raw, 0.0f);
LLVFile::writeFile(j2c->getData(), j2c->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_TEXTURE);
self->mImage = LLViewerTextureManager::getLocalTexture((LLImageRaw*)raw, FALSE);
gGL.getTexUnit(0)->bind(self->mImage);
self->mImage->setAddressMode(LLTexUnit::TAM_CLAMP);
}
else
{
llwarns << "Unable to take snapshot" << llendl;
}
}
示例3: onClickSnapshot
// static
void LLFloaterAuction::onClickSnapshot(void* data)
{
LLFloaterAuction* self = (LLFloaterAuction*)(data);
LLPointer<LLImageRaw> raw = new LLImageRaw;
gForceRenderLandFence = self->childGetValue("fence_check").asBoolean();
BOOL success = gViewerWindow->rawSnapshot(raw,
gViewerWindow->getWindowWidth(),
gViewerWindow->getWindowHeight(),
TRUE, FALSE,
FALSE, FALSE);
gForceRenderLandFence = FALSE;
if (success)
{
self->mTransactionID.generate();
self->mImageID = self->mTransactionID.makeAssetID(gAgent.getSecureSessionID());
if(!gSavedSettings.getBOOL("QuietSnapshotsToDisk"))
{
gViewerWindow->playSnapshotAnimAndSound();
}
llinfos << "Writing TGA..." << llendl;
LLPointer<LLImageTGA> tga = new LLImageTGA;
tga->encode(raw);
LLVFile::writeFile(tga->getData(), tga->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_IMAGE_TGA);
raw->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT);
llinfos << "Writing J2C..." << llendl;
LLPointer<LLImageJ2C> j2c = new LLImageJ2C;
j2c->encode(raw, 0.0f);
LLVFile::writeFile(j2c->getData(), j2c->getDataSize(), gVFS, self->mImageID, LLAssetType::AT_TEXTURE);
self->mImage = new LLImageGL((LLImageRaw*)raw, FALSE);
self->mImage->bind();
self->mImage->setClamp(TRUE, TRUE);
}
else
{
llwarns << "Unable to take snapshot" << llendl;
}
}
示例4:
// note: modifies the argument raw_image!!!!
LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImageRaw> raw_image)
{
raw_image->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT);
LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C();
compressedImage->setRate(0.f);
if (gSavedSettings.getBOOL("LosslessJ2CUpload") &&
(raw_image->getWidth() * raw_image->getHeight() <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF))
compressedImage->setReversible(TRUE);
compressedImage->encode(raw_image, 0.0f);
if (!compressedImage->encode(raw_image, 0.0f))
{
llinfos << "convertToUploadFile : encode returns with error!!" << llendl;
// Clear up the pointer so we don't leak that one
compressedImage = NULL;
}
return compressedImage;
}