champlib

package
v0.0.0-...-90cfc5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelpDebug = "enable logging (more info)"
	HelpFile  = "[string] specify where to write log output"
)

Variables

View Source
var LoggingEnabled = false

Functions

func ChampLog

func ChampLog(v ...interface{}) bool

func DebugLineSlice

func DebugLineSlice(DebugMe []Line, PrintMe bool)

func GenerateFilename

func GenerateFilename(outDir, inputName string) (string, error)

func ImageArray

func ImageArray(im ImageInfo) [][][3]int32

Thanks to https://stackoverflow.com/questions/33186783/

func LogImgInfo

func LogImgInfo(imginf ImageInfo)

func LogIntarrayInfo

func LogIntarrayInfo(arrptr *[][][3]int32)

func TryLogOutputStr

func TryLogOutputStr(path string)

func WriteLineSliceEncoded

func WriteLineSliceEncoded(slicePtr *[]Line, fileName string) error

func WriteLineSlicePlain

func WriteLineSlicePlain(slicePtr *[]Line, fileName string) error

Types

type ImageInfo

type ImageInfo struct {
	Bounds        image.Rectangle
	Format        string
	ColorModel    color.Model
	Width, Height int
	Data          *image.Image
	Decoded       *[][][3]int32
}

func ReadImgInfo

func ReadImgInfo(imgReader *os.File) (ImageInfo, error)

type Line

type Line struct {
	// HexColor is just an array with the RGB values.
	HexColor [3]int32

	// Start and end are represented by x and y
	// Two coordinates for each. Four numbers in total.
	Start, End [2]int32

	// StartInit and EndInit reflect if `Start`
	// and `End` have been properly initialized.
	// (We can't just compare each of them to 0,0)
	StartInit, EndInit bool
}

func ImagePixLoop

func ImagePixLoop(im ImageInfo) []Line

func (Line) Eq

func (l Line) Eq(cmp Line) bool

func (Line) LineToString

func (l Line) LineToString() (string, error)

func (Line) RGBToHex

func (l Line) RGBToHex() string

func (*Line) SetEnd

func (lp *Line) SetEnd(x, y int)

func (*Line) SetStart

func (lp *Line) SetStart(x, y int)

type LineWriteType

type LineWriteType struct {
	HexColor   [3]uint8
	Start, End [2]int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL