J
jimgardener
hi
i am trying to reproduce this following function in java
in c i have a function tiffwrite_head() as below
____________________________________________
static unsigned long int lastifd ;//is ouside the function
static struct IFD ifd =
{
.......//some fields initialised
};
struct IFD * tiffwrite_head (FILE *outfile)
{
struct
{
unsigned short int order_id ;
unsigned short int tiff_id ;
unsigned long int first_ifd ;
} header ;
header.tiff_id=42 ;
if ((char)header.tiff_id==42) header.order_id=0x4949 ;
else header.order_id=0x4D4D ;
rewind (outfile) ;
header.first_ifd=0 ;
ifd.StripOffsets.value=8 ;
ifd.ImageLength.value=0 ;
lastifd=4 ;
if ((fwrite (&header,1,sizeof(header),outfile))!=8) return (NULL) ;
return (&ifd) ;
}
___________________________________________________
I would like to know if it is possible to reproduce this above
function in java .can someone help?
jim
Also IFD is =>
struct IFD
{
unsigned short int ifd_count ;
struct IFDENTRY NewSubfileType ;
struct IFDENTRY ImageWidth ;
struct IFDENTRY ImageLength ;
struct IFDENTRY BitsPerSample ;
struct IFDENTRY Compression ;
struct IFDENTRY PhotometricInterpretation ;
struct IFDENTRY FillOrder ;
struct IFDENTRY StripOffsets ;
struct IFDENTRY SamplesPerPixel ;
struct IFDENTRY RowsPerStrip ;
struct IFDENTRY StripByteCounts ;
struct IFDENTRY Xresolution ;
struct IFDENTRY Yresolution ;
struct IFDENTRY T4Options ;
struct IFDENTRY ResolutionUnit ;
struct IFDENTRY PageNumber ;
unsigned long int nextifd ;
unsigned long int Xres[2] ;
unsigned long int Yres[2] ;
} ;
struct IFDENTRY
{
unsigned short int tag ;
unsigned short int type ;
unsigned long int count ;
unsigned long int value ;
} ;
i am trying to reproduce this following function in java
in c i have a function tiffwrite_head() as below
____________________________________________
static unsigned long int lastifd ;//is ouside the function
static struct IFD ifd =
{
.......//some fields initialised
};
struct IFD * tiffwrite_head (FILE *outfile)
{
struct
{
unsigned short int order_id ;
unsigned short int tiff_id ;
unsigned long int first_ifd ;
} header ;
header.tiff_id=42 ;
if ((char)header.tiff_id==42) header.order_id=0x4949 ;
else header.order_id=0x4D4D ;
rewind (outfile) ;
header.first_ifd=0 ;
ifd.StripOffsets.value=8 ;
ifd.ImageLength.value=0 ;
lastifd=4 ;
if ((fwrite (&header,1,sizeof(header),outfile))!=8) return (NULL) ;
return (&ifd) ;
}
___________________________________________________
I would like to know if it is possible to reproduce this above
function in java .can someone help?
jim
Also IFD is =>
struct IFD
{
unsigned short int ifd_count ;
struct IFDENTRY NewSubfileType ;
struct IFDENTRY ImageWidth ;
struct IFDENTRY ImageLength ;
struct IFDENTRY BitsPerSample ;
struct IFDENTRY Compression ;
struct IFDENTRY PhotometricInterpretation ;
struct IFDENTRY FillOrder ;
struct IFDENTRY StripOffsets ;
struct IFDENTRY SamplesPerPixel ;
struct IFDENTRY RowsPerStrip ;
struct IFDENTRY StripByteCounts ;
struct IFDENTRY Xresolution ;
struct IFDENTRY Yresolution ;
struct IFDENTRY T4Options ;
struct IFDENTRY ResolutionUnit ;
struct IFDENTRY PageNumber ;
unsigned long int nextifd ;
unsigned long int Xres[2] ;
unsigned long int Yres[2] ;
} ;
struct IFDENTRY
{
unsigned short int tag ;
unsigned short int type ;
unsigned long int count ;
unsigned long int value ;
} ;