CN108074272A - A kind of method of simulation figure mixed processing - Google Patents
A kind of method of simulation figure mixed processing Download PDFInfo
- Publication number
- CN108074272A CN108074272A CN201711391581.6A CN201711391581A CN108074272A CN 108074272 A CN108074272 A CN 108074272A CN 201711391581 A CN201711391581 A CN 201711391581A CN 108074272 A CN108074272 A CN 108074272A
- Authority
- CN
- China
- Prior art keywords
- alpha
- pixel
- transparent
- mixed
- mixed processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2203/00—Indexing scheme relating to G06F3/00 - G06F3/048
- G06F2203/048—Indexing scheme relating to G06F3/048
- G06F2203/04804—Transparency, e.g. transparent or translucent windows
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2210/00—Indexing scheme for image generation or computer graphics
- G06T2210/62—Semi-transparency
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Image Generation (AREA)
Abstract
The present invention relates to figure mixed processing technical fields, it is proposed that a kind of method of the analog simulation of figure mixed processing.In chip FPGA Qualify Phases, the effect of PC environmental simulation figure mixed processings is generally required.Traditional method be there are transparent figure layer api interface using limitation, cause when Alpha components reach transparent condition, black and white can't transparence display, can not meet Alpha mixing transparent emulation effect.The present invention provides new emulation mode for hardware design using the different transparent effects of the graphical simulation hardware chart interlayer Alpha mixing using two 32Bit forms Buffers.The method according to the invention breaks through the use limitation of Alpha mixed processings between PC environment api interface figure layers, improves simulated environment and emulation and the adjustment method agreeing with degree, a kind of new figure layer mixed processing is provided for engineering staff of actual hardware behavior.
Description
Technical field
The present invention relates to figure mixed processing technical fields, the more particularly to analog simulation of figure mixed processing.
Background technology
In general GUI window system, processing typically is overlapped by several figure layers, passes through different pixel elements
It calculates and generates different combined effects, the application especially mixed with Porter-Duff Alpha is relatively broad.Porter and Duff
It is two names, the two people have write a paper in 1984, discussed the RGBA for how realizing different digital image together
How to be mixed between four component pixels, it is proposed that the pattern of a variety of pixel mixing.
Fig. 1 has chosen the mode paradigm of part Porter-Duff pixels mixing, they are according to Porter-Duff formula pair
Tetra- components of pixel RGBA do computing, draw final mixed pixel value, calculation formula is:, it is thereinWithRepresent the RGB color component of source and target pixel;WithRepresent the Alpha components of source and target pixel;Represent that, by mode mixture treated Alpha values, formula is defined as:,
It is thereinWithConstant is expressed as in mixed mode, according to different mixed modes, directly by 103 institute of region of Fig. 1
The corresponding variable of constant value replacement formula of representative;The region 101 of operation mode type such as Fig. 1, including clear, src,
Dst, src over dst etc. have chosen 7 in Porter-Duff formula kinds of operation modes and do representative explanation here;Operate mould
The region 102 of formula effect diagram such as Fig. 1.
For embedded system, before chip FPGA Qualify Phases, the mixing of hardware chart layer can be first simulated on PC
Behavior, verify target effect in advance, then in chip FPGA Qualify Phases, it is possible to compare real hardware and PC emulation
Difference on effect, can quickly be positioned and debugging problem based on PC simulated environment, improve the efficiency of chip FPGA verifications.
Since api interface of the PC environment there are transparent figure layer uses limitation, cause to reach transparent condition in Alpha components
When, black and white can't transparence display so that be unsatisfactory for Alpha mixing transparent emulation effect.
The content of the invention
In order to solve the problems, such as the figure hybrid simulation verification the verifying results of PC environment, two are utilized the present invention provides a kind of
The different transparent effects of the graphical simulation hardware chart interlayer Alpha mixing of 32Bit forms Buffers, provide newly for hardware design
Emulation mode, improve debugging efficiency.
The technical solution adopted by the present invention to solve the technical problems is:Such as the flow chart of Fig. 2, one is created first
32Bit BMP formatted files, for Alpha mix after result preservation browsing, then initialize respectively an equal amount of source and
The Buffers colouring informations of object pixel including the graphic color information on background colour and its background colour, simulate two figure layers
Between Alpha mixed processings.According to the Porter-Duff patterns of user setting, difference computing source and target image pixel RGBA
The mixed data of Alpha of four components, key judgement are that the Alpha components of source and target pixel are public through Porter-Duff
Alpha values after formula computing, if the Alpha values of the pixel meet transparent condition, then it represents that be transparent after the mixing of this pixel
Sightless, from effect requirements, this pixel need to be updated to the initial background color of Buffers, the BMP pictures of corresponding output
Pixel be then shown as the initial background color of Buffers;Otherwise the pixel is shown as to mix by source and target image Alpha
Pixel true colors data that treated.
The beneficial effects of the invention are as follows:The use limitation of Alpha mixed processings, carries between breakthrough PC environment api interface figure layers
High simulated environment and actual hardware behavior agree with degree, for engineering staff provide a kind of new figure layer mixed processing emulation and
Adjustment method.
Description of the drawings
The present invention is further described with reference to the accompanying drawings and examples.
Fig. 1 is the schematic diagram of Porter-Duff formula manipulation patterns.
Fig. 2 is a kind of flow chart of analogous diagram interlayer Alpha mixed processings.
Fig. 3 is a kind of structure chart for describing source and target Buffers information.
Fig. 4 is a kind of exploded view for describing tetra- component A lpha mixing of source and target pixel RGBA.
Specific embodiment
First in one 32Bit BMP file of PC creating environments, and the header information of BMP forms is initialized, in order to PC
System can be identified correctly;
202, an equal amount of source and target image Buffers is created, and color and Alpha components are initialized, including background colour
And its draw above shape information;
203, judge the Porter-Duff Alpha mixed modes that active user is set;
204, it represents that the pattern that active user is set is effective, and Alpha hybrid operations is done to source and target pixel;
205, judge the Alpha values obtained after the Alpha component Porter-Duff Alpha mixing of source and target pixel;
206, pixel transparent processing when the mixed Alpha component values of pixel are 0;
207, the mixed image data updates of Porter-Duff Alpha to BMP files, and show result.
According to an embodiment of the invention, step 203 includes:If pattern input by user not emulation setting scope when,
Then terminate simulated program, otherwise, continued to execute by flow.
According to an embodiment of the invention, step 204 includes:According to the pattern of user setting and Porter-Duff formula, meter
Calculate the mixed data of Alpha of source and target image all pixels tetra- components of RGBA, including red, blueness, green and
Alpha。
According to an embodiment of the invention, step 205 includes:Judge that source and target image all pixels Alpha components mix
Value after computing, if reaching transparent condition, pixel if, performs the flow of transparent processing;If transparent condition is not achieved,
The pixel then performs color and Alpha data after update Alpha hybrid operations.
According to an embodiment of the invention, step 206 includes:Transparent processing is done to the pixel that Alpha components are 0, from effect
It is required that setting out, which is updated to the initial background color of Buffers, the Alpha mixed effects between analog hardware figure layer.
According to an embodiment of the invention, step 207 includes:Source and target image all pixels point Alpha mixed processings are complete
Bi Hou is then written to the mixing resultant data of final Buffer all pixels the BMP files for starting to create, convenient for checking
The mixed simulated effects of Alpha, compare with actual hardware effect.
Fig. 3 describes the example of the initial background color of source and target Buffers, graphical information and Alpha mixing;
301, represent a figure inside Src Buffer, the Alpha components of pixel are defaulted as 255, may be modified such that other have
Data are imitated, RGB color component, which can customize, sets other virtual values;
302, represent the initial background color of Src Buffer, the Alpha components of pixel are 0, that is, Transparent color;
303, represent a figure inside Dst Buffer, the Alpha components of pixel are defaulted as 255, may be modified such that other have
Data are imitated, RGB color component, which can customize, sets other virtual values;
304, represent the initial background color of Dst Buffer, the Alpha components of pixel are 0, that is, Transparent color;
305, it represents to illustrate by example of Src over Dst patterns, after Alpha mixing, Alpha components are not mixed for 0 region
Close newly-generated pixel graphics information;
306, after representing Alpha mixing, the region that Alpha components are 0 is initial background color, that is, transparent.
Fig. 4 describes the exploded view of tetra- component A lpha mixing of source and target pixel RGBA;
401, it represents that a Src Pixel is decomposed into tetra- components of RGBA, Alpha is carried out with four components of Dst Pixel
Mixing;
402, it represents that a Dst Pixel is decomposed into tetra- components of RGBA, Alpha is carried out with four components of Src Pixel
Mixing;
403, after representing that a Dst Pixel is mixed with four RGBA components progress Alpha of a Src Pixel, gained
Alpha components are 0, the pixel then transparent processing, are arranged to the initial background color of Buffer;
404, after representing that a Dst Pixel is mixed with four RGBA components progress Alpha of a Src Pixel, gained
Alpha components are non-zero, which is then arranged to the mixed newly-generated pixel image informations of Alpha.
Claims (5)
- A kind of 1. method of simulation figure mixed processing, which is characterized in that imitated using the image of two 32Bit forms Buffers The different transparent effects of true hardware chart interlayer Alpha mixing, according to the Alpha components after source and target image pixel mixed processing Data do it is transparent with nontransparent processing.
- 2. if according to the method described in claim 1, it is characterized in that, Alpha after source and target image pixel mixed processing When the data of component reach transparent condition, then transparent processing is done for the pixel, that is, be arranged to the initial background of the Buffers Color.
- 3. if according to the method described in claim 1, it is characterized in that, Alpha after source and target image pixel mixed processing When the data of component reach nontransparent condition, then it is arranged to pixel image data newly-generated after Alpha is mixed for the pixel.
- 4. according to the method described in claim 1, it is characterized in that, if pattern input by user is not in the scope of emulation setting When, then terminate simulated program, otherwise, continued to execute by Alpha mixture lengths.
- 5. according to the method described in claim 1, it is characterized in that, the image of two 32Bit forms Buffers does not limit greatly Small, pixel color information can customize different RGBA component informations.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711391581.6A CN108074272A (en) | 2017-12-21 | 2017-12-21 | A kind of method of simulation figure mixed processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711391581.6A CN108074272A (en) | 2017-12-21 | 2017-12-21 | A kind of method of simulation figure mixed processing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108074272A true CN108074272A (en) | 2018-05-25 |
Family
ID=62158706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711391581.6A Pending CN108074272A (en) | 2017-12-21 | 2017-12-21 | A kind of method of simulation figure mixed processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108074272A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1942896A (en) * | 2004-04-16 | 2007-04-04 | 苹果电脑有限公司 | System and method for processing graphics operations with graphics processing unit |
CN103782289A (en) * | 2011-09-08 | 2014-05-07 | 兰德马克绘图国际公司 | Systems and methods for rendering 2D grid data |
CN106937132A (en) * | 2017-04-08 | 2017-07-07 | 腾讯科技(深圳)有限公司 | A kind of photograph document handling method |
-
2017
- 2017-12-21 CN CN201711391581.6A patent/CN108074272A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1942896A (en) * | 2004-04-16 | 2007-04-04 | 苹果电脑有限公司 | System and method for processing graphics operations with graphics processing unit |
CN103782289A (en) * | 2011-09-08 | 2014-05-07 | 兰德马克绘图国际公司 | Systems and methods for rendering 2D grid data |
CN106937132A (en) * | 2017-04-08 | 2017-07-07 | 腾讯科技(深圳)有限公司 | A kind of photograph document handling method |
Non-Patent Citations (3)
Title |
---|
FRANK D.LUNA,汤毅: "《DirectX 10 3D游戏编程入门(中文译本)》", 31 December 2011 * |
TOMAS PORTER,TOM DUFF: "Compositing Digital Images", 《COMPUTER GRAPHICS》 * |
燕良: "使用标准GDI实现游戏品质的动画***", 《百度文库HTTPS://WENKU.BAIDU.COM/VIEW/263FC375F46527D3240CE0D1.HTML》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021129044A1 (en) | Object rendering method and apparatus, and storage medium and electronic device | |
TWI618030B (en) | Method and system of graphics processing enhancement by tracking object and/or primitive identifiers, graphics processing unit and non-transitory computer readable medium | |
CN101536078B (en) | Improving image masks | |
US10636336B2 (en) | Mixed primary display with spatially modulated backlight | |
CN100478994C (en) | High dynamic range material color applying drawing method | |
US10291892B2 (en) | White balance method of four-color pixel system | |
TWI728986B (en) | A graphics processing system, a method of operating the graphics processing system, and a computer software code for performing the method | |
CN109118556B (en) | Method, system and storage medium for realizing animation transition effect of UI (user interface) | |
CN107657648B (en) | Real-time efficient dyeing method and system in mobile game | |
CN103686110B (en) | A kind of RGB turns method and the device of RGBW | |
US8928690B2 (en) | Methods and systems for enhanced quality anti-aliasing | |
WO2023005743A1 (en) | Image processing method and apparatus, computer device, storage medium, and computer program product | |
CN105118076A (en) | Image colorization method based on over-segmentation and local and global consistency | |
CN112862943B (en) | Virtual model rendering method and device, storage medium and electronic equipment | |
US8619077B1 (en) | Efficient execution of color space processing functions in a graphics processing unit | |
RU2422902C2 (en) | Two-dimensional/three-dimensional combined display | |
CN105303506A (en) | Data parallel processing method and system based on HTML5 | |
CN104091366A (en) | Three-dimensional intelligent digitalization generation method and system based on two-dimensional shadow information | |
US8793576B2 (en) | System and method for computing a desktop picture | |
CN104715454A (en) | Anti-aliasing graph overlapping algorithm | |
US9064336B2 (en) | Multiple texture compositing | |
CN109903347A (en) | A kind of colour-mixed method, system, computer equipment and storage medium | |
CN104282284A (en) | Liquid crystal display white balance adjusting method | |
CN108074272A (en) | A kind of method of simulation figure mixed processing | |
CN104318509A (en) | Large-scale target high-speed plotting method based on GPU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20180525 |
|
WD01 | Invention patent application deemed withdrawn after publication |