Annotation of nono/lib/color.h, revision 1.1.1.2

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2021 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // 色構造体
                      9: //
                     10: 
                     11: #pragma once
                     12: 
                     13: #include "header.h"
                     14: 
                     15: //
1.1.1.2 ! root       16: // 自前の色構造体。
        !            17: // メモリ上 { R, G, B, X } になる順。
        !            18: // uint32 で読むと LE では 0xXXBBGGRR、BE では 0xRRGGBBXX と読める。
1.1       root       19: //
1.1.1.2 ! root       20: union Color
1.1       root       21: {
1.1.1.2 ! root       22:        uint32 u32 {};
1.1       root       23:        struct {
                     24:                uint8 r;
                     25:                uint8 g;
                     26:                uint8 b;
                     27:                uint8 x;
                     28:        };
                     29: 
1.1.1.2 ! root       30:        Color() { }
        !            31:        Color(uint32 u32_) {
        !            32:                u32 = u32_;
        !            33:        }
        !            34:        Color(int r_, int g_, int b_) {
1.1       root       35:                r = r_;
                     36:                g = g_;
                     37:                b = b_;
                     38:                x = 0;
                     39:        }
                     40: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.