smile

package smile

Members list

Packages

package smile.animation
package smile.colors
package smile.modeling
package smile.pictures

Type members

Classlikes

final case class RenderSettings(drawingIsAntiAliased: Boolean = ..., normalizesStrokes: Boolean = ..., bufferScalingMethod: ScalingMethod = ..., bufferTransformMethod: TransformMethod = ..., resamplingMode: ResamplingMode = ...)

The settings an output consults when it renders a picture. They belong to the output. Construction defaults, such as where a shape is centered, are plain default arguments of the members that build pictures. There is no global configuration and no implicit instance. Every member that renders takes the settings as an ordinary parameter, defaulting to smile.RenderSettings.Default, as in this example.

The settings an output consults when it renders a picture. They belong to the output. Construction defaults, such as where a shape is centered, are plain default arguments of the members that build pictures. There is no global configuration and no implicit instance. Every member that renders takes the settings as an ordinary parameter, defaulting to smile.RenderSettings.Default, as in this example.

val bitmap = picture.toBitmap(RenderSettings(drawingIsAntiAliased = false))

Value parameters

bufferScalingMethod

The interpolation used when a buffer is scaled, and when a renderer draws a bitmap at another size than its buffer's.

bufferTransformMethod

The interpolation used when a buffer is affinely transformed.

drawingIsAntiAliased

Whether shapes and text are drawn with antialiasing.

normalizesStrokes

Whether Java2D may normalize outlines with RenderingHints.VALUE_STROKE_NORMALIZE, its own default. When false, it draws them where their geometry says, with VALUE_STROKE_PURE. Only the JVM renderer reads this setting. Without antialiasing, normalization nudges the edges of fills and strokes up to half a pixel down and to the right, so ink can leave the boundary at the bottom and right, where a bitmap sized from the boundary cuts it off, and the JVM no longer draws edges where the canvas does. A shape turned by other than a right angle is drawn about half a pixel down and right of the point it turns around (SMILe issue #21). It is here for programs that must keep the pixels of renderers that normalized, as earlier versions of SMILe did.

resamplingMode

How a bitmap is resampled when it is scaled or rotated more than once.

Attributes

Companion
object
Source
RenderSettings.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
RenderSettings.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

How a bitmap is resampled when a picture is scaled or rotated for an output.

How a bitmap is resampled when a picture is scaled or rotated for an output.

A bitmap records the operations done to it (see smile.pictures.Bitmap). The mode says what an output does with them.

Attributes

Source
RenderSettings.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum ScalingMethod(val value: Int)

How bitmaps are resampled when a bitmap's buffer is scaled (Bitmap.scaleBy, scaleTo) and when a renderer draws a bitmap at another size than its buffer's, as under a display scale factor or in an SVG that is shown enlarged. AWT, canvas and SVG's image-rendering all follow the method, and each method means the same on both platforms as far as each renderer can tell them apart:

How bitmaps are resampled when a bitmap's buffer is scaled (Bitmap.scaleBy, scaleTo) and when a renderer draws a bitmap at another size than its buffer's, as under a display scale factor or in an SVG that is shown enlarged. AWT, canvas and SVG's image-rendering all follow the method, and each method means the same on both platforms as far as each renderer can tell them apart:

  • Smooth, the default, interpolates bilinearly between the pixels, so an enlarged bitmap blends from each pixel into the next.
  • NearestNeighbor and Fast copy the nearest pixel, so an enlarged bitmap is made of blocks.
  • AreaAveraging averages the area each new pixel covers, which is the better way to make a bitmap smaller and enlarges into blocks. Only the JVM's buffer scaling has it (see java.awt.Image). On Scala.js, and where a renderer resamples as it draws, it is smooth.

The method in effect is the bufferScalingMethod of the smile.RenderSettings a renderer is given, and the default's for a bitmap's own scaling.

Attributes

Source
ScalingMethod.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum TransformMethod(val value: Int)

How bitmaps are resampled when they are affinely transformed, as Bitmap.rotateAround does. See java.awt.image.AffineTransformOp for details. The method in effect is the bufferTransformMethod of the default smile.RenderSettings.

How bitmaps are resampled when they are affinely transformed, as Bitmap.rotateAround does. See java.awt.image.AffineTransformOp for details. The method in effect is the bufferTransformMethod of the default smile.RenderSettings.

Attributes

Source
TransformMethod.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all