Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | #ifndef __JPEGDECODER_H__ |
2 | #define __JPEGDECODER_H__ |
||
3 | |||
4 | /****************************************************************************** |
||
5 | * FileName: JpegDecoder.h |
||
6 | * Dependencies: Image decoding library; project requires File System library |
||
7 | * Processor: PIC24/dsPIC30/dsPIC33/PIC32MX |
||
8 | * Compiler: C30 v2.01/C32 v0.00.18 |
||
9 | * Company: Microchip Technology, Inc. |
||
10 | |||
11 | * Software License Agreement |
||
12 | * |
||
13 | * Copyright © 2008 Microchip Technology Inc. All rights reserved. |
||
14 | * Microchip licenses to you the right to use, modify, copy and distribute |
||
15 | * Software only when embedded on a Microchip microcontroller or digital |
||
16 | * signal controller, which is integrated into your product or third party |
||
17 | * product (pursuant to the sublicense terms in the accompanying license |
||
18 | * agreement). |
||
19 | * |
||
20 | * You should refer to the license agreement accompanying this Software |
||
21 | * for additional information regarding your rights and obligations. |
||
22 | * |
||
23 | * SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY |
||
24 | * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY |
||
25 | * OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR |
||
26 | * PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR |
||
27 | * OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, |
||
28 | * BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT |
||
29 | * DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, |
||
30 | * INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, |
||
31 | * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY |
||
32 | * CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), |
||
33 | * OR OTHER SIMILAR COSTS. |
||
34 | |||
35 | Author Date Comments |
||
36 | -------------------------------------------------------------------------------- |
||
37 | Pradeep Budagutta 03-Mar-2008 First release |
||
38 | *******************************************************************************/ |
||
39 | |||
40 | #define JPEG_SendError(x) pJpegDecoder->bError = x; return(x); /* Point to proper error handler routine */ |
||
41 | |||
42 | #define MAX_CHANNELS 3 /* This supports only Grayscale and YCbCr images - DONT CHANGE THIS */ |
||
43 | #define MAX_BLOCKS 6 /* To decode one logical block, we have to decode 1 to 6 blocks depending on channels and subsampling - DONT REDUCE THIS */ |
||
44 | #define MAX_HUFF_TABLES 2 /* Each causes 2 tables -> One for AC and another for DC - DONT REDUCE THIS */ |
||
45 | #define MAX_DATA_BUF_LEN 128 /* Increase if you have more data memory */ |
||
46 | |||
47 | /* Error list */ |
||
48 | enum Errors |
||
49 | { |
||
50 | IMAGE_FILE_NOT_AVAILABLE |
||
51 | }; |
||
52 | |||
53 | /* JPEG Markers list */ |
||
54 | enum Markers |
||
55 | { |
||
56 | SOF0 = 0xC0, |
||
57 | DHT = 0xC4, |
||
58 | SOI = 0xD8, |
||
59 | EOI = 0xD9, |
||
60 | SOS = 0xDA, |
||
61 | DQT = 0xDB, |
||
62 | DRI = 0xDD, |
||
63 | APP0 = 0xE0, |
||
64 | COM = 0xFE, |
||
65 | /* The below markers doesn't have parameters */ |
||
66 | TEM = 0x01, |
||
67 | RST0 = 0xD0, |
||
68 | RST1 = 0xD1, |
||
69 | RST2 = 0xD2, |
||
70 | RST3 = 0xD3, |
||
71 | RST4 = 0xD4, |
||
72 | RST5 = 0xD5, |
||
73 | RST6 = 0xD6, |
||
74 | RST7 = 0xD7 |
||
75 | }; |
||
76 | |||
77 | /* Function prototype */ |
||
78 | /* This function must be called after setting proper values in the global variables of ImageDecoder.c */ |
||
79 | BYTE JPEG_bDecode(IMG_FILE *pfile, BOOL bFirstTime); |
||
80 | |||
81 | #endif |
Powered by WebSVN v2.8.3