Faster image strips horiz -> vertical...

** TODO:
    + audit & remove ImageList functionality ...

* Questions: is the ImageList really that useful ?
    + can we construct it idly / on demand ?

* Audit ImageList usage - how many of the
  constructors are actually used !?

* ImplImageRefData / IMAGETYPE_IMAGEREF:
    'Image: ImageList::GetImage( USHORT nId )'


* contrast - high contrast etc. (?)

* Actual constructor usage:

for sym in `objdump -T libvcl680li.so | grep ImageListC | sed 's/.*_ZN/_ZN/'`; do echo "$sym"; grep $sym *.so; done

External uses of constructors:

18  ImageList::ImageList(ResId const&)
8   ImageList::ImageList(unsigned short, unsigned short)
2   ImageList::ImageList(ImageList const&)
1   ImageList::ImageList(_STL::vector<rtl::OUString, _STL::allocator<rtl::OUString> > const&, rtl::OUString const&, Color const*) - libfwk

[axe ? ]
0   ImageList::ImageList(Bitmap const&, Color const&, unsigned short, unsigned short*, unsigned short)
0   ImageList::ImageList(Bitmap const&, Bitmap const&, unsigned short, unsigned short*, unsigned short)
0   ImageList::ImageList(Bitmap const&, Bitmap const&, unsigned short, unsigned short*, unsigned short)
0   ImageList::ImageList(Bitmap const&, unsigned short, unsigned short*, unsigned short)
[ axe ? ]

+ libfwk:
1   ImageList::ImageList(BitmapEx const&, _STL::vector<rtl::OUString, _STL::allocator<rtl::OUString> > const&, unsigned short)
    + uiconfiguration/moduleimagemanager.cxx:                    m_pUserImageList[nImageType] = new ImageList( aUserBitmap, aUserImagesVector );
    + uiconfiguration/imagemanager.cxx:                    m_pUserImageList[nImageType] = new ImageList( aUserBitmap, aUserImagesVector );
	+ read a 'User Bitmap' ( configuration pieces )
	+ [ fixed ]

+ libsvx:
1   ImageList::ImageList(Bitmap const&, unsigned short, unsigned short*, unsigned short)
svx/source/dialog/frmsel.cxx:    maILArrows = ImageList( aBmp, 16 );
    + Easy to re-write to use AddImage [ or sim. ]
    + [fixed]

** No need for the 'InitSize' etc.

* GetBitmapEx:
    + also problematic:
    + almost never used ...
    + [fixed]

> grep _ZNK9ImageList11GetBitmapExEv *.so
    Binary file libfwk680li.so matches
	+ user bitmap storage ...
	+ [ fixed ]
    Binary file libgo680li.so matches
	+ goodies/source/unographic/provider.cxx: aBmpEx = aImageList.GetBitmapEx();
	+ [ fixed ]

* Potential cleanups: *
    + use of 'GetImagePos':
	+ mostly:
	    if ( pList->GetImagePos( nImageId ) != IMAGELIST_IMAGE_NOTFOUND )
	+ should be 'pList->HasImagePos( nImageId )'
	    + file usage:
		framework/source/uiconfiguration/imagemanager.cxx
		framework/source/uiconfiguration/moduleimagemanager.cxx
[done]		sfx2/source/toolbox/imgmgr.cxx
[done]		svtools/source/misc/imagemgr.cxx

* Inside VCL:
    + image.cxx / .hxx changes
    + button.cxx:
	    + radio button images: used for:
		aBmp.Replace( pColorAry1, pColorAry2, 6, NULL );
		+ otherwise, could be a resource ...
    + brdwin.cxx:
	    + pin images (?)


* Other unused bits:

[done]  'GetColorTransformedImageList' ...
[done]  'Invert'
	+ 1 use in svtools/source/misc/imagemgr.cxx
	    + can be trivially altered to invert
	      individual images on the fly.
	    + saves forcing whole list into memory.

[done]	'CopyImage' - unused.

'ReplaceImage' - only 1 variant used [framework]
	+ ImageList::ReplaceImage(rtl::OUString const&, Image const&)

'RemoveImage' - 1 variant used [ framework ]
	+ ImageList::RemoveImage(unsigned short)

