Saleng

Submitted by: Submitted by

Views: 218

Words: 1475

Pages: 6

Category: World History

Date Submitted: 07/15/2011 06:30 AM

Report This Essay

Rendering Engines

* Purpose:

* Determine how to present graphics primitives on a visual output device

* In Java:

* The rendering engine is a Graphics2D  object

The (Linear) Color Cube

* The RGB Model:

* Begin with black then add red, green, and or blue

* An additive model

* Often used for displays/monitors

* The CMYK Model:

* Begin with white then remove cyan, magenta, and/or yellow

* A subtractive model

* Often used for printing

* Coordinates:

* Quantities (linear and/or angular) that designate the position of a point in relation to a given reference frame

* In Java:

Rendering with a Graphics 2D Object

 

* Geometric Shapes (see the Shape interface):

* draw(Shape s)

* fill(Shape s)

* Strings/Text:

* drawString(String s, float x, float y)

* Images:

* drawImage(Image i, int x, int y, null)

Classes that implement the shape Interface

* 0-Dimensional:

* Points (Point2D)

* 1-Dimensional:

* Lines (Line2D)

* Curves (CubicCurve2D  and QuadCurve2D)

* 2-Dimensional:

* Rectangles(Rectangle2D)

* Polygons (General Path)

* Ellipses (Ellipse2D)

* Stroke:

* The line "style" (see the Stroke interface)

* Set using the setStroke method in Graphics2D

* Color:

* The line color (see the Color class)

* Set using the setColor method in Graphics2D

Joins and Caps

Filling a Shape

* Paint:

* The fill "style" and color (see the Paint interface)

* Set using the setPaint method in Graphics2D

* Types:

* Color 

* GradientPaint 

* TexturePaint 

Rendering Text/Strings

* Font:

* The "glyphs" used for each character

* Set using the setFont method in Graphics2D

* Properties:

* Name

* Size (in points)...

More like this