本文整理汇总了C++中Pyramid::update方法的典型用法代码示例。如果您正苦于以下问题:C++ Pyramid::update方法的具体用法?C++ Pyramid::update怎么用?C++ Pyramid::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pyramid
的用法示例。
在下文中一共展示了Pyramid::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
sf::ContextSettings set;
set.antialiasingLevel = 8;
sf::Window w(sf::VideoMode(700, 700), "ogl", sf::Style::Default, set);
glewExperimental = true;
glewInit();
Context gl;
gl.ClearColor(0.0, 0.0, 0.0, 1.0);
gl.Enable(Capability::DepthTest);
gl.Enable(Capability::CullFace);
gl.Enable(Capability::Blend);
w.setMouseCursorVisible(false);
Pyramid pyramid { w };
bool running = true;
while(running) {
sf::Event e;
while(w.pollEvent(e)){
if(e.type == sf::Event::Closed){ running = false; }
if(e.type == sf::Event::KeyPressed) {
switch(e.key.code) {
case sf::Keyboard::Escape:
running = false;
break;
case sf::Keyboard::W: case sf::Keyboard::Up:
camera.forward();
break;
case sf::Keyboard::A: case sf::Keyboard::Left:
camera.left();
break;
case sf::Keyboard::S: case sf::Keyboard::Down:
camera.back();
break;
case sf::Keyboard::D: case sf::Keyboard::Right:
camera.right();
break;
default:
break;
}
}
if(e.type == sf::Event::MouseMoved) {
//idk
}
}
pyramid.update();
pyramid.draw(gl);
gl.Clear().ColorBuffer().DepthBuffer();
w.display();
}
return 0;
}
示例2: Image
/**
* @brief execute
* @param imgIn
* @param imgOut
* @return
*/
Image *execute(Image *imgIn, Image *imgOut)
{
if(imgIn == NULL) {
return NULL;
}
if(!imgIn->isValid()) {
return NULL;
}
if(imgOut == NULL) {
imgOut = new Image(1, imgIn->width, imgIn->height, imgIn->channels);
}
//compute segmentation map
seg_map = seg.Process(imgIn, seg_map);
/* 0 ---> Drago et al. 2003
1 ---> Reinhard et al. 2002
LumZone = [-2, -1, 0, 1, 2, 3, 4];
TMOForZone = [ 0, 0, 1, 0, 1, 0, 0]; */
int count[2];
count[0] = 0;
count[1] = 0;
for(int i = 0; i < seg_map->size(); i++) {
int indx = int(seg_map->data[i]);
if((indx == 2) || (indx == 4)) {
seg_map->data[i] = 1.0f;
count[1]++;
} else {
seg_map->data[i] = 0.0f;
count[0]++;
}
}
#ifdef PIC_DEBUG
seg_map->Write("weight_map.pfm");
#endif
//check if we have different zones
int value = 10;
if(count[0] > 0 && count[1] > 0) {
value = 10;
}
if(count[0] > 0 && count[1] == 0) {
value = 0;
}
if(count[0] == 0 && count[1] > 0) {
value = 1;
}
switch(value) {
case 0: {
fltDragoTMO.Process(Single(imgIn), imgOut);
}
break;
case 1: {
fltReinhardTMO.Process(Single(imgIn), imgOut);
}
break;
case 10: {
//Drago TMO
imgDrago = fltDragoTMO.Process(Single(imgIn), imgDrago);
if(pyrA == NULL) {
pyrA = new Pyramid(imgDrago, true);
} else {
pyrA->update(imgDrago);
}
//Reinhard TMO
imgReinhard = fltReinhardTMO.Process(Single(imgIn), imgReinhard);
if(pyrB == NULL) {
pyrB = new Pyramid(imgReinhard, true);
} else {
pyrB->update(imgReinhard);
}
//compute blending weight
if(pyrWeight == NULL) {
pyrWeight = new Pyramid(seg_map, false);
} else {
pyrWeight->update(seg_map);
}
//.........这里部分代码省略.........