当前位置: 首页>>代码示例>>C++>>正文


C++ image::clear方法代码示例

本文整理汇总了C++中image::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ image::clear方法的具体用法?C++ image::clear怎么用?C++ image::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在image的用法示例。


在下文中一共展示了image::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: on_draw

            virtual BOOL on_draw(HELEMENT he, UINT draw_type, HDC hdc, const
                RECT &rc)
            {
                if ((DRAW_EVENTS)draw_type != where)
                    return FALSE;
                // do default draw
                int w = rc.right - rc.left;
                int h = rc.bottom - rc.top;
                if (!surface)
                {
                    surface = image::create(w, h);
                    redraw = true;
                }
                else if (w != surface->width() || h != surface->height())
                {
                    delete surface;
                    surface = image::create(w, h);
                    redraw = true;
                }
                else if (redraw)
                    surface->clear();

                if (redraw)
                {
                    graphics gx(surface);
                    draw(he, gx, w, h);
                    redraw = false;
                }
                surface->blit(hdc, rc.left, rc.top);

                return default_draw ? TRUE : FALSE;
            }
开发者ID:JourneyRoad,项目名称:VC_sln,代码行数:32,代码来源:htmlayout_canvas.hpp

示例2: decompress

static std::vector<double> decompress(image in){
	auto width = in.header.width;
	auto height = in.header.height;
	assert(is_pow_of_two(width));
	assert(is_pow_of_two(height));

	auto q = in.header.get_quantization(quantization::type::logarithmic);

	std::vector<double> image(width * height, 0.0);

	// read in coefficient on coordinates
	for(auto it = in.data.begin(); it != in.data.end(); ++it){
		auto&& x = *it;
		image[x.x + width*x.y] = q.backwards(x.c);
	}

	in.clear();

	// inverse wavelet transform in y-direction
	for(unsigned int i = 0; i < width; ++i){
		unwavelet(&image[i], height, width);
	}

	// inverse wavelet transform in x-direction
	for(unsigned int i = 0; i < height; ++i){
		unwavelet(&image[i*width], width, 1);
	}

	return image;
}
开发者ID:Jaxan,项目名称:parallel-algorithms,代码行数:30,代码来源:jcmp.cpp


注:本文中的image::clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。