📄 upimage.h
字号:
/**
* $File: //depot/dp/shibumi/1.X/src/magellan/src/include/framework/public/device/upimage.h $
*
* Copyright (c) 1995-2003 Openwave Systems Inc. All rights reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Openwave Systems Inc.
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
*
* \file : $Id: //depot/dp/shibumi/1.X/src/magellan/src/include/framework/public/device/upimage.h#10 $
* \author : $Author: cpayne $
* \date : $DateTime: 2003/09/25 01:47:02 $
*/
#ifdef OP_DEFINE_HEADER_REVISION
#define upimage_REVISION "upimage$Revision: #10 $"
#else
#ifndef upimage_DEFINED
#define upimage_DEFINED
/*
* upimage.h - This file contains the definition of the default internal
* image format.
*/
/*
** Tucson's internal UPCBMP file format is defined as follows:
**
** A 16-byte information header for the format:
**
** 2 bytes File format signature, "CF"
** 1 byte Color Depth:
**
** 8 indicates 8-Bit RGB332
** 16 indicates 16-Bit RGB565
**
** RGB332 is stored as 1 byte per pixel with bits assigned to each
** color component as:
**
** Bit: 7 6 5 4 3 2 1 0
** Component: R R R G G G B B
**
** RGB565 is stored as 2 bytes per pixel with bits assigned to each
** color component as:
**
** Bit: F E D C B A 9 8 7 6 5 4 3 2 1 0
** Component: R R R R R G G G G G G B B B B B
**
** 1 byte Flags:
** 0x01 Set if pixel data is little-endian, unset for big-endian
** 0x02 Set if transparent color is specified, unset for no transparency
**
** 2 bytes Bytes per pixel row (always in network-byte order)
** 2 bytes Image width in pixels (always in network-byte order)
** 2 bytes Image height in pixels (always in network-byte order)
** 2 bytes --- Reserved --- (must be set to zero)
** 4 bytes Transparency color value (identical to actual pixel data)
** The transparency color for the bitmap is here, starting from the
** given offset, and matches the pixel data in endianess and
** component organization. Bytes are padded on to the end of this
** 4 byte field to align with the header size.
**
** This value must be ignored if the transparency color flag is not set.
**
** Pixel data for the actual image:
**
** Pixel data is stored after the header as sets of rows of length
** specified by bytes per pixel row. This gives us a bit more
** flexibility in specifying images.
*/
#define kUPCBMPSig0 ('C')
#define kUPCBMPSig1 ('F')
#define kUPCBMPSigOffset0 0
#define kUPCBMPSigOffset1 1
#define kUPCBMPColorDepthOffset 2
#define kUPCBMPFlagsOffset 3
#define kUPCBMPRowBytesOffset 4
#define kUPCBMPImageWidthOffset 6
#define kUPCBMPImageHeightOffset 8
#define kUPCBMPTransparentColorOffset 12
#define kUPCBMPHeaderSize 16
#define kUPCBMPFlagLittleEndian 0x01
#define kUPCBMPFlagTransparency 0x02
#define kUPCBMPColorDepthRGB332 8
#define kUPCBMPColorDepthRGB565 16
#define kUPCBMPBytesPerPixelRGB332 1
#define kUPCBMPBytesPerPixelRGB565 2
#define UPCBMPGetU16(bytePtr) ( (U16) ((((U8*)(bytePtr))[0] << 8) | ((U8*)(bytePtr))[1]) )
#define UPCBMPSetU16(bytePtr, n) { (bytePtr)[0] = ((n) >> 8) & 0xFF; (bytePtr)[1] = (n) & 0xFF; }
/*** Soon to be DEPRECATED ***/
/* The definitions below apply to the previous version of the internal image format. */
/* The first two bytes of the default internal format are 'I' and 'F' */
#define kUPBmpHeader0 ('I')
#define kUPBmpHeader1 ('F')
#define kUPBmpHeader0Offset (0)
#define kUPBmpHeader1Offset (1)
#define kUPBmpWidthOffset (2) /* width byte */
#define kUPBmpHeightOffset (3) /* height byte */
#define kUPBmpHeaderSize (4) /* size byte */
#endif
#endif /* OP_DEFINE_HEADER_REVISION */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -