projectionx

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package projectionx 投影: 按水平或垂直方向统计色素有效性

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Project2D

func Project2D(src image.Image, validFunc ValidFunc) (v *Result, h *Result)

Project2D 二维投影

Types

type ProjectDirection

type ProjectDirection int32

ProjectDirection 投影模式

const (
	// ModeNone 无效
	ModeNone ProjectDirection = iota
	// ModeVertical 垂直模式
	ModeVertical
	// ModeHorizontal 水平模式
	ModeHorizontal
)

type Result

type Result struct {
	// 数据
	Data []uint32
	// 投影模式
	Mode ProjectDirection
}

Result 投影结果

func Project

func Project(src image.Image, validFunc ValidFunc, direction ProjectDirection) *Result

Project 投影

func ProjectHorizontal

func ProjectHorizontal(src image.Image, validFunc ValidFunc) *Result

ProjectHorizontal 水平投影

func ProjectVertical

func ProjectVertical(src image.Image, validFunc ValidFunc) *Result

ProjectVertical 垂直投影

func (*Result) Length

func (r *Result) Length() int

func (*Result) MaxData

func (r *Result) MaxData() uint32

type ValidFunc

type ValidFunc func(color color.Color) bool

ValidFunc 投影有效性函数

Jump to

Keyboard shortcuts

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