imjpeg.cpp File Reference

(r1785/r1758)

#include "camtypes.h"
#include "oilbitmap.h"
#include "bmpsrc.h"
#include "imjpeg.h"
#include "jpgsrc.h"
#include "jpgprgrs.h"
#include "jpgermgr.h"

Go to the source code of this file.

Classes

class  JPEGImportOptions
 Import options for the JPEG import filter. Allows a clean method of passing assorted parameters for the JPEG import filter. Specifically, that the calling class should give us a progress bar. Scope: public See Also: BitmapImportOptions. More...

Defines

#define new   CAM_DEBUG_NEW

Functions

ADDR FindBytes (ADDR pStart, UINT32 BufferSize, ADDR pBytes, UINT32 BytesSize)
 Finds BytesSize bytes starting at pBytes in pStart, which is BufferSize long Searches for a string of bytes Scope: static Notes: This should be put somewhere useful really. (Templates!!) It could also be more efficient if necessary.


Define Documentation

#define new   CAM_DEBUG_NEW
 

Definition at line 158 of file imjpeg.cpp.


Function Documentation

ADDR FindBytes (  ADDR  pStart,
UINT32  BufferSize,
ADDR  pBytes,
UINT32  BytesSize
) 
 

Finds BytesSize bytes starting at pBytes in pStart, which is BufferSize long Searches for a string of bytes Scope: static Notes: This should be put somewhere useful really. (Templates!!) It could also be more efficient if necessary.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96
Parameters:
pStart - The address of the first byte in memory from which to start [INPUTS] BufferSize - The size of the block starting at pStart pBytes : the start address of the block of bytes to search for BytesSize : The number of bytes in the block pointed to by pBytes
Returns:
The address of the first matching block of memory

Definition at line 279 of file imjpeg.cpp.

00280 {
00281     UINT32 BytesRemaining = BufferSize;
00282 
00283     ADDR pCurrentStart = pStart;
00284     while (BytesRemaining - BytesSize > 0)
00285     {
00286         ADDR pFirstFound = (ADDR)memchr(pCurrentStart, pBytes[0], BytesRemaining - BytesSize + 1);
00287         if (pFirstFound == NULL)
00288         {   
00289             return NULL;
00290         }
00291         if (memcmp(pFirstFound + 1, pBytes + 1, BytesSize - 1) == 0)
00292         {
00293             return pFirstFound;
00294         }
00295         pCurrentStart = pFirstFound + 1;
00296         BytesRemaining = BufferSize - (pCurrentStart - pStart);
00297     }
00298     return NULL;
00299 }


Generated on Sat Nov 10 03:49:11 2007 for Camelot by  doxygen 1.4.4