Skip to content

Commit

Permalink
chore: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrw committed Apr 22, 2023
1 parent 643dccc commit 9ac8592
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
9 changes: 1 addition & 8 deletions cmd/asciicam.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,12 @@ var asciicamCmd = &cobra.Command{
fmt.Println(err)
}

// for y := frame.Bounds().Min.Y; y < frame.Bounds().Max.Y; y++ {
// for x := frame.Bounds().Min.X; x < frame.Bounds().Max.X; x++ {
// r, g, b, _ := frame.At(x, y).RGBA()
// fmt.Println(r >> 8, g >> 8, b >> 8)
// }
// }

termWidth, termHeight := canvas.Size()
scale := math.Min(settings.FrameWidth/float64(termWidth), settings.FrameHeight/float64(termHeight))
scaledResolution := image.Point{X: int(settings.FrameWidth / scale), Y: int(settings.FrameHeight / (scale * 1.8))}

canvas.Clear()
internal.Asciify(frame, canvas, settings, termWidth, termHeight, scale, scaledResolution, defStyle)
internal.Asciify(frame, canvas, settings, termWidth, termHeight, scaledResolution, defStyle)

// Show info
if settings.ShowInfo {
Expand Down
16 changes: 1 addition & 15 deletions internal/asciify.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// var ascii_symbols = []rune(".:-~=+*#%@")
var ascii_symbols = []rune(".,;!vlLFE$")

func Asciify(frame image.Image, canvas tcell.Screen, settings *Settings, termWidth int, termHeight int, scale float64, scaledResolution image.Point, defStyle tcell.Style) {
func Asciify(frame image.Image, canvas tcell.Screen, settings *Settings, termWidth int, termHeight int, scaledResolution image.Point, defStyle tcell.Style) {
pixStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(
tcell.NewRGBColor(
settings.Colour["R"],
Expand All @@ -21,21 +21,7 @@ func Asciify(frame image.Image, canvas tcell.Screen, settings *Settings, termWid

downFrame := imaging.Resize(frame, scaledResolution.X, scaledResolution.Y, imaging.NearestNeighbor)

// canvas.Fini()
// for y := downFrame.Bounds().Min.Y; y < downFrame.Bounds().Max.Y; y++ {
// for x := downFrame.Bounds().Min.X; x < downFrame.Bounds().Max.X; x++ {
// r, g, b, _ := downFrame.At(x, y).RGBA()
// fmt.Println(r >> 8, g >> 8, b >> 8)
// }
// }

greyPixel := image.NewGray(image.Rect(0, 0, 1, 1))
// greyFrame := image.NewGray(image.Rect(0, 0, scaledResolution.X, scaledResolution.Y))
// for y := downFrame.Bounds().Min.Y; y < downFrame.Bounds().Max.Y; y++ {
// for x := downFrame.Bounds().Min.X; x < downFrame.Bounds().Max.X; x++ {
// greyFrame.Set(x, y, color.GrayModel.Convert(downFrame.At(x, y)))
// }
// }

switch settings.SingleColourMode {
case true:
Expand Down

0 comments on commit 9ac8592

Please sign in to comment.