Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #34929 > unrolled thread

TIFF on android.

Started byalbert@spenarnc.xs4all.nl (Albert van der Horst)
First post2014-12-15 10:51 +0000
Last post2014-12-17 18:52 +0100
Articles 12 — 6 participants

Back to article view | Back to comp.lang.forth


Contents

  TIFF on android. albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-12-15 10:51 +0000
    Re: TIFF on android. awegel@arcor.de (Alexander Wegel) - 2014-12-15 13:19 +0100
    Re: TIFF on android. Paul Rubin <no.email@nospam.invalid> - 2014-12-15 11:00 -0800
      Re: TIFF on android. "WJ" <w_a_x_man@yahoo.com> - 2014-12-15 20:09 +0000
      Re: TIFF on android. Bernd Paysan <bernd.paysan@gmx.de> - 2014-12-16 01:59 +0100
      Re: TIFF on android. anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-12-16 08:45 +0000
        Re: TIFF on android. Paul Rubin <no.email@nospam.invalid> - 2014-12-16 01:22 -0800
          Re: TIFF on android. albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-12-16 10:22 +0000
          Re: TIFF on android. anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-12-17 09:44 +0000
      Re: TIFF on android. albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-12-16 10:15 +0000
    Re: TIFF on android. awegel@arcor.de (Alexander Wegel) - 2014-12-16 03:50 +0100
      Re: TIFF on android. awegel@arcor.de (Alexander Wegel) - 2014-12-17 18:52 +0100

#34929 — TIFF on android.

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2014-12-15 10:51 +0000
SubjectTIFF on android.
Message-ID<548ebd47$0$6948$e4fe514c@dreader36.news.xs4all.nl>
I'd like to use my tablet (an Asus memopad) to generate pictures
in tiff format, without any compression at all.

I'd like to use gforth, but I don't have an idea how to go about this.
Can it be done only by using c-libraries? Maybe that is
not even possible. Also I could use a hint/example how to use
c-libraries from gforth on the android.
I can't find a camera program that uses tiff, so that may be
a hint that there is no driver support.

I could add -- if need be -- code words to gForth, but that requires
information about how to access the graphics hardware.
My impression is that is not easy to get by, but I didn't spent
much effort.

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [next] | [standalone]


#34930

Fromawegel@arcor.de (Alexander Wegel)
Date2014-12-15 13:19 +0100
Message-ID<1lwp5qb.1sgvbbh10jvbqqN%awegel@arcor.de>
In reply to#34929
Hi

You can get the tiff standard, and quite some infos on the file format,
the required tags etc. on the net - tiffs aren't very complicated.

From there, it shouldn't be so hard to just generate the tiff in memory,
or maybe even write it straight to a file.

There shouldn't be a need for c-libs or code-words (maybe one if there's
a need to convert the format of lots of image data, but probably not).
(The c tiff lib might still be useful as an additional reference
though.)

Cheers,
Alex

[toc] | [prev] | [next] | [standalone]


#34936

FromPaul Rubin <no.email@nospam.invalid>
Date2014-12-15 11:00 -0800
Message-ID<7xa92okaan.fsf@ruckus.brouhaha.com>
In reply to#34929
albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
> I'd like to use my tablet (an Asus memopad) to generate pictures
> in tiff format, without any compression at all. ...
> I could add -- if need be -- code words to gForth, but that requires
> information about how to access the graphics hardware.

I think there are some Android calls to access the camera frame buffer.
So you get the raw image and then you can convert it to TIFF if you
want.  I personally wouldn't mess with TIFF.  It's an awful format.
Either save as PNG if you want cooked but uncompressed images, or save
as DNG (raw) and use something like dcraw to convert to other formats.

Some Android API info

  https://developer.android.com/reference/android/hardware/camera2/package-summary.html

