Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
il_rle.h
Package: devil-1.7.99.tar.gz [view]
Upload User: wmy0603
Upload Date: 2022-05-02
Package Size: 1808k
Code Size: 2k
Category:
Compress-Decompress algrithms
Development Platform:
Visual C++
- //-----------------------------------------------------------------------------
- //
- // ImageLib Sources
- // Copyright (C) 2000-2002 by Denton Woods
- // Last modified: 05/25/2001 <--Y2K Compliant! =]
- //
- // Filename: src-IL/include/il_rle.h
- //
- // Description: Functions for run-length encoding
- //
- //-----------------------------------------------------------------------------
- #ifndef RLE_H
- #define RLE_H
- #include "il_internal.h"
- #define TGA_MAX_RUN 128
- #define SGI_MAX_RUN 127
- #define BMP_MAX_RUN 127
- #ifdef IL_RLE_C
- #undef NOINLINE
- #undef INLINE
- #define INLINE
- #endif
- #ifndef NOINLINE
- INLINE ILuint GetPix(ILubyte *p, ILuint bpp) {
- ILuint Pixel;
- Pixel = (ILuint)*p++;
- while( bpp-- > 1 ) {
- Pixel <<= 8;
- Pixel |= (ILuint)*p++;
- }
- return Pixel;
- }
- INLINE ILint CountDiffPixels(ILubyte *p, ILuint bpp, ILuint pixCnt) {
- ILuint pixel;
- ILuint nextPixel = 0;
- ILint n;
- n = 0;
- if (pixCnt == 1)
- return pixCnt;
- pixel = GetPix(p, bpp);
- while (pixCnt > 1) {
- p += bpp;
- nextPixel = GetPix(p, bpp);
- if (nextPixel == pixel)
- break;
- pixel = nextPixel;
- ++n;
- --pixCnt;
- }
- if (nextPixel == pixel)
- return n;
- return n + 1;
- }
- INLINE ILint CountSamePixels(ILubyte *p, ILuint bpp, ILuint pixCnt) {
- ILuint pixel;
- ILuint nextPixel;
- ILint n;
- n = 1;
- pixel = GetPix(p, bpp);
- pixCnt--;
- while (pixCnt > 0) {
- p += bpp;
- nextPixel = GetPix(p, bpp);
- if (nextPixel != pixel)
- break;
- ++n;
- --pixCnt;
- }
- return n;
- }
- #endif
- ILuint GetPix(ILubyte *p, ILuint bpp);
- ILint CountDiffPixels(ILubyte *p, ILuint bpp, ILuint pixCnt);
- ILint CountSamePixels(ILubyte *p, ILuint bpp, ILuint pixCnt);
- #endif//RLE_H