AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
April 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



2005.04.02 07:49 "Atternative to read, write, seek, close, sizeof processes", by Katrina Maramba

Hello,
 
I am looking for an alternative to the 5 processes Ive listed above.
 
In the TIFF library, it uses the file operations fread, fwrite, etc.  In my
program, I want to use this processes not on a file but on a data buffer.  
 
Below is my alternative function:
 
static tsize_t tiffReadProccess(thandle_t pInputData, tdata_t pBufRet,
tsize_t size)
{
    Byte4Type ctr;
    ByteType abArray[8];
    ByteType abTemp[8];
    ByteType*   pbPtr;
    ByteType*   pbTempPtr;
 
    pbTempPtr = (ByteType*)malloc(sizeof(ByteType) * size);
    pBufRet = (ByteType*)malloc(sizeof(ByteType) * size);
    pbPtr = (ByteType*)pInputData;
 
    memcpy(pbTempPtr, pbPtr, sizeof(ByteType) * size);
    memcpy(pBufRet, pbTempPtr, sizeof(ByteType) * size);

    return(size);

}

Unfortunately, this doesnt work.  The buffer returned only has the value
ccccccc.  I dont know what this means.  I also got earlier problems that
states that pBufRet has an unknown size.  I think this is because its
variable type is a void pointer.  
 
Please help.  I am very new to image processing.  Any help will be deeply
appreciated.  Thank you.