2daec3d3c3
Some devices(1-bit / 2-bit displays) have packed bit formats that need to be unpacked in order to work on them at a pixel level. This caused a few issues on 1 & 2-bit devices: Greatly Oversized data arrays for bitmaps Improper handling of native image data Framebuffer data was near unusable without jumping through hoops Conversion between native addressing and per pixel addressing incurs extra overhead but it is much faster to do it on the 'C' side rather than in lua. Not to mention the advantage of a unified interface for the end programer ------------------------------------------------------------------- Adds a sane way to access each pixel of image data Adds: -------------------------------------------------------------------- img:clear([color],[x1],[y1],[x2],[y2]) (set whole image or a portion to a particular value) -------------------------------------------------------------------- img:invert([x1],[y1],[x2],[y2]) (inverts whole image or a portion) -------------------------------------------------------------------- img:marshal([x1],[y1],[x2],[y2],[funct]) (calls funct for each point defined by rect of x1,y1 x2,y2 returns value and allows setting value of each point return nil to terminate early) -------------------------------------------------------------------- img:points([x1],[y1],[x2],[y2],[dx],[dy]) (returns iterator function that steps delta-x and delta-y pixels each call returns value of pixel each call but doesn't allow setting to a new value compare to lua pairs method) -------------------------------------------------------------------- img:copy(src,[x1],[y1],[x2],[y2],[w],[h],[clip][operation][clr/funct]) (copies all or part of an image -- straight copy or special ops optionally calls funct for each point defined by rect of x1, y1, w, h and x2, y2, w, h for dest and src images returns value of dst and src and allows setting value of each point return nil to terminate early) -------------------------------------------------------------------- img:line(x1, y1, x2, y2, color) -------------------------------------------------------------------- img:ellipse(x1, y1, x2, y2, color, [fillcolor] -------------------------------------------------------------------- Fixed handling of 2-bit vertical integrated screens Added direct element access for saving / restoring native image etc. Added more data to tostring() handler and a way to access individual items Added equals method to see if two variables reference the same image address (doesn't check if two separate images contain the same 'picture') Optimized get and set routines Fixed out of bound x coord access shifting to next line Added lua include files to expose new functionality Finished image saving routine Static allocation of set_viewport struct faster + saves ram over dynamic Cleaned up code Fixed pixel get/set for 1/2 bit devices ------------------------------------------------------------------------- Example lua script to follow on forums ------------------------------------------------------------------------- Change-Id: I7b9c1fd699442fb683760f781021091786c18509 |
||
---|---|---|
.. | ||
beatbox | ||
bitmaps | ||
chessbox | ||
clock | ||
doom | ||
fft | ||
fractals | ||
frotz | ||
goban | ||
imageviewer | ||
lib | ||
lua | ||
midi | ||
mikmod | ||
mpegplayer | ||
pacbox | ||
pdbox | ||
pictureflow | ||
puzzles | ||
reversi | ||
rockboy | ||
sdl | ||
searchengine | ||
shortcuts | ||
sudoku | ||
text_viewer | ||
xworld | ||
zxbox | ||
2048.c | ||
alarmclock.c | ||
alpine_cdc.c | ||
battery_bench.c | ||
bench_mem_jpeg.c | ||
bench_scaler.c | ||
blackjack.c | ||
boomshine.lua | ||
bounce.c | ||
brickmania.c | ||
bubbles.c | ||
BUILD_OVERLAY | ||
calculator.c | ||
calendar.c | ||
CATEGORIES | ||
chessbox.c | ||
chessclock.c | ||
chip8.c | ||
chopper.c | ||
clix.c | ||
codebuster.c | ||
credits.c | ||
credits.pl | ||
crypt_firmware.c | ||
cube.c | ||
demystify.c | ||
dice.c | ||
dict.c | ||
disktidy.c | ||
disktidy.config | ||
duke3d.c | ||
elfdep.pl | ||
euroconverter.c | ||
fire.c | ||
fireworks.c | ||
firmware_flash.c | ||
flipit.c | ||
goban.c | ||
greyscale.c | ||
helloworld.c | ||
helloworld.lua | ||
invadrox.c | ||
iriver_flash.c | ||
iriverify.c | ||
jackpot.c | ||
jewels.c | ||
keybox.c | ||
lamp.c | ||
logo.c | ||
lrcplayer.c | ||
main_menu_config.c | ||
matrix.c | ||
maze.c | ||
mazezam.c | ||
md5sum.c | ||
metronome.c | ||
minesweeper.c | ||
mosaique.c | ||
mp3_encoder.c | ||
nim.c | ||
oscilloscope.c | ||
otp.c | ||
pegbox.c | ||
periodic_table.c | ||
pictureflow.c | ||
pitch_detector.c | ||
pixel-painter.lua | ||
plasma.c | ||
plugin.lds | ||
plugin_crt0.c | ||
plugins.make | ||
pong.c | ||
properties.c | ||
random_folder_advance_config.c | ||
remote_control.c | ||
resistor.c | ||
robotfindskitten.c | ||
rockblox.c | ||
rockblox1d.c | ||
rockbox-fonts.config | ||
rockbox_flash.c | ||
rockboy.c | ||
rocklife.c | ||
rockpaint.c | ||
search.c | ||
settings_dumper.c | ||
shopper.c | ||
sliding_puzzle.c | ||
snake.c | ||
snake2.c | ||
snake2.levels | ||
snow.c | ||
sokoban.c | ||
sokoban.levels | ||
solitaire.c | ||
sort.c | ||
SOURCES | ||
SOURCES.app_build | ||
spacerocks.c | ||
speedread.c | ||
splitedit.c | ||
star.c | ||
starfield.c | ||
stats.c | ||
stopwatch.c | ||
stopwatch.lua | ||
SUBDIRS | ||
SUBDIRS.app_build | ||
superdom.c | ||
test_boost.c | ||
test_codec.c | ||
test_core_jpeg.c | ||
test_disk.c | ||
test_fps.c | ||
test_gfx.c | ||
test_grey.c | ||
test_greylib_bitmap_scale.c | ||
test_mem.c | ||
test_mem_jpeg.c | ||
test_resize.c | ||
test_sampr.c | ||
test_scanrate.c | ||
test_touchscreen.c | ||
test_viewports.c | ||
test_viewports.lua | ||
text_editor.c | ||
theme_remove.c | ||
vbrfix.c | ||
video.c | ||
viewers.config | ||
vu_meter.c | ||
wav2wv.c | ||
wavplay.c | ||
wavrecord.c | ||
wavview.c | ||
wormlet.c | ||
xobox.c | ||
zxbox.c |