本文整理汇总了C++中LLViewerImage::getHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerImage::getHeight方法的具体用法?C++ LLViewerImage::getHeight怎么用?C++ LLViewerImage::getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerImage
的用法示例。
在下文中一共展示了LLViewerImage::getHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shutdown
void LLViewerImageList::shutdown()
{
// clear out preloads
mImagePreloads.clear();
// Write out list of currently loaded textures for precaching on startup
typedef std::set<std::pair<S32,LLViewerImage*> > image_area_list_t;
image_area_list_t image_area_list;
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); ++iter)
{
LLViewerImage* image = *iter;
if (!image->getUseDiscard() ||
image->needsAux() ||
image->getTargetHost() != LLHost::invalid)
{
continue; // avoid UI, baked, and other special images
}
S32 desired = image->getDesiredDiscardLevel();
if (desired >= 0 && desired < MAX_DISCARD_LEVEL)
{
S32 pixel_area = image->getWidth(desired) * image->getHeight(desired);
image_area_list.insert(std::make_pair(pixel_area, image));
}
}
LLSD imagelist;
const S32 max_count = 1000;
S32 count = 0;
for (image_area_list_t::reverse_iterator riter = image_area_list.rbegin();
riter != image_area_list.rend(); ++riter)
{
LLViewerImage* image = riter->second;
imagelist[count]["area"] = riter->first;
imagelist[count]["uuid"] = image->getID();
if (++count >= max_count)
break;
}
if (count > 0 && !gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "").empty())
{
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
llofstream file;
file.open(filename);
LLSDSerialize::toPrettyXML(imagelist, file);
}
//
// Clean up "loaded" callbacks.
//
mCallbackList.clear();
// Flush all of the references
mLoadingStreamList.clear();
mCreateTextureList.clear();
mUUIDMap.clear();
mImageList.clear();
}
示例2: dump
void LLViewerImageList::dump()
{
llinfos << "LLViewerImageList::dump()" << llendl;
for (image_priority_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it)
{
LLViewerImage* image = *it;
llinfos << "priority " << image->getDecodePriority()
<< " boost " << image->getBoostLevel()
<< " size " << image->getWidth() << "x" << image->getHeight()
<< " discard " << image->getDiscardLevel()
<< " desired " << image->getDesiredDiscardLevel()
<< " http://asset.siva.lindenlab.com/" << image->getID() << ".texture"
<< llendl;
}
}
示例3: generateTexture
BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
const F32 width, const F32 height)
{
llassert(mSurfacep);
llassert(x >= 0.f);
llassert(y >= 0.f);
LLTimer gen_timer;
///////////////////////////
//
// Generate raw data arrays for surface textures
//
//
// These have already been validated by generateComposition.
U8* st_data[4];
S32 st_data_size[4]; // for debugging
for (S32 i = 0; i < 4; i++)
{
if (mRawImages[i].isNull())
{
// Read back a raw image for this discard level, if it exists
mRawImages[i] = new LLImageRaw;
S32 min_dim = llmin(mDetailTextures[i]->getWidth(0), mDetailTextures[i]->getHeight(0));
S32 ddiscard = 0;
while (min_dim > BASE_SIZE && ddiscard < MAX_DISCARD_LEVEL)
{
ddiscard++;
min_dim /= 2;
}
mRawImages[i] = mDetailTextures[i]->getCachedRawImage() ;
if (!mRawImages[i])
{
llwarns << "no cached raw data for terrain detail texture: " << mDetailTextures[i]->getID() << llendl;
return FALSE;
}
if (mDetailTextures[i]->getWidth(ddiscard) != BASE_SIZE ||
mDetailTextures[i]->getHeight(ddiscard) != BASE_SIZE ||
mDetailTextures[i]->getComponents() != 3)
{
LLPointer<LLImageRaw> newraw = new LLImageRaw(BASE_SIZE, BASE_SIZE, 3);
newraw->composite(mRawImages[i]);
mRawImages[i] = newraw; // deletes old
}
}
st_data[i] = mRawImages[i]->getData();
st_data_size[i] = mRawImages[i]->getDataSize();
}
///////////////////////////////////////
//
// Generate and clamp x/y bounding box.
//
//
S32 x_begin, y_begin, x_end, y_end;
x_begin = (S32)(x * mScaleInv);
y_begin = (S32)(y * mScaleInv);
x_end = llround( (x + width) * mScaleInv );
y_end = llround( (y + width) * mScaleInv );
if (x_end > mWidth)
{
llwarns << "x end > width" << llendl;
x_end = mWidth;
}
if (y_end > mWidth)
{
llwarns << "y end > width" << llendl;
y_end = mWidth;
}
///////////////////////////////////////////
//
// Generate target texture information, stride ratios.
//
//
LLViewerImage *texturep;
U32 tex_width, tex_height, tex_comps;
U32 tex_stride;
F32 tex_x_scalef, tex_y_scalef;
S32 tex_x_begin, tex_y_begin, tex_x_end, tex_y_end;
F32 tex_x_ratiof, tex_y_ratiof;
texturep = mSurfacep->getSTexture();
tex_width = texturep->getWidth();
tex_height = texturep->getHeight();
tex_comps = texturep->getComponents();
tex_stride = tex_width * tex_comps;
S32 st_comps = 3;
S32 st_width = BASE_SIZE;
S32 st_height = BASE_SIZE;
if (tex_comps != st_comps)
{
//.........这里部分代码省略.........
示例4: draw
void LLOverlayBar::draw()
{
// retrieve rounded rect image
LLUUID image_id;
image_id.set(gViewerArt.getString("rounded_square.tga"));
LLViewerImage* imagep = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE);
if (imagep)
{
LLGLSTexture texture_enabled;
LLViewerImage::bindTexture(imagep);
const S32 PAD = gSavedSettings.getS32("StatusBarPad");
// draw rounded rect tabs behind all children
LLRect r;
// focus highlights
LLColor4 color = gColors.getColor("FloaterFocusBorderColor");
glColor4fv(color.mV);
if(gFocusMgr.childHasKeyboardFocus(gBottomPanel))
{
for (child_list_const_iter_t child_iter = getChildList()->begin();
child_iter != getChildList()->end(); ++child_iter)
{
LLView *view = *child_iter;
if(view->getEnabled() && view->getVisible())
{
r = view->getRect();
gl_segmented_rect_2d_tex(r.mLeft - PAD/3 - 1,
r.mTop + 3,
r.mRight + PAD/3 + 1,
r.mBottom,
imagep->getWidth(),
imagep->getHeight(),
16,
ROUNDED_RECT_TOP);
}
}
}
// main tabs
for (child_list_const_iter_t child_iter = getChildList()->begin();
child_iter != getChildList()->end(); ++child_iter)
{
LLView *view = *child_iter;
if(view->getEnabled() && view->getVisible())
{
r = view->getRect();
// draw a nice little pseudo-3D outline
color = gColors.getColor("DefaultShadowDark");
glColor4fv(color.mV);
gl_segmented_rect_2d_tex(r.mLeft - PAD/3 + 1, r.mTop + 2, r.mRight + PAD/3, r.mBottom,
imagep->getWidth(), imagep->getHeight(), 16, ROUNDED_RECT_TOP);
color = gColors.getColor("DefaultHighlightLight");
glColor4fv(color.mV);
gl_segmented_rect_2d_tex(r.mLeft - PAD/3, r.mTop + 2, r.mRight + PAD/3 - 3, r.mBottom,
imagep->getWidth(), imagep->getHeight(), 16, ROUNDED_RECT_TOP);
// here's the main background. Note that it overhangs on the bottom so as to hide the
// focus highlight on the bottom panel, thus producing the illusion that the focus highlight
// continues around the tabs
color = gColors.getColor("FocusBackgroundColor");
glColor4fv(color.mV);
gl_segmented_rect_2d_tex(r.mLeft - PAD/3 + 1, r.mTop + 1, r.mRight + PAD/3 - 1, r.mBottom - 1,
imagep->getWidth(), imagep->getHeight(), 16, ROUNDED_RECT_TOP);
}
}
}
// draw children on top
LLPanel::draw();
}