Get the App
SLTechnology News&Howtos  ›  Servers  › 

AGG lesson 9 agg::rendering_buffer render Cache

Shulou Source: shulou.com Published: 2022-06-02 04:51:20 09月16日 Update

1 describes

http://www.360doc.com/content/11/1015/09/992979_156314240.shtml

http://www.cppblog.com/Shihira/archive/2012/07/24/183204.html

http://www.cnblogs.com/liyiwen/archive/2010/06/03/1751094.html

This is a piece of memory that holds the pixels of the graph, and this is a piece of graph that's going to be displayed on the interface. This memory holds the pixel colors of the graphics. The color of each dot is recorded here. This is the bridge between AGG and the monitor. Think of this memory as a two-dimensional array of space, and it maps directly to the points on the monitor. Each line of memory corresponds to the position point on the screen. We want to display the AGG graph by actually identifying this memory block and displaying it using the system API. (There is actually no conversion required, since the image storage format used by the API is compatible with Rendering Buffer, both for Windows and Linux.)

1.1 PPM Introduction

Let's start here: open up a storage area in memory and write its contents to a file in the simplest raster format, namely PPM (Portable Pixel Map) format. Although Windows does not have native support for this format, many image browsers and converters can use it, such as IrfanView (www.irfanview.com). All AGG console examples use the P6 256 format, RGB, one color per byte code. Now suppose we are going to work in the RGB-buffer memory area shown below:

2 application

It provides an interface that provides access to every line and byte of color in the render cache. As long as we know the color value of each point of the picture we display, we hardly need any other drawing lines to draw the class of graphics.

3 version update

Previously: unsigned char* p = rbuf.row(i);

Now: unsigned char* p = rbuf.row_ptr(i);

Tags: Memory format graphics color this is one line that is pixels images bytes actual actually display storage cache between code location example raster Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology Shulou Information Microsoft macOS