mirror of
https://github.com/aaronsgiles/JPEGView.git
synced 2024-06-06 21:29:27 +00:00
92bdb55672
These are the sources for the final official release of JPEGView for the Mac, back in 1994.
1 line
766 B
C
1 line
766 B
C
/*********************************************************/
|
|
/* This source code copyright (c) 1991-2001, Aaron Giles */
|
|
/* See the Read Me file for licensing information. */
|
|
/* Contact email: mac@aarongiles.com */
|
|
/*********************************************************/
|
|
|
|
// void FillHistogram32(FillDataPtr theData)
|
|
|
|
register ulong r, g, b;
|
|
register ulong *bp;
|
|
register ushort w;
|
|
|
|
while (theData->height--) {
|
|
bp = (ulong *)theData->baseAdr;
|
|
for (w = 0; w < theData->width; w++) {
|
|
r = g = b = *bp++;
|
|
r >>= 9;
|
|
r &= 0x00007c00;
|
|
g >>= 6;
|
|
g &= 0x000003e0;
|
|
r += g;
|
|
b >>= 3;
|
|
b &= 0x0000001f;
|
|
r += b;
|
|
if (!(++theData->histogram[r])) theData->histogram[r]--;
|
|
}
|
|
theData->baseAdr += theData->rowBytes;
|
|
}
|