[Y-devel] Tast List

Keith Jeffery jeff2619 at uidaho.edu
Sun Feb 22 20:07:09 GMT 2004


James Harr wrote:

>From what I see there's 3 ways of supporting image formats.
>1. Have the client convert it before passing it to the API.
>2. Have the client's API convert it to bitmap before passing it to the server.
>3. Have the server convert/interpret the image natively.
>
>#1: Pros
>The server/client doesn't have to worry about the format. Don't have to worry 
>about older Y servers not supporting an image format.
>#1: Cons
>Bandwidth issues over slow connections, adds burdon on the end programmer.
>  
>

Ideally, I'd like to see this (mostly) transparent to the end 
programmer, meaning, I don't think he/she should have to write an image 
converter within his/her program.  I'm not down with this solution :).

>#2: Pros
>Don't have to worry about older Y servers not supporting an image format. 
>Programmer doesn't have to convert image before passing it to the api.
>#2: Cons
>Bandwidth issues again. The client API might be compiled with out an image 
>format breaking some applications.
>  
>

Trying to come up with a good way to pass images is failing me.  They're 
just too bulky!  Bitmap is too bulky, but easy to handle.  When I deal 
with images in my applications, it doesn't really matter what the input 
and output format is, internally they're usually a 2D array of RGB(A) 
samples.  And, usually, I put these into something like

struct pixel {
    short r, g, b, a;
};

Even though that's not necessary.  All you really need now for this 
format is the width and the height of the image.  This is very much like 
a bitmap format without all of the extra header information, and without 
color tables.  Since my thesis work is in raytracing, I never deal with 
fewer than 24-bit images anyway, so this may not be practical for this 
application.  If the client API converts the image to some internal 
format (as described above), perhaps it wouldn't be too time consuming 
to run the "deflate" algorithm on it or something.  I am, however, no 
compression expert.  If we use some type of interal format, we shouldn't 
have to worry so much about formats that the server and client support.

>#3: Pros
>Lots of bandwidth is saved. Programmers don't have to worry about converting 
>(simpler code).
>#3: Cons
>If you're connecting to an older Y, or one compiled to not support an image 
>format, the application will essentially be broken.
>
>There's another option which I like, but might be a bit messy. It combines 2 & 
>3. The API would message the server asking if it supports a specific image 
>format, if ti does, send it as that format. If not, the client API will 
>change it to a format that is supported. Some lossless format, bitmap would 
>be very bandwidth intensive, however a png would take a lot of CPU to convert 
>if it's big.
>  
>
>Comments/Ideas?
>
>Thanks,
>James Harr
>
>  
>




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved