Пример #1
0
void
RasterBuffer::ScanHorizontalLine(unsigned ax, unsigned bx, unsigned y,
                                 short *buffer, unsigned size,
                                 bool interpolate) const
{
  assert(ax < get_width() << 8);
  assert(bx < get_width() << 8);
  assert(y < get_height() << 8);
  assert(buffer != NULL);
  assert(size > 0);

  if (size == 1) {
    *buffer = get(ax >> 8, y >> 8);
    return;
  }
Пример #2
0
short
RasterBuffer::get_interpolated(unsigned lx, unsigned ly,
                               unsigned ix, unsigned iy) const
{
  assert(defined());
  assert(lx < get_width());
  assert(ly < get_height());
  assert(ix < 0x100);
  assert(iy < 0x100);

  // perform piecewise linear interpolation
  const unsigned int dx = (lx == get_width() - 1) ? 0 : 1;
  const unsigned int dy = (ly == get_height() - 1) ? 0 : get_width();
  const short *tm = get_data_at(lx, ly);

  if (is_special(*tm) || is_special(tm[dx]) ||
      is_special(tm[dy]) || is_special(tm[dx + dy]))
    return *tm;

  unsigned kx = 0x100 - ix;
  unsigned ky = 0x100 - iy;

  return (*tm * kx * ky + tm[dx] * ix * ky + tm[dy] * kx * iy + tm[dx + dy] * ix * iy) >> 16;
}
Пример #3
0
void GrBx::Area::draw_graphs ()
{
    if (window && is_drawable ())
    {
	window->draw_rectangle (get_style ()->get_fg_gc (Gtk::STATE_NORMAL), true, 0, 0, get_width (), get_height ());

	Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context ();
	Cairo::Matrix matrix (1, 0, 0, -1, - hadjustment.get_value (), get_height () + vadjustment.get_value ());
	cr->transform (matrix);
	for (Graphs::iterator gitr = graphs.begin (); gitr != graphs.end (); ++gitr)
	    if ((*gitr)->get_visible ()) (*gitr)->draw (cr, sx, sy);

	update_pixbuf ();
    }
}
Пример #4
0
short
RasterBuffer::get_interpolated(unsigned lx, unsigned ly) const
{
  // check x in range, and decompose fraction part
  const unsigned int ix = CombinedDivAndMod(lx);
  if (lx >= get_width())
    return TERRAIN_INVALID;

  // check y in range, and decompose fraction part
  const unsigned int iy = CombinedDivAndMod(ly);
  if (ly >= get_height())
    return TERRAIN_INVALID;

  return get_interpolated(lx, ly, ix, iy);
}
Пример #5
0
int main()
{
    int l, u, n, i, k, j, m, height;
    srand(time(NULL));
    printf("\nEnter the values of l, u and n : ");
    scanf("%d %d %d", &l, &u, &n);
    struct node *tree = create_interval_tree(l,u,n);
    printf("\nEnter the number of integers i : ");
    scanf("%d", &i);
    for (k = 0; k < i; ++k)
    {
        j = rand()%(u-l+1) + l;
        insert(tree, j);
    }
    height = get_height(tree);
    printf("\nThe original tree : ");
    pretty_print(tree, height);
    printf("\n\nEnter the value of m (< %d) : ", n);
    scanf("%d", &m);
    int step = (u-l+1)/m;
    k = l;
    i=0;
    while(i < m)
    {
        if((k+step-1) <= u && (i != m-1))
            tree = merge(tree, k, (k+step-1));
        else
            tree = merge(tree, k, u);
        k += step;
        i++;
        height = get_height(tree);
        printf("\n\nThe tree after the %dth iteration : ", i);
        pretty_print(tree, height);
    }
    return 0;
}
Пример #6
0
int main(){
	NODE *node = 0;
	int i;
	int height;
	int in;
	NODE *temp = 0;

	int a[] = {6,3,1,5,7,12};
	display(root);
	for(i=0; i<6; i++){
		insert_data(a[i]);
		display(root);
	}
	insert_data(9);
	display(root);
	printf("Tree height test\n");
	getchar();

	//height = get_height(root);
	//printf("root height : %d\n", height);
	
/*	while(1){
		printf("input the node data(exit -1):");
		scanf("%d",&in));
		if(in == -1){
			printf("exit\n");
			break;
		}	
		temp->data = in;
		height = get_height(temp);
		printf("%d의 높이: %d\n", temp->data, height);
		temp = 0;
		height = 0;
	}*/
	while(1){
		printf("input the node data(exit -1) : ");
		scanf("%d", &in);
		fflush(stdin);
		if(in==-1) break;
		node = search(root, in);
		height = get_height(node);
		printf("%d의 높이는 %d\n", in, height);
		height = get_balance(node);
		printf("%d의 밸런스 값 : %d\n", in ,height);
		getchar();
	}
	return 0;	
}
Пример #7
0
/**
 * \brief Draws the tile on the specified surface.
 * \param dst_surface the destination surface
 * \param viewport coordinates of the top-left corner of dst_surface
 * relative to the map
 */
void Tile::draw(const SurfacePtr& dst_surface, const Point& viewport) {

  Rectangle dst_position(
      get_top_left_x() - viewport.x,
      get_top_left_y() - viewport.y,
      get_width(),
      get_height()
  );

  tile_pattern.fill_surface(
      dst_surface,
      dst_position,
      get_map().get_tileset(),
      viewport
  );
}
Пример #8
0
void Saliency_map::parafoveal_distribution(double fv, double paraF) {
    double parafovea_sigma = FWHM_constant * paraF;
    
    int x_mean = (int)get_width() / 2;
    int y_mean = (int)get_height() / 2;
    
    double paraF_A = M_PI * paraF * paraF;
    
    Saliency_map parafovea = Saliency_map(angular_resolution, periphery_radius);
    
    parafovea.to_gaussian(x_mean, y_mean, parafovea_sigma);
    
    linear_combination(parafovea, paraF_A);
    
    //normalize(get_max());
}
Пример #9
0
/**
 * \brief Draws the tile on the map.
 */
void DynamicTile::draw_on_map() {

  if (!is_drawn()) {
    return;
  }

  const Rectangle& camera_position = get_map().get_camera_position();
  Rectangle dst(0, 0);

  Rectangle dst_position(get_top_left_x() - camera_position.get_x(),
      get_top_left_y() - camera_position.get_y(),
      get_width(), get_height());

  tile_pattern.fill_surface(get_map().get_visible_surface(), dst_position,
      get_map().get_tileset(), camera_position);
}
Пример #10
0
void Renderer::render(Model &model, int *shadow_buffer) {
	std::vector<Vec3i> verts(model.nverts());
	for (int i=0; i<model.nverts(); i++) {
		verts[i] = vertex_shader(model, i);
	}
	clear();
	_zbuffer = std::vector<int>(get_width()*get_height(), -1);
	for (int i=0; i<model.nfaces(); i++) {
		std::vector<Vec3i> f = model.face(i);
		ScreenVertex triangle[3];
		for (int t=0; t<3; t++) {
			triangle[t] = ScreenVertex(verts[f[t].ivert], model.uv(f[t].iuv));
		}
		rasterize(triangle, model, shadow_buffer);
	}
}
Пример #11
0
			/**
			 * Returns the number of array layers (zero for non
			 * array textures).
			 * @return The number of array layers.
			 */
			inline Uint32 get_layer_count() const
			{
				if (!get_array())
				{
					return 0;
				}

				if (get_depth() == 0)
				{
					return std::max(static_cast<Uint32>(1),
						get_height());
				}

				return std::max(static_cast<Uint32>(1),
					get_depth());
			}
Пример #12
0
bool GuiVScroll::mousemove(int x, int y) {
    if (moving) {
        y -= origin_y + get_client_y() + up_button->get_height();
        int range = max_value - min_value;
        int blocksize = Size;
        int length = get_height() - up_button->get_height() - down_button->get_height() - blocksize;
        int value = 0;
        if (length) {
            value = y * range / length;
        }
        value += min_value;
        set_value(value);
    }

    return true;
}
//Test ob Punkt im Rechteck liegt (je nach positiver/negativer Höhe/Breite)
bool Rectangle::is_inside(Vec2 const& point){
	//beide positiv
	if (get_height() > 0 && get_width() > 0){
		if (point.x < get_vertex().x || point.x > (get_vertex().x + get_width())){
			return false;
		}
		if (point.y < get_vertex().y || point.y > (get_vertex().y + get_height())){
			return false;
		}
		else{
			return true;
		}
	}
	//positive Höhe & negative Breite
	if (get_height() > 0 && get_width() < 0){
		if (point.x < (get_vertex().x  + get_width()) || point.x > get_vertex().x){
			return false;
		}
		if (point.y < get_vertex().y || point.y > (get_vertex().y + get_height())){
			return false;
		}
		else{
			return true;
		}
	}
	//negative Höhe & positive Breite
	if (get_height() < 0 && get_width() > 0){
		if (point.x < get_vertex().x || point.x > (get_vertex().x + get_width())){
			return false;
		}
		if (point.y < (get_vertex().y + get_height()) || point.y > get_vertex().y){
			return false;
		}
		else{
			return true;
		}
	}
	//beide negativ
	else{
		if (point.x < (get_vertex().x + get_width()) || point.x > get_vertex().x){
			return false;
		}
		if (point.y < (get_vertex().y + get_height()) || point.y > get_vertex().y){
			return false;
		}
		else{
			return true;
		}
	}
}
Пример #14
0
int get_car_with_mouse(int x, int y, game tmpGame)
{
    int miny, minx, maxx, maxy;
    for (int i = 0; i < game_nb_pieces(tmpGame); i++) {
        cpiece tmp = game_piece(tmpGame, i);
        minx = get_x(tmp) * RATIO;
        miny = (game_height(tmpGame) - get_y(tmp) - get_height(tmp)) * RATIO;
        maxx = (get_x(tmp) + get_width(tmp)) * RATIO;
        maxy = (game_height(tmpGame) - get_y(tmp)) * RATIO;
        if (x >= minx && x <= maxx &&
                y >= miny && y <= maxy) {
            return i;
        }
    }
    return -1;
}
Пример #15
0
void
Gradient::draw(DrawingContext& context)
{
  if(gradient_direction != HORIZONTAL && gradient_direction != VERTICAL)
  {
      auto current_sector = Sector::current();
      auto camera_translation = current_sector->camera->get_translation();
      auto sector_width = current_sector->get_width();
      auto sector_height = current_sector->get_height();
      gradient_region = Rectf(-camera_translation.x, -camera_translation.y, sector_width, sector_height);
  }

  context.push_transform();
  context.set_translation(Vector(0, 0));
  context.draw_gradient(gradient_top, gradient_bottom, layer, gradient_direction, gradient_region);
  context.pop_transform();
}
Пример #16
0
void
TopCanvas::OnResize(UPixelScalar width, UPixelScalar height)
{
  if (width == get_width() && height == get_height())
    return;

#ifndef ANDROID
  SDL_Surface *s = ::SDL_SetVideoMode(width, height, 0, flags);
  if (s == NULL)
    return;
#endif

#ifdef ENABLE_OPENGL
  OpenGL::SetupViewport(width, height);
  Canvas::set(width, height);
#endif
}
Пример #17
0
    void software_sensor::on_video_frame(rs2_software_video_frame software_frame)
    {
        if (!_is_streaming) return;
        
        frame_additional_data data;
        data.timestamp = software_frame.timestamp;
        data.timestamp_domain = software_frame.domain;
        data.frame_number = software_frame.frame_number;

        data.metadata_size = 0;
        for (auto i : _metadata_map)
        {
            auto size_of_enum = sizeof(rs2_frame_metadata_value);
            auto size_of_data = sizeof(rs2_metadata_type);
            if (data.metadata_size + size_of_enum + size_of_data > 255)
            {
                continue; //stop adding metadata to frame
            }
            memcpy(data.metadata_blob.data() + data.metadata_size, &i.first, size_of_enum);
            data.metadata_size += static_cast<uint32_t>(size_of_enum);
            memcpy(data.metadata_blob.data() + data.metadata_size, &i.second, size_of_data);
            data.metadata_size += static_cast<uint32_t>(size_of_data);
        }

        rs2_extension extension = software_frame.profile->profile->get_stream_type() == RS2_STREAM_DEPTH ?
            RS2_EXTENSION_DEPTH_FRAME : RS2_EXTENSION_VIDEO_FRAME;

        auto frame = _source.alloc_frame(extension, 0, data, false);
        if (!frame)
        {
            LOG_WARNING("Dropped video frame. alloc_frame(...) returned nullptr");
            return;
        }
        auto vid_profile = dynamic_cast<video_stream_profile_interface*>(software_frame.profile->profile);
        auto vid_frame = dynamic_cast<video_frame*>(frame);
        vid_frame->assign(vid_profile->get_width(), vid_profile->get_height(), software_frame.stride, software_frame.bpp * 8);

        frame->set_stream(std::dynamic_pointer_cast<stream_profile_interface>(software_frame.profile->profile->shared_from_this()));
        frame->attach_continuation(frame_continuation{ [=]() {
            software_frame.deleter(software_frame.pixels);
        }, software_frame.pixels });

        auto sd = dynamic_cast<software_device*>(_owner);
        sd->register_extrinsic(*vid_profile, _unique_id);
        _source.invoke_callback(frame);
    }
void AbstractLayeredIndividual::mutate()
{
    m_genes.clear();
    generate_mutation_genes();
    
    glClear(GL_COLOR_BUFFER_BIT);
    draw();
    AbstractIndividual::draw();
    
    glReadPixels(0,
                 0,
                 get_width(),
                 get_height(),
                 GL_RGBA,
                 GL_UNSIGNED_BYTE,
                 m_pixels.data());
}
Пример #19
0
int Tree::get_height(const Node* node)
{
   if( !node ) return 0;

   int heightMax = 0;

   for(unsigned int i = 0; i < node->mChilds.size(); i++)
   {
      int height = get_height(node->mChilds.at(i));
      if(height > heightMax)
      {
         heightMax = height;
      }
   }

   return heightMax + 1;
}
Пример #20
0
void Button::render() const{
	if(!is_visible())
		return;

	ColorRGBAf color = get_background_color();
	float x = get_x();
	float y = get_y();
	float w = get_width();
	float h = get_height();

	UIManager::get().render_box(x, y, w, h, color);

	//Draw outline if needed
	if(m_render_border){
		render_border();
	}
}
Пример #21
0
bool ImageWidget::toUnits(double mouseX, double mouseY, int &posX, int &posY)
{
	const unsigned int
		startX = (unsigned int) round(_startHorizontal * _image->Width()),
		startY = (unsigned int) round(_startVertical * _image->Height()),
		endX = (unsigned int) round(_endHorizontal * _image->Width()),
		endY = (unsigned int) round(_endVertical * _image->Height());
	const unsigned
		width = endX - startX,
		height = endY - startY;
	posX = (int) round((mouseX - _leftBorderSize) * width / (get_width() - _rightBorderSize - _leftBorderSize) - 0.5);
	posY = (int) round((mouseY - _topBorderSize) * height / (get_height() - _bottomBorderSize - _topBorderSize) - 0.5);
	bool inDomain = posX >= 0 && posY >= 0 && posX < (int) width && posY < (int) height;
	posX += startX;
	posY = endY - posY - 1;
	return inDomain;
}
Пример #22
0
/** \brief Signal handler.
    \param cr is a pointer to the cairo context
    \return always true

    Draws population development (of preys and predators) in the cairo
    context object.
 */
bool
Graph::on_draw (const Cairo::RefPtr<Cairo::Context> &cr) {
    int w = get_width();
    int h = get_height();

    if (_is_enabled) {
        cr->save();

        cr->rectangle(0, 0, w, h);
        cr->set_source_rgb(1, 1, 1);
        cr->fill();

        Bounded<TValues::size_type> startb(0, 0, _values[PREY].size());
        Bounded<TValues::size_type> stopb(0, 0, _values[PREY].size());
        TValues::size_type start = 0;
        TValues::size_type stop = 0;

        if (_cont_zoom) {
            stop = _values[PREY].size();
            start = 0;
        }
        else {
            if (_cont_pos) {
                stopb = _values[PREY].size();
                start = (stopb - _visible_range).get_value();
                stop = start + _visible_range;
            }
            else {
                start = _visible_position;
                stop = start + _visible_range;
            }
        }

        draw_line(cr, _values[PREY], _max_values[PREY], start, stop);
        cr->set_source_rgb(0, 0, 0);
        cr->stroke();

        draw_line(cr, _values[PREDATOR], _max_values[PREDATOR],  start, stop);
        cr->set_source_rgb(1, 0, 0);
        cr->stroke();

        cr->restore();
    }

    return true;
}
Пример #23
0
int tslider::on_bar(const tpoint& coordinate) const
{
	// Not on the widget, leave.
	if(static_cast<size_t>(coordinate.x) > get_width()
			|| static_cast<size_t>(coordinate.y) > get_height()) {
		return 0;
	}

	// we also assume the bar is over the entire height of the widget.
	if(static_cast<size_t>(coordinate.x) < get_positioner_offset()) {
		return -1;
	} else if(static_cast<size_t>(coordinate.x) >get_positioner_offset() + get_positioner_length()) {
		return 1;
	} else {
		return 0;
	}
}
Пример #24
0
void Rectangle::shrink( float mFraction )
{
	float w = get_width();
	float h = get_height();
	
	float nw = (1-mFraction) * w;		// shrink by 0.1 (10%) 
	float nh = (1-mFraction) * h;

	left += mFraction/2. * w;			// shift by half the shrinkage.
	bottom	+= mFraction/2. * h;
		
	coords[TOP]   = bottom + nh;
	coords[RIGHT] = left   + nw;

	coords[LEFT]	= left;
	coords[BOTTOM]	= bottom;
}
Пример #25
0
void GuiVScroll::calc_blockpos() {
    int y = get_client_y();
    int block_size = Size;
    int ubh = up_button->get_height() - 1;
    int dbh = down_button->get_height() - 1;
    int height = get_height() - ubh - dbh - block_size;
    int range = max_value - min_value;
    draw_block = (range > 0);
    if (range == 0) {
        range = 1;
    }
    int value = current_value - min_value;

    int block_y = (range ? height * value / range : 0);

    blockpos = y + ubh + block_y;
}
Пример #26
0
Node* avl_insert(int k, Node* tree){
	/* Lisää uuden solmun puuhun. */
	if (tree == NULL){
		tree = memory_allocate(tree);
		tree->key = k;
		tree->ptrLeft = NULL;
		tree->ptrRight = NULL;
	}
	/* Vasempaan haaraan lisääminen. */
	else if (tree->key > k){
		if (tree->ptrLeft == NULL)
			printf("Arvo %d asetetaan solmun %d vasemmanpuoleiseksi lapseksi.\n", k, tree->key);
		tree->ptrLeft = avl_insert(k, tree->ptrLeft);
		/* tasapainottaminen: */
		if(get_height(tree->ptrLeft) == get_height(tree->ptrRight)+ 2){
			if(k < tree->ptrLeft->key){
				tree = right_rotate(tree);
				printf("R-rotaatio\n");
			}
			else{
				tree->ptrLeft = left_rotate(tree->ptrLeft);
				tree = right_rotate(tree);
				printf("LR-rotaatio\n");
			}
		}
	}
	/* Oikeaan haaraan lisääminen */
	else if (tree->key < k){
		if (tree->ptrRight == NULL)
			printf("Arvo %d asetetaan solmun %d oikeanpuoleiseksi lapseksi.\n", k, tree->key);
		tree->ptrRight = avl_insert(k, tree->ptrRight);
		/* tasapainottaminen: */
		if (get_height(tree->ptrRight) == get_height(tree->ptrLeft) + 2){
			/* R-rotaatio */
			if (k > tree->ptrRight->key){
				tree = left_rotate(tree);
				printf("L-rotaatio\n");
			}
			else{
				/* RL-rotaatio */
				tree->ptrRight =  right_rotate(tree->ptrRight);
				tree = left_rotate(tree);
				printf("RL-rotaatio\n");
			}
		}
	}
	else{
		printf("Arvo on jo aikaisemmin lisätty puuhun!\n");
	}
	/* Korjataan solmum korkeus. */
	tree->height = max(get_height(tree->ptrLeft), get_height(tree->ptrRight)) + 1;
	return (tree);
}
bool TransparentSlider::on_draw(const Cairo::RefPtr<Cairo::Context>& cr)
{
    auto window = get_window();

    Cairo::RectangleInt window_size;
    Cairo::RectangleInt clip;
    double x1, y1, x2, y2;
    cr->get_clip_extents(x1, y1, x2, y2);

    clip.height = _round(y2-y1);
    clip.width = _round(x2-x1);
    clip.x = _round(x1);
    clip.y = _round(y1);

    window_size.x = 0;
    window_size.y = 0;
    window_size.height = window->get_height();
    window_size.width = window->get_width();

    cr->save();

    if (_SUPPORTS_ALPHA) {
        cr->set_source_rgba(                    // transparent
                _adjustmentRed->get_value(),
                _adjustmentGreen->get_value(),
                _adjustmentBlue->get_value(),
                _adjustmentAlpha->get_value());
    } else {
        cr->set_source_rgb(                     // opaque
                _adjustmentRed->get_value(),
                _adjustmentGreen->get_value(),
                _adjustmentBlue->get_value());
    }
    cr->set_operator(Cairo::OPERATOR_SOURCE);

    if (clip.height==window_size.height && clip.width==window_size.width && clip.x==window_size.x && clip.y==window_size.y) {
    } else {
        window->invalidate(true);
    }
    cr->reset_clip();
    cr->paint();
    cr->restore();

    return Gtk::Window::on_draw(cr);
}
Пример #28
0
                void convert(rs2::frameset& frameset) override
                {
                    start_worker(
                        [this, &frameset] {
                            for (size_t i = 0; i < frameset.size(); i++) {
                                auto frame = frameset[i].as<rs2::depth_frame>();

                                if (frame && (_streamType == rs2_stream::RS2_STREAM_ANY || frame.get_profile().stream_type() == _streamType)) {
                                    if (frames_map_get_and_set(frame.get_profile().stream_type(), frame.get_frame_number())) {
                                        continue;
                                    }

                                    std::stringstream filename;
                                    filename << _filePath
                                        << "_" << frame.get_profile().stream_name()
                                        << "_" << frame.get_frame_number()
                                        << ".csv";

                                    std::string filenameS = filename.str();

                                    add_sub_worker(
                                        [filenameS, frame] {
                                            std::ofstream fs(filenameS, std::ios::trunc);

                                            if (fs) {
                                                for (int y = 0; y < frame.get_height(); y++) {
                                                    auto delim = "";

                                                    for (int x = 0; x < frame.get_width(); x++) {
                                                        fs << delim << frame.get_distance(x, y);
                                                        delim = ",";
                                                    }

                                                    fs << '\n';
                                                }

                                                fs.flush();
                                            }
                                        });
                                }
                            }

                            wait_sub_workers();
                        });
                }
Пример #29
0
// save the configuration file
void AppWindow::save_config(void)
	{
	#ifdef DEBUG
	std::cout << GT( "SAVE_CONFIG: Saving config file to $HOME/.gimmagerc\n" );
	#endif
	
	FILE * config;

	Glib::ustring home;
	Glib::ustring configfile;

	if( (home = Glib::get_home_dir() ) == "" )
		std::cerr << GT( "SAVE_CONFIG: Failed to find home directory" ) << std::endl;
	else
		configfile = home + (Glib::ustring) "/.gimmagerc";
	
	if( (config = fopen(configfile.c_str(),"w")) == NULL )
		{
		std::cerr << GT( "SAVE_CONFIG: Failed to write config file." ) << std::endl;
		}
	else
		{
		// alow the filechooser to hide before saving the sizes
		FileChooser.hide();
		while(Gtk::Main::events_pending()) Gtk::Main::iteration();
		
		w_width = get_width();
		w_height = get_height();
		v_width = (int)h_scroller->get_page_size();
		v_height = (int)v_scroller->get_page_size();

		if( v_height == 0 )
			v_height = 420;
		if( v_width == 0 )
			v_width = 420;
		if( w_height == 0 )
			w_height = 480;
		if( w_width == 0)
			w_width = 640;
		
		fprintf(config,"w_width=%d\nw_height=%d\nv_width=%d\nv_height=%d\n",
						w_width, w_height, v_width, v_height);
		fclose(config);
		}
	}
Пример #30
0
void GuiTab::paint() {
    int x = get_client_x();
    int y = get_client_y() + tab_button_height - 1;
    int width = get_width();
    int height = get_height() - tab_button_height;
    Subsystem& s = gui.get_subsystem();

    /* set alpha */
    float alpha = gui.get_alpha(this);

    /* draw window */
    s.set_color(0.5f, 0.5f, 1.0f, alpha);
    s.draw_box(x, y, width, height);

    s.set_color(0.0f, 0.0f, 0.35f, alpha);
    s.draw_box(x + 1, y + 1, width - 2, height - 2);
    s.reset_color();
}