Re: Any sample for PalmPhoto APIs ?

2004-01-29 Thread Chris Olson
I'm still looking ito exactly what they mean by all of this  :-)
...it's not the most clearly worded of statements, especially as the 
libraries themselves are not actually mentioned in the doumentation at 
all...

... I have access to both pieces of hardware and will report !

...but right now I havea bit of a problem.  If anyone can help with this 
one...

I'm trying to use the libs to display a (roughly) 320x320 jpeg on a 16 
bit display.  Here is the function I'm using:

The symptom is that the colors look like the palette is messed up.  The 
screen is set up in 16 bit mode as well.
Anybody see anything I'm missing?

PS.  The freeware jpeglib works fine...  I must be missing something...

WinHandle
Drawing::LoadJPG (Char* file)
{
   BitmapTypeV3* b3;
   BitmapPtr b;
   Err error;
   UInt16 jpegLibRef = 0;
   UInt16 volRefNum;
   UInt32 volIterator;
   WinHandle img;
   PalmPhotoDisplayParam displayParam;
   PalmPhotoFileLocation photoFile;
   PalmPhotoHandle photoHandle = 0;
   PalmPhotoImageInfo photoInfo;
   WinHandle img2;
   error = SysLibFind(PalmPhotoLibName, jpegLibRef);
   if (error != errNone)
   error = SysLibLoad(PalmPhotoLibTypeID, PalmPhotoLibCreatorID, 
jpegLibRef);
   if (error == errNone)
   PalmPhotoLibOpen(jpegLibRef);
   else
   goto ErrorExit;

   volIterator = vfsIteratorStart;
   error = VFSVolumeEnumerate(volRefNum, volIterator);
   if (error != errNone)
   goto ErrorExit;
   photoFile.fileLocationType = palmPhotoVFSLocation;
   photoFile.file.VFSFile.volumeRef = volRefNum;
   StrCopy(photoFile.file.VFSFile.name, file);
   photoHandle = PalmPhotoOpenImage(jpegLibRef, photoFile, error);
   if (error != errNone)
   goto ErrorExit;
  
   error = PalmPhotoGetImageInfo(jpegLibRef, photoHandle, photoInfo);
   if (error)
   goto ErrorExit;

   b = BmpCreate(photoInfo.width, photoInfo.height, 16, NULL, error);
   if (error != errNone)
   goto ErrorExit;
   b3 = BmpCreateBitmapV3(b, kDensityDouble, BmpGetBits(b), NULL);
   img = WinCreateBitmapWindow((BitmapPtr) b, error);
   if (error != errNone)
   goto ErrorExit;
  
   displayParam.winH = img;
   displayParam.rect.topLeft.x = 0;
   displayParam.rect.topLeft.y = 0;
   displayParam.rect.extent.x = photoInfo.width;
   displayParam.rect.extent.y = photoInfo.height;
   displayParam.displayCallback = NULL;
   displayParam.userDataP = NULL;
   error = PalmPhotoDisplayImage(jpegLibRef, photoHandle, displayParam);
   if (error != errNone)
   goto ErrorExit;
  
   img2 = WinCreateBitmapWindow((BitmapPtr) b3, error);
   WinDeleteWindow(img, false);

   PalmPhotoCloseImage(jpegLibRef, photoHandle);
   PalmPhotoLibClose(jpegLibRef);   
   SysLibRemove(jpegLibRef);

   return img2;

ErrorExit:
   if (photoHandle)
   PalmPhotoCloseImage(jpegLibRef, photoHandle);
   if (jpegLibRef) {
   PalmPhotoLibClose(jpegLibRef);   
   SysLibRemove(jpegLibRef);
   }

   return NULL;
} // LoadJPG
Regis St-Gelais wrote:

Chris Olson [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]
 

Umm, the SDK comes with an installable version of the PalmPhotoLib.prc ...

   

The readme.txt file in the PalmPhotoLib of the SDK says:
QUOTE
The Palm Photo API allows developers to take advantage of services in the
Palm Photos  application, v.1.1.0.20.  The API will work only in conjunction
with Photos  v.1.1.0.20 which is available on the Tungsten|T3 and Tungsten|E
devices.
/QUOTE
Anyway, I want some thing that won't need an external prc. So I will stick
to jcpalm which can be included directly into my app.
 



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-29 Thread Regis St-Gelais


Chris Olson [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]
 I'm still looking ito exactly what they mean by all of this  :-)
 ...it's not the most clearly worded of statements, especially as the
 libraries themselves are not actually mentioned in the doumentation at
 all...

 ... I have access to both pieces of hardware and will report !

