Instrument Neutral Distributed Interface INDI  1.9.5
jpegutils.h
Go to the documentation of this file.
1 /*
2  * jpegutils.h: Some Utility programs for dealing with
3  * JPEG encoded images
4  *
5  * Copyright (C) 1999 Rainer Johanni <Rainer@Johanni.de>
6  * Copyright (C) 2001 pHilipp Zabel <pzabel@gmx.de>
7  * Copyright (C) 2008 Angel Carpintero <ack@telenfonica.net>
8  *
9  */
10 
11 #pragma once
12 
13 #include <stddef.h>
14 #include <stdio.h>
15 #include <inttypes.h>
16 
35 
36 #define Y4M_ILACE_NONE 0
37 #define Y4M_ILACE_TOP_FIRST 1
38 #define Y4M_ILACE_BOTTOM_FIRST 2
39 #define Y4M_ILACE_MIXED 3
41 #define Y4M_CHROMA_420JPEG 0
42 #define Y4M_CHROMA_420MPEG2 1
43 #define Y4M_CHROMA_420PALDV 2
44 #define Y4M_CHROMA_444 3
45 #define Y4M_CHROMA_422 4
46 #define Y4M_CHROMA_411 5
47 #define Y4M_CHROMA_MONO 6
48 #define Y4M_CHROMA_444ALPHA 7
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
57 int decode_jpeg_raw(unsigned char *jpeg_data, int len, int itype, int ctype, unsigned int width, unsigned int height,
58  unsigned char *raw0, unsigned char *raw1, unsigned char *raw2);
59 
72 int decode_jpeg_rgb(unsigned char *inBuffer, unsigned long inSize, uint8_t **memptr, size_t *memsize, int *naxis, int *w, int *h);
76 int decode_jpeg_gray_raw(unsigned char *jpeg_data, int len, int itype, int ctype, unsigned int width,
77  unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2);
78 
82 int encode_jpeg_raw(unsigned char *jpeg_data, int len, int quality, int itype, int ctype, unsigned int width,
83  unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2);
84 #ifdef __cplusplus
85 }
86 #endif
87 
decode_jpeg_rgb
int decode_jpeg_rgb(unsigned char *inBuffer, unsigned long inSize, uint8_t **memptr, size_t *memsize, int *naxis, int *w, int *h)
decode_jpeg_rgb Read jpeg in memory buffer and produce RGB image
Definition: jpegutils.c:1309
decode_jpeg_gray_raw
int decode_jpeg_gray_raw(unsigned char *jpeg_data, int len, int itype, int ctype, unsigned int width, unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2)
decode JPEG raw gray buffer
Definition: jpegutils.c:837
encode_jpeg_raw
int encode_jpeg_raw(unsigned char *jpeg_data, int len, int quality, int itype, int ctype, unsigned int width, unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2)
encode raw JPEG buffer
Definition: jpegutils.c:1156
decode_jpeg_raw
int decode_jpeg_raw(unsigned char *jpeg_data, int len, int itype, int ctype, unsigned int width, unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2)
decode JPEG buffer
Definition: jpegutils.c:461