Extracting  just a single tile out of JPEG file  is a really big PITA
There are about 27 different variants of JPEG (though not all really
matter
and are widely used)

Usually you've got 8x8 tiles in row-order,  and because of entropy
encoding
you can not navigate just to  random tile - you'll have to scan from
the start
( maybe you can build index,  where single block-rows start - this
will make scanning easier )

In this case, there will be only 1000 rows,  with 1000 block in them
- performance may
be adequate.

On Nov 20, 11:32 pm, Robert Green <rbgrn....@gmail.com> wrote:
> I'd solve this by writing a preprocessor that breaks that big file
> down into manageable chunks.  Think of having 10x10 array of 800x800
> images.  I would also mipmap a 4000x4000, 2000x2000, 1000x1000 and
> 500x500 of the file.  Then, start the user on the correct zoom level,
> using only the tiles you need of your arrays.  OpenGL is actually
> really good for this sort of thing.  You could feasibly use 1024x1024
> pixel texture tiles with an orthographic projection and let it handle
> the scaling.
>
> In short, I don't believe there is any way to get 8000x8000x16bit =
> 128MB of bitmap data into 16MB of RAM all at once, but you can
> definitely break it apart and work with pieces.  A 1000x1000 pixel
> piece consumes 2MB of RAM.  You could have 4 of those loaded at once
> and be OK on memory.  If you're viewing actual pixels, you only need a
> max of 4 loaded at a time to have seamless panning between them.
>
> On Nov 20, 2:38 pm, PJ <pjbar...@gmail.com> wrote:
>
> > We might be able to come up with more creative solutions if you give
> > us more information about where the 8000x8000 jpeg file is coming
> > from, and whether you just want to display it in a WxH view or to do
> > something else with it.
>
> > Also, since you expressed interest in Google's server-side solution
> > for Google Maps, are you considering developing a server-side
> > component to your app as well?  If so, you could host this capability
> > (convert 8000x8000 image to smaller image) on a server somewhere.
>
> > If you try to do all processing on the device itself, it's probably
> > going to be very slow.
>
> > What does your app do?  Now you've got me all curious.  :D
>
> > -- PJ
>
> > On Nov 19, 7:06 pm, James Wang <jameswangc...@gmail.com> wrote:
>
> > > > > Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 
> > > > > tiles).
>
> > > > > Step #3: Render tiles on-screen by drawing them on the Canvas, and
> > > > > support swipe gestures to move through the image by replacing tiles,
> > > > > much like Google Maps works.
>
> > > Hi Mark, AFAIK, the decoder of jpeg on android must support to read
> > > random part of jpeg file if I want do step#2 as you said.
> > > I checked out SDK reference and found out the default decoder of jpeg
> > > seems not support it. Am I right?
> > > Do I have to make another jpeg decoder?
>
> > > BTW, I think google map does the same thing on server side, not on
> > > mobile phone, does not it?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to