Skip to content

Commit

Permalink
ebiten: update comments
Browse files Browse the repository at this point in the history
Updates #2471
  • Loading branch information
hajimehoshi committed Nov 27, 2022
1 parent 9aedafb commit d407607
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ type DrawImageOptions struct {
GeoM GeoM

// ColorScale is a scale of color.
// ColorScale is slightly different from ColorM's Scale in terms of alphas:
// ColorScale is applied to premultiplied-alpha colors, while ColorM is applied to straight-alpha colors.
//
// ColorScale is slightly different from colorm.ColorM's Scale in terms of alphas.
// ColorScale is applied to premultiplied-alpha colors, while colorm.ColorM is applied to straight-alpha colors.
// Thus, colorm.ColorM.Scale(r, g, b, a) equals to ColorScale.Scale(r*a, g*a, b*a, a).
//
// The default (zero) value is identity, which is (1, 1, 1, 1).
ColorScale ColorScale

Expand Down Expand Up @@ -188,9 +191,12 @@ func (i *Image) adjustedRegion() graphicsdriver.Region {
// DrawImage works more efficiently as batches
// when the successive calls of DrawImages satisfy the below conditions:
//
// - All render targets are same (A in A.DrawImage(B, op))
// - All Blend values are same
// - All Filter values are same
// - All render targets are the same (A in A.DrawImage(B, op))
// - All Blend values are the same
// - All Filter values are the same
//
// A whole image and its sub-image are considered to be the same, but some
// environments like browsers might not work efficiently (#2471).
//
// Even when all the above conditions are satisfied, multiple draw commands can
// be used in really rare cases. Ebitengine images usually share an internal
Expand Down

0 comments on commit d407607

Please sign in to comment.