multimedia fun with openoffice calc
TRANSCRIPT
Apache OpenOffice Presentation Template
Multimedia Fun with OpenOffice Calc
[email protected]
2013-04-19
Multimedia Fun with OpenOffice Calc is created by imacat (Yang Shih-Ching),and licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
Create charts and reports
imacat
Member of the Apache OpenOffice Project Management Committee
An OpenOffice committer
System administrator of OpenOffice forum and Wiki
A member of Women in Free and Open Source Software
A graduate student from National Taiwan Normal University
Question:What do you do with a spreadsheet?
Counting salaries
Counting student scores
Creating charts and reports
Creating quotations
Doing calculation for strategy games
Voting machine
This talk is a modificationof my previous talkin ApacheCon Europe 2012at Sinsheim, Germanon 2012/11/6
with additions ofsome of my interesting works afterwards.
And my talk in German
was based on my lightning talkin COSCUP 2013
Has anyone attended to my lightning talkin COSCUP 2013?Has anyone remember what I had done?
My lightning talk in COSCUP 2013was about something I didjust one week before COSCUP 2013,which I had not enough timeto finish and present it completely.
And here is the story.
Long time ago in the far, far landwhen I was still a child
Long time ago in the far, far landwhen I was still a childWell, actually it was only in last August. :p
I saw on my RSS reader...
So I followed the story and watched the video
Its cool, isnt it?
Its cool, isnt it?Yes, its SO COOL!
I forwarded it onto our Google Plus,our Facebook fans page,our forums, local forum, etc.
I forwarded it onto our Google Plus,our Facebook fans page,our forums, local forum, etc.Then I put it awayand return to my textbook.
Until I saw Rob talking about this video the next day
So I watched it again, and also the behind the scenes
Well, I think
Well, I thinkYeah, I can do it
Well, I thinkYeah, I can do itprogrammatically!
Creating mosaic arts involvescalculating the average colors of image blocks.Since neither OpenOffice BASIC nor UNO API has any methodto obtain the colors of individual pixels,I have use Java to do this.
So here it is ^_^
(demonstration)
Its cool, isnt it?
No.
No, thats not cool.Its uglier than the original Stop-Motion Excel.Its not the eye candy that I imagined.
Why?The original Stop-Motion Excelwas painted manually, cell by cell.MysteryGuitarMan painted it with a fixed palette, but not average colors.It looks sharp. It feels like an animation.
Comparing Hand-Painted Colors
with Mosaic Average Colors
So I need to find something more cool,something sharp,something with a high contrast.
That is not an easy task.
The idea of Calc Mosaicis not only to create mosaic arts,but also to create stop-motion animations.
But it takes averagely 20 secondsto create a spreadsheet of mosaic artwith the Java UNO application.I cannot run the animationby creating the mosaic art at real-time.
So I turn to another method,to create each frame with a spreadsheet,and play them in sequence,as a stop-motion animation.
But then a spreadsheet document can only contain a maximum of 256 spreadsheets.
Since I only have 256 frames,this cannot be long.
I remembered there is the iPod Ad
The iPod Ad
Has only 31 seconds, corresponding to 8 FPS if we are having 256 frames.
The iPod Ad
Has only 31 seconds, corresponding to 8 FPS if we are having 256 frames.
Has sharp images, high contrasts.
The iPod Ad
Has only 31 seconds, corresponding to 8 FPS if we are having 256 frames.
Has sharp images, high contrasts.
Is very famous.
So here it is
(demonstration)
At the same time, Villeroy responded to my Calc Mosaic on the forum, using a different approach.
Villeroys Response
So here it is
(demonstration)
As you can see,Villeroy places the color values in the cells.The OpenOffice BASIC macro can read and update the cell background colors accordingly.OpenOffice BASIC is a lot fasterthan Java UNO.This makes it possible to animate at real time.
Villeroys approach still has some disadvantages
Disadvantages of
Villeroys Approach
You still need to have the color values first.
Disadvantages of
Villeroys Approach
You still need to have the color values first.
The frame rate is still low.
Disadvantages of
Villeroys Approach
You still need to have the color values first.
The frame rate is still low.
Villeroy updates the colors with styles.A lot faster than painting the background color cell by cell.
The number of colors to use is limited. That is why it is gray-scaled.
This is a different approach than me.But I still got greatly inspired.
The color values can be saved in the sheets,and painted with OpenOffice BASIC.This can make it a lot faster.
And I know there is the setDataArray()in the interface XCellRangeData.I can populate all the color values at onceinstead of hundreds of UNO callsto set the CellBackColor propertyOf SheetCell.
The New Process Will Be
Calculates the average colors of mosaic cells with the Java application.
The New Process Will Be
Calculates the average colors of mosaic cells with the Java application.
Passes the color values from Java to OpenOffice BASIC.
The New Process Will Be
Calculates the average colors of mosaic cells with the Java application.
Passes the color values from Java to OpenOffice BASIC.
Paints the background colors of the spreadsheet cells with the OpenOffice BASIC macro.
So the problem becomes:Writing an applicationboth in Java and OpenOffice BASIC.
So the problem becomes:Writing an applicationboth in Java and OpenOffice BASIC.Or, simply,Creating the OpenOffice BASIC macrosthrough the UNO API with Java.
In the unpublished UNO API,there is a BasicLibraries propertyin OfficeDocumentthat application developers canaccess, insert or delete the BASIC macros.
Theres also the XScriptProvider interfacethat I can use it to invokethe existing OpenOffice macros.
So I use them to inject the BASIC macrosinto the newly-created spreadsheet document,and run these macros.
In fact, I dont even need to use setDataArray()to paste the color values into the spreadsheets.I can pass the color values as parametersto the invoked BASIC macros.
This is troublesome,but the result is amazing.It is 8 times faster then before!
When I prepare for my ApacheCon presentation,I became more and more greedy.
I want something new,something hot,something gets people excited!
Then I came across this
Something hot
Well, again, I think
Well, again, I thinkYeah, I can do it!
So here is it.
When preparing for OSDC.tw,Gangnam Style became outdated.I need a new one.
(demonstration)
That is the story of Calc Mosaic.To create your own Mosaic video,get Calc Mosaic athttp://sf.net/p/calcmosaic.
More Than Calc Mosaic
Last year after I returned from German,I attended to a speech in our instituteat the end of November.It was about new media art.
New Media Art
Oh, no
Oh, noI can do it.
I can do it
I can play piano notes using the Shell command mplayer in OpenOffice BASIC.
I can do it
I can play piano notes using the Shell command mplayer in OpenOffice BASIC.
I can attach click events with picture objects.
I can do it
I can play piano notes using the Shell command mplayer in OpenOffice BASIC.
I can attach click events with picture objects.
I can change the colors of the Calc spreadsheet cells.
I can do it
I can play piano notes using the Shell command mplayer in OpenOffice BASIC.
I can attach click events with picture objects.
I can change the colors of the Calc spreadsheet cells.
It's possible to create an animated, interactive Piano with Calc.
(demonstration)
Furthermore,with a little modification,I released a piano questin the Christmas.
(demonstration)
Thank you.Any question?