Click here to Skip to main content
15,891,673 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Programming peeve of the Day Pin
Gerry Schmitz12-Mar-21 8:28
mveGerry Schmitz12-Mar-21 8:28 
GeneralI never liked writing graphics libraries Pin
honey the codewitch11-Mar-21 6:39
mvahoney the codewitch11-Mar-21 6:39 
GeneralRe: I never liked writing graphics libraries Pin
pkfox11-Mar-21 7:25
professionalpkfox11-Mar-21 7:25 
GeneralRe: I never liked writing graphics libraries Pin
W Balboos, GHB11-Mar-21 8:12
W Balboos, GHB11-Mar-21 8:12 
GeneralRe: I never liked writing graphics libraries Pin
Rick York11-Mar-21 11:00
mveRick York11-Mar-21 11:00 
GeneralRe: I never liked writing graphics libraries Pin
honey the codewitch12-Mar-21 3:38
mvahoney the codewitch12-Mar-21 3:38 
GeneralRe: I never liked writing graphics libraries Pin
Rick York12-Mar-21 6:15
mveRick York12-Mar-21 6:15 
GeneralRe: I never liked writing graphics libraries Pin
honey the codewitch12-Mar-21 8:22
mvahoney the codewitch12-Mar-21 8:22 
I like the creativity it requires.

Here I get called back with rectangles I'm getting from "converting" a jpeg - in this case into a raw rgb565BE bitmap form, compatible with the frame buffer of the LCD display I'm using. I'm them telling the device to do a DMA transfer from the ram I just gave it, in effect, loading the JPEG onto the display one rectangle at a time:

C#
jpg_state js;
js.tft=&tft;
js.dma_space=dma_space;
js.size = dma_size;
io::file_stream inp("/spiffs/warhol320x240.jpg",file_mode::read);    
jpeg::convert(
    inp,
    [](const rect16& rect,size16 size,const rgb888* bitmap, const void* state){
        jpg_state s = *((jpg_state*)state);
        const rgb888* end = bitmap+(sizeof(rgb888)*rect.width()*rect.height());
        assert((((end-bitmap)/sizeof(rgb888))*sizeof(rgb565))<=s.size);
        uint16_t* buf=(uint16_t*)s.dma_space;
        while(bitmap!=end) {
            rgb565 col = color::reduce(*bitmap++);
            *(buf++)=env::platform::mkbe(col.value);
        }
        return result::success==s.tft->write(rect,s.dma_space);
    },
    &js);

Real programmers use butterflies

GeneralRe: I never liked writing graphics libraries Pin
Daniel Pfeffer11-Mar-21 22:21
professionalDaniel Pfeffer11-Mar-21 22:21 
GeneralRe: I never liked writing graphics libraries Pin
honey the codewitch12-Mar-21 3:29
mvahoney the codewitch12-Mar-21 3:29 
GeneralRe: I never liked writing graphics libraries Pin
Gary R. Wheeler12-Mar-21 10:35
Gary R. Wheeler12-Mar-21 10:35 
GeneralRe: I never liked writing graphics libraries Pin
honey the codewitch12-Mar-21 10:46
mvahoney the codewitch12-Mar-21 10:46 
GeneralStart baking a pie Pin
Cp-Coder11-Mar-21 4:54
Cp-Coder11-Mar-21 4:54 
GeneralRe: Start baking a pie Pin
OriginalGriff11-Mar-21 5:15
mveOriginalGriff11-Mar-21 5:15 
GeneralRe: Start baking a pie Pin
Cp-Coder11-Mar-21 5:29
Cp-Coder11-Mar-21 5:29 
GeneralRe: Start baking a pie Pin
OriginalGriff11-Mar-21 5:46
mveOriginalGriff11-Mar-21 5:46 
GeneralRe: Start baking a pie Pin
DRHuff11-Mar-21 6:51
DRHuff11-Mar-21 6:51 
GeneralRe: Start baking a pie Pin
theoldfool11-Mar-21 5:57
professionaltheoldfool11-Mar-21 5:57 
GeneralRe: Start baking a pie Pin
W Balboos, GHB11-Mar-21 6:22
W Balboos, GHB11-Mar-21 6:22 
GeneralRe: Start baking a pie Pin
DRHuff11-Mar-21 6:49
DRHuff11-Mar-21 6:49 
GeneralRe: Start baking a pie Pin
Richard MacCutchan11-Mar-21 6:25
mveRichard MacCutchan11-Mar-21 6:25 
JokeRe: Start baking a pie Pin
PIEBALDconsult11-Mar-21 5:15
mvePIEBALDconsult11-Mar-21 5:15 
GeneralRe: Start baking a pie Pin
OriginalGriff11-Mar-21 5:47
mveOriginalGriff11-Mar-21 5:47 
GeneralRe: Start baking a pie Pin
Eddy Vluggen11-Mar-21 6:29
professionalEddy Vluggen11-Mar-21 6:29 
GeneralRe: Start baking a pie Pin
Sander Rossel11-Mar-21 8:44
professionalSander Rossel11-Mar-21 8:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.