⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ijl.h

📁 RPG四大编辑器:场景/道具/角色/地图四大编辑器源代码 vc++ 6.0
💻 H
📖 第 1 页 / 共 4 页
字号:
/*M*
//
//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 1998 Intel Corporation. All Rights Reserved.
//
//
//  File:
//    ijl.h
//
//  Purpose:
//    IJL Common Header File
//    This file contains:  definitions for data types, data
//    structures, error codes, and function prototypes used
//    in the Intel(R) JPEG Library (IJL).
//
//  Version:
//    1.5
//
*M*/

#ifndef __IJL_H__
#define __IJL_H__


#if defined( __cplusplus )
extern "C" {
#endif


#ifndef IJL_ALL_WARNINGS

#if _MSC_VER >= 1000

/* nonstandard extension used : nameless struct/union          */
#pragma warning(disable : 4201)
/* nonstandard extension used : bit field types other than int */
#pragma warning(disable : 4214)
/* unreferenced inline function has been removed               */
#pragma warning(disable : 4514)
/* named type definition in parentheses                        */
#pragma warning(disable : 4115)

#endif /* _MSC_VER >= 1000 */

#endif /* IJL_ALL_WARNINGS */


#define IJL_STDCALL __stdcall


/* align struct on 8 bytes boundary */
#pragma pack (8)


/* /////////////////////////////////////////////////////////////////////////
// Macros/Constants */

/* Size of file I/O buffer (4K). */
#define JBUFSIZE    4096


#define IJL_INT64  __int64
#define IJL_UINT64 unsigned IJL_INT64


#ifndef IJLAPI
  #ifdef IJL_MSEXPORTS
    #define IJLAPI(type,name,arg) \
      extern __declspec(dllimport) type IJL_STDCALL name arg
  #else
    #define IJLAPI(type,name,arg) \
      extern type IJL_STDCALL name arg
  #endif
#endif



#define IJL_DIB_ALIGN (sizeof(int) - 1)

#define IJL_DIB_UWIDTH(width,nchannels) \
  ((width) * (nchannels))

#define IJL_DIB_AWIDTH(width,nchannels) \
  ( ((IJL_DIB_UWIDTH(width,nchannels) + IJL_DIB_ALIGN) & (~IJL_DIB_ALIGN)) )

#define IJL_DIB_PAD_BYTES(width,nchannels) \
  ( IJL_DIB_AWIDTH(width,nchannels) - IJL_DIB_UWIDTH(width,nchannels) )


#define IJL_DIB_SCALE_SIZE(jpgsize,scale) \
  ( ((jpgsize) + (scale) - 1) / (scale) )




/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJLibVersion
//
// Purpose:     Stores library version info.
//
// Context:
//
// Example:
//   major           - 1
//   minor           - 0
//   build           - 1
//   Name            - "ijl10.dll"
//   Version         - "1.0.1 Beta1"
//   InternalVersion - "1.0.1.1"
//   BuildDate       - "Sep 22 1998"
//   CallConv        - "DLL"
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef struct _IJLibVersion
{
  int         major;
  int         minor;
  int         build;
  const char* Name;
  const char* Version;
  const char* InternalVersion;
  const char* BuildDate;
  const char* CallConv;

} IJLibVersion;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJL_RECT
//
// Purpose:     Keep coordinates for rectangle region of image
//
// Context:     Used to specify roi
//
// Fields:
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef struct _IJL_RECT
{
  long  left;
  long  top;
  long  right;
  long  bottom;

} IJL_RECT;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJL_HANDLE
//
// Purpose:     file handle
//
// Context:     used internally
//
// Fields:
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef void* IJL_HANDLE;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJLIOTYPE
//
// Purpose:     Possible types of data read/write/other operations to be
//              performed by the functions IJL_Read and IJL_Write.
//
//              See the Developer's Guide for details on appropriate usage.
//
// Fields:
//
//  IJL_JFILE_XXXXXXX   Indicates JPEG data in a stdio file.
//
//  IJL_JBUFF_XXXXXXX   Indicates JPEG data in an addressable buffer.
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef enum _IJLIOTYPE
{
  IJL_SETUP                   = -1,


  /* Read JPEG parameters (i.e., height, width, channels, sampling, etc.) */
  /* from a JPEG bit stream. */
  IJL_JFILE_READPARAMS        =  0,
  IJL_JBUFF_READPARAMS        =  1,

  /* Read a JPEG Interchange Format image. */
  IJL_JFILE_READWHOLEIMAGE    =  2,
  IJL_JBUFF_READWHOLEIMAGE    =  3,

  /* Read JPEG tables from a JPEG Abbreviated Format bit stream. */
  IJL_JFILE_READHEADER        =  4,
  IJL_JBUFF_READHEADER        =  5,

  /* Read image info from a JPEG Abbreviated Format bit stream. */
  IJL_JFILE_READENTROPY       =  6,
  IJL_JBUFF_READENTROPY       =  7,

  /* Write an entire JFIF bit stream. */
  IJL_JFILE_WRITEWHOLEIMAGE   =  8,
  IJL_JBUFF_WRITEWHOLEIMAGE   =  9,

  /* Write a JPEG Abbreviated Format bit stream. */
  IJL_JFILE_WRITEHEADER       = 10,
  IJL_JBUFF_WRITEHEADER       = 11,

  /* Write image info to a JPEG Abbreviated Format bit stream. */
  IJL_JFILE_WRITEENTROPY      = 12,
  IJL_JBUFF_WRITEENTROPY      = 13,


  /* Scaled Decoding Options: */

  /* Reads a JPEG image scaled to 1/2 size. */
  IJL_JFILE_READONEHALF       = 14,
  IJL_JBUFF_READONEHALF       = 15,

  /* Reads a JPEG image scaled to 1/4 size. */
  IJL_JFILE_READONEQUARTER    = 16,
  IJL_JBUFF_READONEQUARTER    = 17,

  /* Reads a JPEG image scaled to 1/8 size. */
  IJL_JFILE_READONEEIGHTH     = 18,
  IJL_JBUFF_READONEEIGHTH     = 19,

  /* Reads an embedded thumbnail from a JFIF bit stream. */
  IJL_JFILE_READTHUMBNAIL     = 20,
  IJL_JBUFF_READTHUMBNAIL     = 21

} IJLIOTYPE;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJL_COLOR
//
// Purpose:     Possible color space formats.
//
//              Note these formats do *not* necessarily denote
//              the number of channels in the color space.
//              There exists separate "channel" fields in the
//              JPEG_CORE_PROPERTIES data structure specifically
//              for indicating the number of channels in the
//              JPEG and/or DIB color spaces.
//
//              See the Developer's Guide for details on appropriate usage.
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef enum _IJL_COLOR
{
  IJL_RGB         = 1,    /* Red-Green-Blue color space. */
  IJL_BGR         = 2,    /* Reversed channel ordering from IJL_RGB. */
  IJL_YCBCR       = 3,    /* Luminance-Chrominance color space as defined */
                          /* by CCIR Recommendation 601. */
  IJL_G           = 4,    /* Grayscale color space. */
  IJL_RGBA_FPX    = 5,    /* FlashPix RGB 4 channel color space that */
                          /* has pre-multiplied opacity. */
  IJL_YCBCRA_FPX  = 6,    /* FlashPix YCbCr 4 channel color space that */
                          /* has pre-multiplied opacity. */

  IJL_OTHER       = 255   /* Some other color space not defined by the IJL. */
                          /* (This means no color space conversion will */
                          /* be done by the IJL.) */

} IJL_COLOR;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJL_JPGSUBSAMPLING
//
// Purpose:     Possible subsampling formats used in the JPEG.
//
//              See the Developer's Guide for details on appropriate usage.
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef enum _IJL_JPGSUBSAMPLING
{
  IJL_NONE    = 0,    /* Corresponds to "No Subsampling". */
                      /* Valid on a JPEG w/ any number of channels. */
  IJL_411     = 1,    /* Valid on a JPEG w/ 3 channels. */
  IJL_422     = 2,    /* Valid on a JPEG w/ 3 channels. */

  IJL_4114    = 3,    /* Valid on a JPEG w/ 4 channels. */
  IJL_4224    = 4     /* Valid on a JPEG w/ 4 channels. */

} IJL_JPGSUBSAMPLING;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        IJL_DIBSUBSAMPLING
//
// Purpose:     Possible subsampling formats used in the DIB.
//
//              See the Developer's Guide for details on appropriate usage.
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef IJL_JPGSUBSAMPLING IJL_DIBSUBSAMPLING;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        HUFFMAN_TABLE
//
// Purpose:     Stores Huffman table information in a fast-to-use format.
//
// Context:     Used by Huffman encoder/decoder to access Huffman table
//              data.  Raw Huffman tables are formatted to fit this
//              structure prior to use.
//
// Fields:
//  huff_class  0 == DC Huffman or lossless table, 1 == AC table.
//  ident       Huffman table identifier, 0-3 valid (Extended Baseline).
//  huffelem    Huffman elements for codes <= 8 bits long;
//              contains both zero run-length and symbol length in bits.
//  huffval     Huffman values for codes 9-16 bits in length.
//  mincode     Smallest Huffman code of length n.
//  maxcode     Largest Huffman code of length n.
//  valptr      Starting index into huffval[] for symbols of length k.
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef struct _HUFFMAN_TABLE
{
  int             huff_class;
  int             ident;
  unsigned int    huffelem[256];
  unsigned short  huffval[256];
  unsigned short  mincode[17];
  short           maxcode[18];
  unsigned short  valptr[17];

} HUFFMAN_TABLE;


/*D*
////////////////////////////////////////////////////////////////////////////
// Name:        JPEGHuffTable
//
// Purpose:     Stores pointers to JPEG-binary spec compliant
//              Huffman table information.
//
// Context:     Used by interface and table methods to specify encoder
//              tables to generate and store JPEG images.
//
// Fields:
//  bits        Points to number of codes of length i (<=16 supported).
//  vals        Value associated with each Huffman code.
//  hclass      0 == DC table, 1 == AC table.
//  ident       Specifies the identifier for this table.
//              0-3 for extended JPEG compliance.
//
////////////////////////////////////////////////////////////////////////////
*D*/

typedef struct _JPEGHuffTable

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -