Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Mar 10, 2025
1 parent 9d85c7c commit a6ddd71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 1 addition & 5 deletions examples/mosaic/simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ func main() {

func loadImage(path string) (image.Image, error) {
f, err := os.Open(path)
defer func() {
if err := f.Close(); err != nil {
fmt.Println("Error closing file:", err)
}
}()
defer f.Close() //nolint:errcheck
if err != nil {
return nil, err
}
Expand Down
12 changes: 10 additions & 2 deletions mosaic/mosaic.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ func Render(img image.Image, width int, height int) string {
return m.Render(img)
}

// Mosaic is a renderer and its options.
// Mosaic represents a Unicode image renderer.
//
// Example:
//
// ```go
// art := mosaic.New().Width(100). // Limit to 100 cells
// Scale(mosaic.Fit). // Fit to width
// Render()
// ```
type Mosaic struct {
outputWidth int // Output width.
outputHeight int // Output height (0 for auto).
Expand Down Expand Up @@ -136,7 +144,7 @@ func (m Mosaic) Dither(dither bool) Mosaic {
return m
}

// Set ThresholdLevel on [Mosaic].
// Threshold sets the threshold level on [Mosaic].
func (m Mosaic) Threshold(threshold uint8) Mosaic {
m.thresholdLevel = threshold
return m
Expand Down

0 comments on commit a6ddd71

Please sign in to comment.