img2json

package module
v0.0.0-...-5959da7 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

README

go-img2json

Converts an image file to JSON lines(r,g,b,a)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorNew

func ColorNew(i color.Color) sql.Null[Color]

func ComposeErr

func ComposeErr[T, U, V any](
	f func(T) (U, error),
	g func(U) (V, error),
) func(T) (V, error)

Types

type Color

type Color struct {
	R uint32 `json:"r"`
	G uint32 `json:"g"`
	B uint32 `json:"b"`
	A uint32 `json:"a"`
}

func (Color) ToJson

func (c Color) ToJson() ([]byte, error)

type Image

type Image struct{ image.Image }

func ReaderToImage

func ReaderToImage(rdr io.Reader) (Image, error)

func (Image) Height

func (i Image) Height() int

func (Image) ToRows

func (i Image) ToRows() iter.Seq[Row]

func (Image) Width

func (i Image) Width() int

type Row

type Row []Color

Directories

Path Synopsis
cmd
img2json command
json

Jump to

Keyboard shortcuts

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