1 // ------------------------------------------------------------------------------------------------ 2 // MODULE : Pixel 3 // LANGUAGE : C++ 4 // CREATION : 04/02/96 by Laurent SABORET, from ApplCommun.h by Adolfo VIDE 5 // DESCRIPTION : 6 // COMMENTS : Mustn't include ApplCommun.h 7 // SCCSID : @(#)pixel.h 1.1 11:50:06 18 Dec 1996 8 // ---------------------------------------------------------------------------- 9 // Copyright (c) 1999 Digital Imaging Group, Inc. 10 // For conditions of distribution and use, see copyright notice 11 // in Flashpix.h 12 // ---------------------------------------------------------------------------- 13 // ------------------------------------------------------------------------------------------------ 14 #ifndef Pixel_h 15 #define Pixel_h 16 // ------------------------------------------------------------------------------------------------ 17 18 // Includes 19 // -------- 20 21 #ifndef FITypes_h 22 #include "b_types.h" 23 #endif 24 25 // Classes declaration 26 // ------------------- 27 28 struct Pixel; 29 typedef Pixel* ptr_Pixel; 30 typedef Pixel& ref_Pixel; 31 32 // Classes definition 33 // ------------------ 34 35 // Type of a 32 bits pixel. 36 // This type matches a pixel in the Macintosh video RAM, so don't modify it! 37 struct Pixel { 38 39 Pixel(); 40 Pixel(int32 rgb); 41 42 operator int32 (); 43 44 unsigned char alpha; // Alpha channel 45 unsigned char rouge; // Red 46 unsigned char vert; // Green 47 unsigned char bleu; // Blue 48 }; 49 50 // Inline functions 51 // ---------------- 52 Pixel()53 inline Pixel::Pixel() { } 54 Pixel(int32 rgb)55 inline Pixel::Pixel(int32 rgb) 56 57 { 58 *((int32 *)this) = rgb; 59 } 60 int32()61 inline Pixel::operator int32() { 62 return *((int32*)(this)); 63 } 64 65 // ------------------------------------------------------------------------------------------------ 66 #endif // Pixel_h 67 // ------------------------------------------------------------------------------------------------ 68