iflFormat questions - SGI

This is a discussion on iflFormat questions - SGI ; Hi all, I'm trying to implement support for an image format (8 bit per pixel). I've started on the iflFormat part, but for it to work I have to implement a set of virtual functions. Unfortunately the man page for ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: iflFormat questions

  1. iflFormat questions

    Hi all,

    I'm trying to implement support for an image format (8 bit per pixel).
    I've started on the iflFormat part, but for it to work I have to implement a
    set of virtual functions. Unfortunately the man page for iflFormat is a bit
    sparse with describing the functions I need to implement.

    For example for typeIsSupported it says this:

    >virtual int typeIsSupported(iflDataType type)
    >
    >This virtual member function tells whether the given data type is
    >supported by the image file format.


    Now I don't know what exactly the type represents, so I have no idea what to do
    with this function.

    Is there a more detailed explanation of what I have to do with these kind of
    functions ?

    The OS is Irix 6.5.17m

    Thanks for any help,

    Mark Hellegers


  2. Re: iflFormat questions

    In article <3f0f4f7c$0$49103$e4fe514c@news.xs4all.nl>,
    Mark Hellegers writes:
    > Hi all,
    > I'm trying to implement support for an image format (8 bit per pixel).
    > I've started on the iflFormat part, but for it to work I have to implement a
    > set of virtual functions. Unfortunately the man page for iflFormat is a bit
    > sparse with describing the functions I need to implement.
    > For example for typeIsSupported it says this:
    >>virtual int typeIsSupported(iflDataType type)
    >>
    >>This virtual member function tells whether the given data type is
    >>supported by the image file format.

    > Now I don't know what exactly the type represents, so I have no idea what to do
    > with this function.
    > Is there a more detailed explanation of what I have to do with these kind of
    > functions ?
    > The OS is Irix 6.5.17m
    > Thanks for any help,
    > Mark Hellegers


    well, how can the compiler know then, that that what you specified
    isn't right ? ;-) --- quite simple: from the headers ;-)

    /usr/include/ifl/iflTypes.h: search for 'enum iflDataType'
    (as publication of the file or parts is not allowed :-) )

    Reading header files is often more enlighting than man-pages :-)

    wolfgang

  3. Re: iflFormat questions

    You probably already know this, but if you installed ifl_dev.sw.gifts
    then you can find some examples of how to implement support for a new
    image format in /usr/share/src/ifl/src (source for FIT, JFIF, PNG, RAW
    and TIFF is included).

    Ralph


    Mark Hellegers wrote:

    > Hi all,
    >
    > I'm trying to implement support for an image format (8 bit per pixel).
    > I've started on the iflFormat part, but for it to work I have to
    > implement a set of virtual functions. Unfortunately the man page for
    > iflFormat is a bit sparse with describing the functions I need to
    > implement.
    >
    > For example for typeIsSupported it says this:
    >
    > >virtual int typeIsSupported(iflDataType type)
    > >
    > >This virtual member function tells whether the given data type is
    > >supported by the image file format.

    >
    > Now I don't know what exactly the type represents, so I have no idea
    > what to do with this function.
    >
    > Is there a more detailed explanation of what I have to do with these
    > kind of functions ?
    >
    > The OS is Irix 6.5.17m
    >
    > Thanks for any help,
    >
    > Mark Hellegers
    >




  4. Re: iflFormat questions

    In message , Wolfgang Szoecs wrote:
    > In article <3f0f4f7c$0$49103$e4fe514c@news.xs4all.nl>,
    > Mark Hellegers writes:
    > > Is there a more detailed explanation of what I have to do with these kind
    > > of
    > > functions ?
    > > The OS is Irix 6.5.17m
    > > Thanks for any help,
    > > Mark Hellegers

    >
    > well, how can the compiler know then, that that what you specified
    > isn't right ? ;-) --- quite simple: from the headers ;-)
    >
    > /usr/include/ifl/iflTypes.h: search for 'enum iflDataType'
    > (as publication of the file or parts is not allowed :-) )


    Ok, I've looked at the headers (damn, how did you end up with such a license)
    and it is a bit clearer now, but still a bit vague if you've only seen this for
    the first time. I'm going to implement the functions and see what imgview says
    when I'm trying to load an image and go from there.

    > Reading header files is often more enlighting than man-pages :-)


    Could be, but I prefer real documentation.
    Btw, there is a little mistake in the man page of iflFormat. The header file
    location is missing one letter.

    Thanks for the pointer,

    Mark


  5. Re: iflFormat questions

    In message <20030713033039.72fec833.ralpht@sgi.com>, Ralph Thomas wrote:
    > You probably already know this, but if you installed ifl_dev.sw.gifts
    > then you can find some examples of how to implement support for a new
    > image format in /usr/share/src/ifl/src (source for FIT, JFIF, PNG, RAW
    > and TIFF is included).


    Yes, I have looked at them.
    Unfortunately, they are a bit short on comments.
    I was hoping there would be a summary of the features of an image format and
    what functions this would affect and how. If that makes any sense.

    Mark


  6. Re: iflFormat questions

    In message <3f0f4f7c$0$49103$e4fe514c@news.xs4all.nl>, Mark Hellegers wrote:
    > Hi all,
    >
    > I'm trying to implement support for an image format (8 bit per pixel).
    > I've started on the iflFormat part, but for it to work I have to implement a
    > set of virtual functions. Unfortunately the man page for iflFormat is a bit
    > sparse with describing the functions I need to implement.
    >


    I got a bit further now and I've got it working to where my openFile function
    from the iflFile class is called. What should I do here exactly ? The source
    code examples are a bit hard to read as documentation and the man pages say
    very little about what I should do with this.

    Thanks for any help,

    Mark


  7. Re: iflFormat questions

    Mark Hellegers wrote:

    >In message <3f12f673$0$49101$e4fe514c@news.xs4all.nl>, Mark Hellegers wrote:
    >
    >
    >>In message <3f0f4f7c$0$49103$e4fe514c@news.xs4all.nl>, Mark Hellegers wrote:
    >>
    >>
    >>>Hi all,
    >>>
    >>>I'm trying to implement support for an image format (8 bit per pixel).
    >>>I've started on the iflFormat part, but for it to work I have to
    >>>
    >>>

    >>implement a
    >>
    >>
    >>>set of virtual functions. Unfortunately the man page for iflFormat is a
    >>>
    >>>

    >>bit
    >>
    >>
    >>>sparse with describing the functions I need to implement.
    >>>
    >>>
    >>>

    >>I got a bit further now and I've got it working to where my openFile
    >>function
    >>from the iflFile class is called. What should I do here exactly ? The source
    >>code examples are a bit hard to read as documentation and the man pages say
    >>very little about what I should do with this.
    >>
    >>

    >
    >Replying to myself again, I know.
    >I've fiddled a bit more with the code and I've figured out that you have to set
    >some values that already exist in the class.
    >While I don't really understand yet what values to fill in, I've managed to get
    >imgview to display a black square. Hurray.
    >I've also figured out that I now have to implement getPage.
    >Does anyone know what a page is and what the c and z variables (in the function
    >call) represent, ?
    >
    >Thanks for any help,
    >


    Hi,

    I sugget you have a look at the ImageVision Library Programming Guide, esp.
    "Appendix E: Implementing you own image file format".

    Let me know if this does not help you,

    -Phil
    --
    Philippe C.D. Robert | VNET# 559-1565
    Core Rendering | Office: +41 (0)32 732 15 65
    Silicon Graphics, Inc. | Home: +41 (0)31 302 45 22




  8. Re: iflFormat questions

    "Philippe C.D. Robert" wrote:
    >
    > Mark Hellegers wrote:
    > >Replying to myself again, I know.
    > >I've fiddled a bit more with the code and I've figured out that you have to set
    > >some values that already exist in the class.
    > >While I don't really understand yet what values to fill in, I've managed to get
    > >imgview to display a black square. Hurray.
    > >I've also figured out that I now have to implement getPage.
    > >Does anyone know what a page is and what the c and z variables (in the function
    > >call) represent, ?
    > >
    > >Thanks for any help,
    > >

    >
    > Hi,
    >
    > I sugget you have a look at the ImageVision Library Programming Guide, esp.
    > "Appendix E: Implementing you own image file format".
    >
    > Let me know if this does not help you,


    Ok, that made a bit clearer again. I've now implemented the getPage
    function, but I'm still getting a black square. I think I have to
    implement the getColormap function as well and I have tried to fill in
    the colormap a bit, but I still get a black square.

    I'm setting these values when I open the file:

    size = iflSize( width, height, 1, 1 );
    pageSize = iflSize( width, height, 1, 1 );
    cm = iflRGBPalette;
    dtype = iflUChar;
    order = iflSequential;
    orientation = iflUpperLeftOrigin;
    compression = iflNoCompression;

    and I'm writing the unsigned chars into the void * data buffer from
    getPage.

    The file format is a standard RLE type format. What do I have to change
    to have something else than a black square on the screen ?

    Mark

+ Reply to Thread