I've the FotoFinish sample on a Zire 71 with the lib prcs.
FotoFinish is able to load the library but is not able to access the
PhotoApp database.


 ...but right now I havea bit of a problem.  If anyone can help with this
 one...

 I'm trying to use the libs to display a (roughly) 320x320 jpeg on a 16
 bit display.  Here is the function I'm using:

 The symptom is that the colors look like the palette is messed up.  The
 screen is set up in 16 bit mode as well.
 Anybody see anything I'm missing?

 PS.  The freeware jpeglib works fine...  I must be missing something...


I did not look in detail into your code but just in case you don't know,
here are a few hints:

- Palm use RGB565 for it's 16 bit color. Most JPEG library convert to 24
bits RGB. If this is your case, tou must convert your data from 24 bits RGB
to RGB565. It is done by masking and shifting. 5bits for R, 6 bits for G and
5 bits for B.

The library I am using (jcpalm) can convert directly to RGB565. It is
avaliable from the eyemodule web site in the developer section.
www.eyemodule.com  It can be used freely as long as you acknowledge the
copyright inside your own copyright. It is the case for all library made
from the code from the IJG (Independant JPEG Group). See the readme.txt with
the library.
(By the way, if you open the about box of MSN Messenger, you will see the
same acknoledgment of the IJG)

Hope this helps

-- 
Regis St-Gelais
www.laubrass.com
--



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-29 Thread Chris Olson
Regis St-Gelais wrote:

Chris Olson [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]
 

I'm still looking ito exactly what they mean by all of this  :-)
...it's not the most clearly worded of statements, especially as the
libraries themselves are not actually mentioned in the doumentation at
all...
... I have access to both pieces of hardware and will report !
   

I've the FotoFinish sample on a Zire 71 with the lib prcs.
FotoFinish is able to load the library but is not able to access the
PhotoApp database.
Ok, I can code around that issue (use the Palm libs when available, they 
seem faster).

...but right now I havea bit of a problem.  If anyone can help with this
one...
I'm trying to use the libs to display a (roughly) 320x320 jpeg on a 16
bit display.  Here is the function I'm using:
The symptom is that the colors look like the palette is messed up.  The
screen is set up in 16 bit mode as well.
Anybody see anything I'm missing?
PS.  The freeware jpeglib works fine...  I must be missing something...

   

I did not look in detail into your code but just in case you don't know,
here are a few hints:
- Palm use RGB565 for it's 16 bit color. Most JPEG library convert to 24
bits RGB. If this is your case, tou must convert your data from 24 bits RGB
to RGB565. It is done by masking and shifting. 5bits for R, 6 bits for G and
5 bits for B.
 

Hmm, I guess I assumed the Palm Library would know enough to do this on 
it's own.  I'm going to look at the FotoFinish source again to see how 
they handle it, they may do the conversion with the callback, hold on...

... hmm, interesting.  I think I might have a clue what is going on 
now.  It looks like some assumptions are occuring in the library about 
the layout of the bits in the window, experiment in progress...

Okay, I have it figured out.  You have to create the window in native 
format.  If you don't the bytes get swapped into the wrong order and the 
display is messed up.  I was creating the bitmap, then creating a window 
from that, turns out you need to create an offscreen window and go from 
there.  Who knew?

The library I am using (jcpalm) can convert directly to RGB565. It is
avaliable from the eyemodule web site in the developer section.
www.eyemodule.com  It can be used freely as long as you acknowledge the
copyright inside your own copyright. It is the case for all library made
from the code from the IJG (Independant JPEG Group). See the readme.txt with
the library.
(By the way, if you open the about box of MSN Messenger, you will see the
same acknoledgment of the IJG)
Hope this helps
 

If I begged and pleaded, could you send me the libraries?  Not is source 
form, but in compiled form as I'm using Codewarrior 8 and the source is 
for 9 (I think the object format is compatible...)

Chris

PS.  My code will only rin on OS5 devices anyway...

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-29 Thread Regis St-Gelais


Chris Olson [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]



 If I begged and pleaded, could you send me the libraries?  Not is source
 form, but in compiled form as I'm using Codewarrior 8 and the source is
 for 9 (I think the object format is compatible...)


As I said, you can download it (source and binary) from
http://www.eyemodule.com/developer/index.asp
It is labeled : palmOS® JPEG compression library
Just click and you'll get it.

It can be used as a shared library prc or you can include the source in your
code.
There are samples with the lib to do both in CW.

If you recompile it, you will need to make a small change in the source code
(bug on newer version of codewarrior that will be corrected in the 9.3
patch) See the thread Build jcpalm library with cw9.2 started in January
26, 2004

Best regards.

-- 
Regis St-Gelais
www.laubrass.com
--



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-28 Thread Chris Olson
Umm, the SDK comes with an installable version of the PalmPhotoLib.prc ...

Colmerauer wrote:

Oops,sorry ! too much coffee today ...

Colmerauer

Regis St-Gelais [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]
dev-forum:
 

PalmCameraLib and PalmPhoto are two completely different set of APIs..
   



 



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-28 Thread Regis St-Gelais
Chris Olson [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]
 Umm, the SDK comes with an installable version of the PalmPhotoLib.prc ...


The readme.txt file in the PalmPhotoLib of the SDK says:
QUOTE
The Palm Photo API allows developers to take advantage of services in the
Palm Photos  application, v.1.1.0.20.  The API will work only in conjunction
with Photos  v.1.1.0.20 which is available on the Tungsten|T3 and Tungsten|E
devices.
/QUOTE

Anyway, I want some thing that won't need an external prc. So I will stick
to jcpalm which can be included directly into my app.

-- 
Regis St-Gelais
www.laubrass.com
--



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-26 Thread Laurens

Regis St-Gelais [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 But I am having a hard time making the palm photo APIs work.
 Well, I am not even able to load the library.

  err=SysLibFind(PalmPhotoLibName, PhotoRefNum);
  if (err != errNone)
   {
   err=SysLibLoad(PalmPhotoLibTypeID, PalmPhotoLibCreatorID, PhotoRefNum);
   }

 Those 2 calls both give me a lib not fund error.
 I a debuging directly on a Zire71 device.


There's a readme.txt in the Extra\PalmPhotoLib directory that says:

The Palm Photo API allows developers to take advantage of services in the
Palm Photos  application, v.1.1.0.20.  The API will work only in conjunction
with Photos  v.1.1.0.20 which is available on the Tungsten|T3 and Tungsten|E
devices.

There's no mention of the Zire 71.

Regards
-Laurens



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-26 Thread Regis St-Gelais


Laurens [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]

 There's a readme.txt in the Extra\PalmPhotoLib directory that says:

 The Palm Photo API allows developers to take advantage of services in the
 Palm Photos  application, v.1.1.0.20.  The API will work only in
conjunction
 with Photos  v.1.1.0.20 which is available on the Tungsten|T3 and
Tungsten|E
 devices.

 There's no mention of the Zire 71.


Well, I saw that at the begening of my tests with the cameralib, but since I
was able to make the cameralib to work, I sort of forgot this warning.
Thanks

I fund a library to deal with JPEG but I have some isue with it. See my
post: Build jcpalm library with cw9.2

-- 
Regis St-Gelais
www.laubrass.com
--



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-26 Thread Colmerauer
Hi Regis,


  err=SysLibFind(PalmPhotoLibName, PhotoRefNum);
  if (err != errNone)
   {
   err=SysLibLoad(PalmPhotoLibTypeID, PalmPhotoLibCreatorID,
   PhotoRefNum); }
 
 Those 2 calls both give me a lib not fund error.
 I a debuging directly on a Zire71 device.

Here is my HB++ code and it works well for me on a ZIRE 71.
Perhaps you can check variables values .


iRefNum=LoadLibrary(CameraLib-camL,libr,camL)


Where CameraLib-camL is the PalmPhotoLibName
  camL is the PalmPhotoLibCreatorID


HTH 

Colmerauer

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-26 Thread Regis St-Gelais


Colmerauer [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]
 Hi Regis,


 Here is my HB++ code and it works well for me on a ZIRE 71.
 Perhaps you can check variables values .


 iRefNum=LoadLibrary(CameraLib-camL,libr,camL)


 Where CameraLib-camL is the PalmPhotoLibName
   camL is the PalmPhotoLibCreatorID


Hi Colmerauer,

PalmCameraLib and PalmPhoto are two completely different set of APIs..

PalmCameraLib is the library that controls the camera hardware and allows to
preview and capture images. I was able to call and use that one.

PalmPhoto library is a set of API to access and manipulate the Photo
Application Database. But the photo application comming with the Zire 71
does not support API calls. As Laurens pointed out, it takes the version
comming with the T|T3 and T|E which is v.1.1.0.20

I was able to find a library named jcpalm that will allow me to compress my
RGB565 data into JPEG. That was my original goal.

Thanks anyway.

-- 
Regis St-Gelais
www.laubrass.com
--



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Any sample for PalmPhoto APIs ?

2004-01-26 Thread Colmerauer
Oops,sorry ! too much coffee today ...

Colmerauer


Regis St-Gelais [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]
dev-forum:

 PalmCameraLib and PalmPhoto are two completely different set of APIs..


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/