ppm

package module
v0.0.0-...-4d5ea24 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: MIT Imports: 12 Imported by: 0

README

go-ppm

A Go library to parse Flipnote Studio animation files

Note: This library is not yet complete. Documentation will not exist until the library is stable and intended features are present and working.


Dependencies

| adpcm |

License

The source code for go-ppm is released under the MIT License. See LICENSE for more details.

Donations

All donations are appreciated and helps me stay awake at night to work on this more. Even if it's not much, it helps a lot in the long run! You can find the donation link here: Donation Link

Documentation

Overview

-- References for writing this library The original documentation that started it all: https://github.com/pbsds/hatena-server/wiki/PPM-format Used for testing to parse the first frame's first layer with a white paper and a black pen: https://gist.github.com/jaames/aa77713839c1dc948eefd445442bf606 Python parser to help shape the code: https://github.com/jaames/flipnote-tools/blob/master/scripts/dsi/ppmTools/ppmTools/ppmParser.py#L190 JavaScript parser to help shape the code: https://github.com/jaames/flipnote.js/blob/master/src/decoder/index.js#L304

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = false
)

Functions

This section is empty.

Types

type Frame

type Frame struct {
	FrameImage image.Image
}

type FrameData

type FrameData struct {
	FrameCount         int
	FrameOffsets       []uint32
	Frames             []Frame
	PreviewFrameBitmap []byte
	PreviewFrameImage  image.Image
	PreviewFrame       int
	Size               int
}

type Offset

type Offset struct {
	Offset uint32
	Length int
}

type OpenConfig

type OpenConfig struct {
	SkipAnimationSize                bool
	SkipAuthorName                   bool
	SkipAudioData                    bool
	SkipAudioSize                    bool
	SkipDate                         bool
	SkipFileName                     bool
	SkipFileNameCheck                bool
	SkipFrameCount                   bool
	SkipFrameData                    bool
	SkipFrames                       bool
	SkipLastEditedAuthorID           bool
	SkipLastEditedAuthorIDCheck      bool
	SkipLastEditedAuthorName         bool
	SkipLockStatus                   bool
	SkipMagicCheck                   bool
	SkipOriginalAuthorID             bool
	SkipOriginalAuthorIDCheck        bool
	SkipOriginalAuthorName           bool
	SkipOriginalFileName             bool
	SkipOriginalFileNameCheck        bool
	SkipPartialFileName              bool
	SkipPreviewFrameN                bool
	SkipPreviousEditingAuthorID      bool
	SkipPreviousEditingAuthorIDCheck bool
	SkipThumbnail                    bool
}

type PPM

type PPM struct {
	AuthorName              string
	Date                    int64
	FileName                string
	FrameData               FrameData
	LastEditedAuthorID      string
	LastEditedAuthorName    string
	Locked                  bool
	OriginalAuthorID        string
	OriginalAuthorName      string
	OriginalFileName        string
	PartialFileName         string
	PreviousEditingAuthorID string
	SoundData               SoundData

	// Extra things
	Success          bool
	FileLocation     string
	OpenConfig       *OpenConfig
	ThumbnailPalette []color.RGBA
}

func (*PPM) Open

func (ppmData *PPM) Open() error

type SoundData

type SoundData struct {
	SoundMeta    SoundMeta
	BGM          []int // PCM audio
	SoundEffect1 []int // PCM audio
	SoundEffect2 []int // PCM audio
	SoundEffect3 []int // PCM audio
	Size         int
}

type SoundMeta

type SoundMeta struct {
	BGM          Offset
	SoundEffect1 Offset
	SoundEffect2 Offset
	SoundEffect3 Offset
	FrameSpeed   int
	BGMSpeed     int
}

Jump to

Keyboard shortcuts

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