imagedecode.h

来自「一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上」· C头文件 代码 · 共 58 行

H
58
字号
/*
 * @(#)imageDecode.h	1.7 01/07/24 @(#)
 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of Sun
 * Microsystems, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sun.
 *
 * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
 * THIS SOFTWARE OR ITS DERIVATIVES.
 */
typedef unsigned char uchar;
typedef void* (*imageAllocator)(void *closure, int nbytes);

typedef struct _ids {
    void   *ptr;                  /* pointer to device specific image struct */
    void   (*reset)(struct _ids *self);
    long   (*getpos)(struct _ids *self);
    void   (*seek)(struct _ids *self, long pos);
    int    (*getByte)(struct _ids *self);
    int    (*getBytes)(struct _ids *self, uchar *buf, int bufsize);
    void   (*skip)(struct _ids *self, int numBytes);
    void   (*done)(struct _ids *self);
} imageSrcData, *imageSrcPtr;

typedef struct _idd {
    int    depth;
    void   *ptr;                  /* pointer to device specific image struct */
    void   *imagePtr;               /* pointer to device specific image data */
    void   **closure;             /* Image object this struct is attached to */
    void   (*setColormap)(struct _idd *self, long *map, int length);
    int    (*getStorageSize)(struct _idd *self, int width, int height);
    void   (*setSize)(struct _idd *self, int width, int height);
    void   (*setPixel)(struct _idd *self, int x, int y,
                       uchar a, uchar b, uchar c);
    void   (*sendPixels)(struct _idd *self, int y, uchar *scanline, int rgb);
    void   (*sendPackedPixels)(struct _idd *self, int y, uchar *scanline);
    void   (*copyPixels)(struct _idd *self, void *sourceData);
    void   (*done)(struct _idd *self); /* may be called with invalid image data */
    void   (*getSize)(struct _idd *self, int *width, int *height);
    imageAllocator alloc;
} imageDstData, *imageDstPtr;

extern imageSrcPtr
createImageSrcFromData(char **data, int len);

extern bool_t
PNGdecodeImage(imageSrcPtr src, imageDstPtr dst);

extern imageDstPtr 
LCDUIcreateImageDst(bool_t mutable, imageAllocator alloc, void **closure);

⌨️ 快捷键说明

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