swtch: rsc.io/swtch/qrweb Index | Files | Directories

package web

import "rsc.io/swtch/qrweb"

Index

Package Files

pic.go play.go

func Arrow Uses

func Arrow(w http.ResponseWriter, req *http.Request)

Arrow handles a request for an arrow pointing in a given direction.

func BitsTable Uses

func BitsTable(w http.ResponseWriter, req *http.Request)

func Draw Uses

func Draw(w http.ResponseWriter, req *http.Request)

Draw is the handler for drawing a QR code.

func Encode Uses

func Encode(w http.ResponseWriter, req *http.Request)

Encode encodes a string using the given version, level, and mask.

func Frame Uses

func Frame(w http.ResponseWriter, req *http.Request)

Frame handles a request for a single QR frame.

func Frames Uses

func Frames(w http.ResponseWriter, req *http.Request)

Frames handles a request for multiple QR frames.

func Mask Uses

func Mask(w http.ResponseWriter, req *http.Request)

Mask handles a request for a single QR mask.

func Masks Uses

func Masks(w http.ResponseWriter, req *http.Request)

Masks handles a request for multiple QR masks.

func Show Uses

func Show(w http.ResponseWriter, req *http.Request)

Show is the handler for showing a stored QR code.

type BitBlock Uses

type BitBlock struct {
    DataBytes  int
    CheckBytes int
    B          []byte
    M          [][]byte
    Tmp        []byte
    RS         *gf256.RSEncoder
    // contains filtered or unexported fields
}

type Image Uses

type Image struct {
    Name     string
    Target   [][]int
    Dx       int
    Dy       int
    URL      string
    Tag      string
    Version  int
    Mask     int
    Scale    int
    Rotation int
    Size     int

    // RandControl says to pick the pixels randomly.
    RandControl bool
    Seed        int64

    // Dither says to dither instead of using threshold pixel layout.
    Dither bool

    // OnlyDataBits says to use only data bits, not check bits.
    OnlyDataBits bool

    // Code is the final QR code.
    Code *qr.Code

    // Control is a PNG showing the pixels that we controlled.
    // Pixels we don't control are grayed out.
    SaveControl bool
    Control     []byte
}

func (*Image) Encode Uses

func (m *Image) Encode(req *http.Request) error
func (m *Image) Link() string

func (*Image) Small Uses

func (m *Image) Small() bool

type Pixinfo Uses

type Pixinfo struct {
    X        int
    Y        int
    Pix      coding.Pixel
    Targ     byte
    DTarg    int
    Contrast int
    HardZero bool
    Block    *BitBlock
    Bit      uint
}

type Pixorder Uses

type Pixorder struct {
    Off      int
    Priority int
}

Directories

PathSynopsis
resize

Package web imports 27 packages (graph) and is imported by 1 packages. Updated 2018-02-22. Refresh now. Tools for package owners.