Documentation
¶
Index ¶
- Constants
- Variables
- type CharacterCard
- func (cc *CharacterCard) Encode() (*RawCard, error)
- func (p *CharacterCard) Height() int
- func (p *CharacterCard) Image() (image.Image, error)
- func (p *CharacterCard) ScaleDown(size int) error
- func (p *CharacterCard) Thumbnail(size int) (image.Image, error)
- func (cc *CharacterCard) ToRawJson() (*RawJsonCard, error)
- func (p *CharacterCard) Width() int
- type Processor
- type RawCard
- func (rc *RawCard) Decode() (*CharacterCard, error)
- func (p *RawCard) Height() int
- func (p *RawCard) Image() (image.Image, error)
- func (p *RawCard) ScaleDown(size int) error
- func (p *RawCard) Thumbnail(size int) (image.Image, error)
- func (rc *RawCard) ToBytes() ([]byte, error)
- func (rc *RawCard) ToFile(path string) error
- func (rc *RawCard) ToImage(w io.Writer) error
- func (rc *RawCard) ToRawJson() (*RawJsonCard, error)
- func (p *RawCard) Width() int
- type RawJsonCard
- func (p *RawJsonCard) Height() int
- func (p *RawJsonCard) Image() (image.Image, error)
- func (p *RawJsonCard) ScaleDown(size int) error
- func (p *RawJsonCard) Thumbnail(size int) (image.Image, error)
- func (rjc *RawJsonCard) ToCharacter() (*CharacterCard, error)
- func (rjc *RawJsonCard) ToRaw() *RawCard
- func (p *RawJsonCard) Width() int
- type ScanMode
Constants ¶
const ( Extension string = ".png" // The PNG file extension ExtensionLength int = 4 // PNG extension length )
Sizes in bytes
Variables ¶
var ( First = ScanMode{ // contains filtered or unexported fields } LastVersion = ScanMode{ // contains filtered or unexported fields } LastLongest = ScanMode{ // contains filtered or unexported fields } DefaultScanMode = First )
ScanMode values
Functions ¶
This section is empty.
Types ¶
type CharacterCard ¶
CharacterCard decoded chara PNG card
func (*CharacterCard) Encode ¶
func (cc *CharacterCard) Encode() (*RawCard, error)
Encode converts a CharacterCard to a RawCard by encoding the character data as base64
func (*CharacterCard) Height ¶
func (p *CharacterCard) Height() int
Height returns the height in pixels of the PNG
func (*CharacterCard) ToRawJson ¶
func (cc *CharacterCard) ToRawJson() (*RawJsonCard, error)
ToRawJson converts a CharacterCard to a RawJsonCard by serializing the Sheet to JSON
type Processor ¶
type Processor interface {
ScanMode(scanMode ScanMode) Processor
First() Processor
LastVersion() Processor
LastLongest() Processor
Err() error
ImageSize() (int, int)
Get() (*RawCard, error)
Close() error
}
Processor API for decoding chara PNG cards
func FromImage ¶
func FromImage(r io.ReadCloser) Processor
FromImage creates a Processor from an io.Reader containing PNG image data
type RawCard ¶
type RawCard struct {
RawCharaData []byte
Revision character.Revision
// contains filtered or unexported fields
}
RawCard encoded chara PNG card
func PlaceholderCharacterCard ¶
PlaceholderCharacterCard returns a placeholder character card of the given size (black PNG image)
func (*RawCard) Decode ¶
func (rc *RawCard) Decode() (*CharacterCard, error)
Decode converts a RawCard to a CharacterCard by decoding the base64 character data
func (*RawCard) Height ¶
func (p *RawCard) Height() int
Height returns the height in pixels of the PNG
func (*RawCard) ToRawJson ¶
func (rc *RawCard) ToRawJson() (*RawJsonCard, error)
ToRawJson converts a RawCard to a RawJsonCard by decoding the base64 data
type RawJsonCard ¶
type RawJsonCard struct {
RawJsonData []byte
Revision character.Revision
// contains filtered or unexported fields
}
RawJsonCard encoded chara PNG card with JSON data
func (*RawJsonCard) Height ¶
func (p *RawJsonCard) Height() int
Height returns the height in pixels of the PNG
func (*RawJsonCard) ToCharacter ¶
func (rjc *RawJsonCard) ToCharacter() (*CharacterCard, error)
ToCharacter converts a RawJsonCard to a CharacterCard by parsing the JSON data
func (*RawJsonCard) ToRaw ¶
func (rjc *RawJsonCard) ToRaw() *RawCard
ToRaw converts a RawJsonCard to a RawCard by encoding the JSON data as base64