Fixed bug where some pixels were lost on max brightness pixels
This commit is contained in:
parent
ea1979ef92
commit
1bc953f59e
|
|
@ -128,7 +128,7 @@ func ConvertToAsciiDetailed(imgSet [][]uint32) [][]string {
|
||||||
|
|
||||||
tempFloat := (value / MAX_VAL) * float32(len(asciiTableDetailed))
|
tempFloat := (value / MAX_VAL) * float32(len(asciiTableDetailed))
|
||||||
if value == MAX_VAL {
|
if value == MAX_VAL {
|
||||||
tempFloat = 68
|
tempFloat = float32(len(asciiTableDetailed) - 1)
|
||||||
}
|
}
|
||||||
tempInt := int(tempFloat)
|
tempInt := int(tempFloat)
|
||||||
|
|
||||||
|
|
@ -160,6 +160,9 @@ func ConvertToAsciiSimple(imgSet [][]uint32) [][]string {
|
||||||
|
|
||||||
value := float32(imgSet[i][j])
|
value := float32(imgSet[i][j])
|
||||||
tempFloat := (value / MAX_VAL) * float32(len(asciiTableSimple))
|
tempFloat := (value / MAX_VAL) * float32(len(asciiTableSimple))
|
||||||
|
if value == MAX_VAL {
|
||||||
|
tempFloat = float32(len(asciiTableSimple) - 1)
|
||||||
|
}
|
||||||
tempInt := int(tempFloat)
|
tempInt := int(tempFloat)
|
||||||
|
|
||||||
tempSlice = append(tempSlice, asciiTableSimple[tempInt])
|
tempSlice = append(tempSlice, asciiTableSimple[tempInt])
|
||||||
|
|
|
||||||
7
main.go
7
main.go
|
|
@ -16,13 +16,8 @@ limitations under the License.
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "ascii-image-converter/cmd"
|
||||||
"ascii-image-converter/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
// cols, rows := consolesize.GetConsoleSize()
|
|
||||||
// // fmt.Println(cols, rows)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue