GithubHelp home page GithubHelp logo

rle's Introduction

rle

run length encoding

count repeated pixels

compressbitmap() in lsrle.h encodes a bitmap into RLE format

uncompressbitmap() in lsrle.h decodes a compressed RLE image back into a bitmap

uncompressbitmap() currently checks to make sure the decoded result is the same as the original image

testrle.html aso decodes a compressed RLE image, in Javascript, and draws it to a HTML5 canvas

With palette mode vs without: better file size (60KB vs 100KB), similar encoding/decoding speed

By default FF00FFnn (magenta) triggers an action

For nn = FF, toggle palette mode, FF FF to add, FF FF FF to enable and add

Add to palette adds the next item index. First index is 0, last is FE

If trigger byte is AA instead of FF, first is 0, last is FF and AA will be empty

Trigger byte is the red byte of the colours being read, causes GBA bytes to be read.

RGBA will also be read if palette mode is off. Otherwise, each byte is an index unless repeat or toggle is triggered.

For nn = 1-254, this indicates a repeat. If 254 repeats, an extra byte is expected.

If byte 2 is 0x80 or above (128 or more), an extra byte is expected.

If byte 3 is 0x80 or above (128 or more), an extra byte is expected.

If byte 4 is 0x80 or above (128 or more), an error is triggered. Todo: support any length; massive canvases.

Total repeats of the last pixel to create = nn OR 254 + [[(byte4 << 14) +] (byte3 << 7) +] byte2; (without 0x80 flags)

todo: multi-byte palette indexes

todo: FF00FFFF to EE as mentioned in DETAILS.TXT

16/07/2019 tests:

local machine dummy client 1.33fps

local network web client 1.14fps

local network wireless mobile web client 0.36fps

8MB raw to approx 60KB compressed

The binary may work if you have a Broadcom GPU and Freetype2 installed

Run ./shell -testrle on the server to start the sender

Open http://./rle/testrle.html to start the receiver

(click L or double-click to enable/disable streaming mode)

rle's People

Contributors

c-20 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.