Java 2D Rendering Pipeline | Rendering in java | Razsoft Education
What is Rendering?
When we draw anything on screen, it involves many step by step process to calculate where and how to produce each pixel on screen, These step by step process is known as Rendering Pipeline and process is known as Rendering.
In this process we first define our basic shapes also known as primitives(such as text, image and geometric shapes). Then these primitives' as passed to a rendering engine like Graphics2D, That perform the step by step process of rendering pipeline. Then output image is given to an output device like screen, printer or an image stored in memory.
Apart from rendering engine Graphics2D also work as a surface to draw primitives on it. Each time we draw a new primitive on surface it added on the surface. Which we can draw on a output device.
Graphics2D States :- Graphics2D work as a state machine to draw the primitives. It manages an internal states for rendering. Untill we not change it will use it's default state. After we change a state then all the draw call after the state change will use new state. For example :- If we not change color of Graphics2D it will draw all primitives in black color. untill we change to new color like Red using setColor() or setPaint() method. Once we changed it will then draw all the primitives after the state change in Red color.
Graphics2D Manages seven internal states
1. Paint
2. Stroke
3. Font
4. Transformation
5. Composite rule
6. Clipping
7. Rendering Hints
Comments
Post a Comment