summaryrefslogtreecommitdiff
path: root/src/include/codec/img-codec-common.h
diff options
context:
space:
mode:
authorHaejeong Kim <backto.kim@samsung.com>2017-03-30 09:59:15 +0900
committerHaejeong Kim <backto.kim@samsung.com>2017-03-30 09:59:15 +0900
commitaee150adb2f1ea46f8ab3e1ee32896338bc811eb (patch)
tree5aff090d4422911a3c3647ca9044a0a41388ff36 /src/include/codec/img-codec-common.h
parentb309bbcdcb5dafd7c22dcd669b918117b25076b6 (diff)
downloadlibmedia-thumbnail-aee150adb2f1ea46f8ab3e1ee32896338bc811eb.tar.gz
libmedia-thumbnail-aee150adb2f1ea46f8ab3e1ee32896338bc811eb.tar.bz2
libmedia-thumbnail-aee150adb2f1ea46f8ab3e1ee32896338bc811eb.zip
Change-Id: I6951f5a5bf334838c9d17dba0edb03be10a30c96
Diffstat (limited to 'src/include/codec/img-codec-common.h')
-rwxr-xr-xsrc/include/codec/img-codec-common.h143
1 files changed, 66 insertions, 77 deletions
diff --git a/src/include/codec/img-codec-common.h b/src/include/codec/img-codec-common.h
index 91887f5..91c01b4 100755
--- a/src/include/codec/img-codec-common.h
+++ b/src/include/codec/img-codec-common.h
@@ -41,12 +41,12 @@ extern "C" {
#define ImgDebug(type, fmt, arg...) \
do { \
fprintf(stderr, "[Media-SVC]"fmt, ##arg); \
- }while(0)
+ } while (0)
#define SysRequireEx(expr, retValue) \
if (!(expr)) { \
- fprintf(stderr, "[Media-SVC][%s] INVALID_PARAM (%d lines in %s)\n",__FUNCTION__, __LINE__, __FILE__); \
+ fprintf(stderr, "[Media-SVC][%s] INVALID_PARAM (%d lines in %s)\n", __FUNCTION__, __LINE__, __FILE__); \
return (retValue); \
}
#define SysDebug(X) ImgDebug X
@@ -61,45 +61,40 @@ extern "C" {
//////////////////////////////////////////////////////////////
-typedef enum
-{
- IMG_INFO_DECODING_FAIL = 0,
- IMG_INFO_DECODING_SUCCESS = 1,
- IMG_INFO_AGIF_LAST_FRAME = 2,
- IMG_INFO_TOO_BIG_FILE_SIZE = -1,
- IMG_INFO_TOO_LARGE_SCALE = -2,
- IMG_INFO_TOO_BIG_PROGRESSIVE= -3,
- IMG_INFO_UNKNOWN_FORMAT = -4,
+typedef enum {
+ IMG_INFO_DECODING_FAIL = 0,
+ IMG_INFO_DECODING_SUCCESS = 1,
+ IMG_INFO_AGIF_LAST_FRAME = 2,
+ IMG_INFO_TOO_BIG_FILE_SIZE = -1,
+ IMG_INFO_TOO_LARGE_SCALE = -2,
+ IMG_INFO_TOO_BIG_PROGRESSIVE = -3,
+ IMG_INFO_UNKNOWN_FORMAT = -4,
IMG_INFO_FILE_ERR = -5,
IMG_INFO_MEM_ALLOC_FAIL = -6
-}ImgFastCodecInfo;
+} ImgFastCodecInfo;
-typedef enum inputFlag
-{
+typedef enum inputFlag {
IMG_RGB_888_OUTPUT = 0x0001,
IMG_RGB_OUTPUT = 0x0002,
IMG_YUV_OUTPUT = 0x0005
-}ImgInputFlag;
+} ImgInputFlag;
-typedef enum resize
-{
+typedef enum resize {
/* During resizing aspect ratio will be maintained */
IMG_RESIZE_MAINTAIN_ASPECT_RATIO = 0x0001,
IMG_RESIZE = 0x0002
} ImgResizeInput;
-typedef struct tagImgImageInfo
-{
+typedef struct tagImgImageInfo {
unsigned int width;
unsigned int height;
- unsigned int numberOfFrame;
+ unsigned int numberOfFrame;
unsigned int delay; //deprecated.
unsigned int bOrientation; //deprecated.
-}ImgImageInfo;
+} ImgImageInfo;
-typedef struct tagImgBitmap
-{
+typedef struct tagImgBitmap {
int width;
int height;
UCHAR bitsPerPixel; /* For TIF it should be 8 or 4 or 1 always
@@ -110,14 +105,14 @@ typedef struct tagImgBitmap
*/
void *pBits;
- BOOL bChromaKeyFlag; /* Flag to indicate chroma key
+ BOOL bChromaKeyFlag; /* Flag to indicate chroma key
* Default: FALSE
*/
ULONG chromaKey; /* This is the colour which needs to be (or is) transparent.
* This colour will be in 5, 5, 5 RGB format as below.
* First 16 MS Bits 0, R (5), G (5), 0 (1), B (5)
*/
- UCHAR disposal; /* Disposal action to take during
+ UCHAR disposal; /* Disposal action to take during
* display of current flag
* Default: 0
*/
@@ -128,19 +123,18 @@ typedef struct tagImgBitmap
* Default: FALSE
*/
- BOOL interlace; /* Interlace indicator flag
- * Default: FALSE
- */
- BYTE *pLocalColorMap;/* Local color palette pointer
- * Default: NULL
- */
- /* For TIF :Should be given if PALETTE color type.
- */
- USHORT localColorMapSize;
- /* Local color palette size */
- /* In TIF: Should be given if PALETTE color type.
- */
- void *pAlphaChannel; /* An alpha channel, representing transparency
+ BOOL interlace; /* Interlace indicator flag
+ * Default: FALSE
+ */
+ BYTE *pLocalColorMap; /* Local color palette pointer
+ * Default: NULL
+ */
+ /* For TIF :Should be given if PALETTE color type.
+ */
+ USHORT localColorMapSize; /* Local color palette size */
+ /* In TIF: Should be given if PALETTE color type.
+ */
+ void *pAlphaChannel; /* An alpha channel, representing transparency
* information on a per-pixel basis
*/
BYTE colorType ; /* Indicates the color type of image. It can be
@@ -155,12 +149,12 @@ typedef struct tagImgBitmap
BYTE filter ; /* Type of filter to apply. Could be one of NONE,
* SUB, UP, AVERAGE or PAETH
*/
- BYTE compressionMethod ; /* Type of compression in zLib to apply. Could be
- * one of NONE, FIXED or DYANMIC
- */
- /* For TIF : IT could be TIF_COMP_NOCOMP ,
- * TIF_COMP_PACKBIT or TIF_COMP_HUFFMAN (only for bilevel)
- */
+ BYTE compressionMethod; /* Type of compression in zLib to apply. Could be
+ * one of NONE, FIXED or DYANMIC
+ */
+ /* For TIF : IT could be TIF_COMP_NOCOMP ,
+ * TIF_COMP_PACKBIT or TIF_COMP_HUFFMAN (only for bilevel)
+ */
UCHAR colorConversion; /* Indicates whether color conversion has to
* be done or not
@@ -181,61 +175,56 @@ typedef struct tagImgBitmap
*/
} ImgBitmap;
-typedef struct tagImgCodecColor
-{
+typedef struct tagImgCodecColor {
UINT16 red;
UINT16 green;
UINT16 blue;
} ImgCodecColor;
+typedef struct {
+ int width, height, bpp;
-typedef struct
-{
- int width, height, bpp;
-
- BOOL tRNSFlag;
- ImgCodecColor tRNSColor;
+ BOOL tRNSFlag;
+ ImgCodecColor tRNSColor;
- BOOL bKGDFlag;
- ImgCodecColor bKGDColor;
+ BOOL bKGDFlag;
+ ImgCodecColor bKGDColor;
- BOOL AlphaChannelFlag;
- unsigned short *pAlphaChannel;
+ BOOL AlphaChannelFlag;
+ unsigned short *pAlphaChannel;
} ImgTrnsInfo;
typedef struct tagImgBitmapElem ImgBitmapElem;
-struct tagImgBitmapElem
-{
+struct tagImgBitmapElem {
int x;
int y;
ImgBitmap *pbmBitmap;
ImgBitmapElem *pNext;
};
-typedef struct gifDecode ImgGIFFrame ;
+typedef struct gifDecode ImgGIFFrame;
-typedef struct tagImgImage
-{
- int dataSize; /* Holds the total number of bytes required
- * to hold the image
- */
- int width;
- int height;
+typedef struct tagImgImage {
+ int dataSize; /* Holds the total number of bytes required
+ * to hold the image
+ */
+ int width;
+ int height;
- USHORT flag; /* This contains flags as defined
- * in ImgCodecFlagType
- */
- ULONG backGroundColor; /* The backgroundColor specifies a default background
- * color to present the image against.
- * Note that viewers are not bound to honor this color.
- * A viewer can choose to use a different background.
- */
- BYTE *pGlobalColorMap; /* Global color palette pointer
+ USHORT flag; /* This contains flags as defined
+ * in ImgCodecFlagType
+ */
+ ULONG backGroundColor; /* The backgroundColor specifies a default background
+ * color to present the image against.
+ * Note that viewers are not bound to honor this color.
+ * A viewer can choose to use a different background.
+ */
+ BYTE *pGlobalColorMap; /* Global color palette pointer
* Default: NULL
*/
- USHORT globalColorMapSize; /* Local color palette size */
- ULONG gamma; /* The value is encoded as a 4-byte unsigned integer,
+ USHORT globalColorMapSize; /* Local color palette size */
+ ULONG gamma; /* The value is encoded as a 4-byte unsigned integer,
* representing gamma times 100000. For example, a
* gamma of 0.45 would be stored as the integer 45000.
*/