A video about the camera stack in flash-only format, dunno why this is
allowed on linux.com (the html5 link doesn't work, at least for me):

  http://video.linux.com/videos/exposing-the-android-camera-stack

I haven't watched the video so don't know if it has anything useful.

[toc] | [prev] | [next] | [standalone]


#34938

From"WJ" <w_a_x_man@yahoo.com>
Date2014-12-15 20:09 +0000
Message-ID<m6nf62$4j9$1@dont-email.me>
In reply to#34936
Paul Rubin wrote:

> Either save as PNG if you want cooked but uncompressed images,

I don't think this is correct.  It's my understanding that PNG
is compressed but not lossy.  After decompression, the exact
original image is restored.

[toc] | [prev] | [next] | [standalone]


#34946

FromBernd Paysan <bernd.paysan@gmx.de>
Date2014-12-16 01:59 +0100
Message-ID<m6o04m$87p$1@dont-email.me>
In reply to#34936
Paul Rubin wrote:

> albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>> I'd like to use my tablet (an Asus memopad) to generate pictures
>> in tiff format, without any compression at all. ...
>> I could add -- if need be -- code words to gForth, but that requires
>> information about how to access the graphics hardware.
> 
> I think there are some Android calls to access the camera frame buffer.
> So you get the raw image and then you can convert it to TIFF if you
> want.  I personally wouldn't mess with TIFF.  It's an awful format.
> Either save as PNG if you want cooked but uncompressed images, or save
> as DNG (raw) and use something like dcraw to convert to other formats.

The next Android Gforth release will use SOIL2 as image library, and SOIL2 
has a call to save images as PNG (and a few other, less useful formats).  It 
can take a screenshot for you; otherwise it saves an RGBA image from memory; 
so you can render into some OpenGL buffer, and extract that data in RGBA 
format and then save it with SOIL_save_image.  The current SOIL also has 
these calls, but it can only save into BMP, DDS and TGA, which are the less 
useful formats mentioned above.  If you want to process the output with some 
external program, put it online, or read it into Gforth again with libSOIL 
(can read PNG), then PNG is the way to go - lossless compressed.

glReadPixels is your friend for getting OpenGL buffer data into memory.  If 
you want no compression at all, and a very simple format, use the X Window 
PPM format:

http://netpbm.sourceforge.net/doc/ppm.html

This format is extremely simple, it's just RGB as bytes, with a very simple 
ASCII header.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

[toc] | [prev] | [next] | [standalone]


#34953

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2014-12-16 08:45 +0000
Message-ID<2014Dec16.094531@mips.complang.tuwien.ac.at>
In reply to#34936
Paul Rubin <no.email@nospam.invalid> writes:
>I think there are some Android calls to access the camera frame buffer.
>So you get the raw image and then you can convert it to TIFF if you
>want.  I personally wouldn't mess with TIFF.  It's an awful format.
>Either save as PNG if you want cooked but uncompressed images,

PNG is compressed.

> or save
>as DNG (raw) and use something like dcraw to convert to other formats.

DNG is based on TIFF.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2014: http://www.euroforth.org/ef14/

[toc] | [prev] | [next] | [standalone]


#34954

FromPaul Rubin <no.email@nospam.invalid>
Date2014-12-16 01:22 -0800
Message-ID<7xh9wwosou.fsf@ruckus.brouhaha.com>
In reply to#34953
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
> PNG is compressed.

Well, lossless.

> DNG is based on TIFF.

TIFF is monstrously complicated with zillions of modes.  DNG is based on
a particular mode of it or something like that, thus much simpler.

[toc] | [prev] | [next] | [standalone]


#34958

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2014-12-16 10:22 +0000
Message-ID<549007c9$0$6849$e4fe514c@dreader36.news.xs4all.nl>
In reply to#34954
In article <7xh9wwosou.fsf@ruckus.brouhaha.com>,
Paul Rubin  <no.email@nospam.invalid> wrote:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>> PNG is compressed.
>
>Well, lossless.

Which was what I intended. It is no problem to decompress before use.

>
>> DNG is based on TIFF.
>
>TIFF is monstrously complicated with zillions of modes.  DNG is based on
>a particular mode of it or something like that, thus much simpler.

If, like me you, you want to use tiff for a particular purpose, it may
not be too bad, just use one of the modes. This may amount to TIFF.

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#34987

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2014-12-17 09:44 +0000
Message-ID<2014Dec17.104416@mips.complang.tuwien.ac.at>
In reply to#34954
Paul Rubin <no.email@nospam.invalid> writes:
>anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>> DNG is based on TIFF.
>
>TIFF is monstrously complicated with zillions of modes.  DNG is based on
>a particular mode of it or something like that, thus much simpler.

For generating you only need to understand one mode.  Of course there
is still the problem of knowing which mode the other tools understand,
and DNG may be useful in that respect.  Concerning it's "digital
negative" claim, I have read that it may contain vendor-specific data
relevant for interpreting the result (such as lens correction data),
so it's not clear that it is really better than proprietary raw
formats; OTOH, a classical negative does not contain lens data etc. at
all.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2014: http://www.euroforth.org/ef14/

[toc] | [prev] | [next] | [standalone]


#34957

Fromalbert@spenarnc.xs4all.nl (Albert van der Horst)
Date2014-12-16 10:15 +0000
Message-ID<54900626$0$6849$e4fe514c@dreader36.news.xs4all.nl>
In reply to#34936
In article <7xa92okaan.fsf@ruckus.brouhaha.com>,
Paul Rubin  <no.email@nospam.invalid> wrote:
>albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>> I'd like to use my tablet (an Asus memopad) to generate pictures
>> in tiff format, without any compression at all. ...
>> I could add -- if need be -- code words to gForth, but that requires
>> information about how to access the graphics hardware.
>
>I think there are some Android calls to access the camera frame buffer.
>So you get the raw image and then you can convert it to TIFF if you
>want.  I personally wouldn't mess with TIFF.  It's an awful format.
>Either save as PNG if you want cooked but uncompressed images, or save
>as DNG (raw) and use something like dcraw to convert to other formats.

I'll go with png probably then. I worked with tiff once and it
wasn't a great hassle.

>
>Some Android API info
>
>  https://developer.android.com/reference/android/hardware/camera2/package-summary.html

This gives a way the main problem. Interfacing through java.

>
>A video about the camera stack in flash-only format, dunno why this is
>allowed on linux.com (the html5 link doesn't work, at least for me):
>
>  http://video.linux.com/videos/exposing-the-android-camera-stack

Should be useful. But this page is another of those terribly complicated
javascript scripts. that doesn't work on my debian, without

>
>I haven't watched the video so don't know if it has anything useful.

I haven't either. But maybe on my android pad.

Thanks a lot for the hints.

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#34949

Fromawegel@arcor.de (Alexander Wegel)
Date2014-12-16 03:50 +0100
Message-ID<1lwq5zd.ci3y5x1aelex7N%awegel@arcor.de>
In reply to#34929
Oops - i think i misunderstood the intent of your posting.
Looking at it again, i see that your main problem is how to
access the camera (or the data), not so much the file format.

Hmm - gforth for android contains an example called
"android-recorder.fs" which accesses the camera using JNI - i think this
is going in the direction you want..

[toc] | [prev] | [next] | [standalone]


#35000

Fromawegel@arcor.de (Alexander Wegel)
Date2014-12-17 18:52 +0100
Message-ID<1lwt6w6.wmayn0evg1ikN%awegel@arcor.de>
In reply to#34949
Alexander Wegel <awegel@arcor.de> wrote:

> Hmm - gforth for android contains an example called
> "android-recorder.fs" which accesses the camera using JNI - i think this
> is going in the direction you want..

There's also an introduction to using the jni from gforth-android at

http://www.forth-ev.de/wiki/doku.php/en:projects:gforth-android:start

Together with the docs at developer.android.com (starting at
http://developer.android.com/guide/topics/media/camera.html)
it ought to be doable, i guess.

Cheers,
Alex

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web