[ Build with the binfilter ?! ] ...
[ fixme: check binfilter ? ]
	operator>>(SvStream&, ImageList&)
	operator<<(SvStream&, ImageList const&)
	    + both unused ! :-)

++ Focus on implementing the existing functionality
    - then a full test build (?)
    + [ with binfilter ]

** some of these cleanups are -not-really- necessary
    + we just need to hack the core to allow a
      non-stupid immediate-load thing.

+ binfilter:
    + pretty clean:

michael@t60p:/usr/lib/ooo-2.0/program> for a in libbf*; do objdump -T $a; done | c++filt | grep ImageList::
00000000      DF *UND*  0000003f              ImageList::~ImageList()
00000000      DF *UND*  00000396              ImageList::ImageList(ResId const&)
00000000      DF *UND*  0000002d              ImageList::GetImageSize() const
00000000      DF *UND*  00000016              ImageList::GetImageCount() const
00000000      DF *UND*  0000001c              ImageList::ImageList(unsigned short, unsigned short)
00000000      DF *UND*  00000061              ImageList::GetImageId(unsigned short) const
00000000      DF *UND*  0000005a              ImageList::GetImagePos(unsigned short) const
00000000      DF *UND*  0000003f              ImageList::~ImageList()
00000000      DF *UND*  000000c1              ImageList::GetImage(unsigned short) const


++ RemoveImage
michael@t60p:/opt/OOInstall/program> grep 'RemoveImage' *
Binary file libfwk680li.so matches
    + 1 use ...
	+ exposed via UNO (urgh)

++ Instead 'GetImagePos' ?
    + GetImagePos - seems pretty pointless ... [?]
    + HasImageAtPos (?)
	+ who is serializing the Pos ?
    + what is going on here ?

+ GetImageSize:
  + sw, svx - call this method ...



+ impimage.cxx
+ image.cxx
+ image.h / image.hxx
+ outdev2.cxx


** TODO:

    + test load/save of horiz image strips etc.
	+ customize toolbars et. al.
    + sizing issues (?)

** Timings:

+ new code: warm:

001986 1 } PERFORMANCE - DesktopOpenClients_Impl()
002022 1 } PERFORMANCE - DesktopOpenClients_Impl()
001952 1 } PERFORMANCE - DesktopOpenClients_Impl()

+ new code: cold start [sorted]

007869 1 } PERFORMANCE - DesktopOpenClients_Impl()
007933 1 } PERFORMANCE - DesktopOpenClients_Impl()
007571 1 } PERFORMANCE - DesktopOpenClients_Impl()

+ new code: cold start [unsorted]

007506 1 } PERFORMANCE - DesktopOpenClients_Impl()
007711 1 } PERFORMANCE - DesktopOpenClients_Impl()
007634 1 } PERFORMANCE - DesktopOpenClients_Impl()

+ old code: warm:

001949 1 } PERFORMANCE - DesktopOpenClients_Impl()
001938 1 } PERFORMANCE - DesktopOpenClients_Impl()
002095 1 } PERFORMANCE - DesktopOpenClients_Impl()

+ old code: cold:

008164 1 } PERFORMANCE - DesktopOpenClients_Impl()
007960 1 } PERFORMANCE - DesktopOpenClients_Impl()
007426 1 } PERFORMANCE - DesktopOpenClients_Impl()

++ ie. no real difference on cold start

+ new + image lookup hash (warm):

001655 1 } PERFORMANCE - DesktopOpenClients_Impl()
001696 1 } PERFORMANCE - DesktopOpenClients_Impl()
001657 1 } PERFORMANCE - DesktopOpenClients_Impl()


michael@t60p:/opt/OpenOffice/ooo-build-2-0-2> du -k ~/.ooo-2.0/user/config/imagecache
2406    /home/michael/.ooo-2.0/user/config/imagecache

+ Get memory profile numbers ...

21254 michael   15   0  423m  61m  40m S    0  3.1   0:02.32 soffice.bin
21342 michael   15   0  427m  64m  40m S    0  3.2   0:02.92 soffice.bin

3Mb saved (?)

+ TODO:
    + work out how to test the results ...
	+ [ low memory ? ]
    + sort images.zip:
	+ don't compress the .pngs: & test perf ...
	    + size wise - a small loss for lc_zoom*
    + Test / fix UI customization
    + make a test that loads the images
      several times ? - unzipped ? a warm
      start speedup ?

