LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

More simple C and color mixing tests

Posted 06-11-2013 at 12:30 AM by rainbowsally

Today's Feature
  • Here's another pixel (color) mixing toy. The best yet.

Back a couple of blog pages
http://www.linuxquestions.org/questi...lamping-35557/
we were playing with color mixing and data clamping and all kinds of junk including comparing routines to mix colors by a floating point ratio.

This is mixcolors.c - named the same as the other version we were playing with and...
Member
Posted in Uncategorized
Views 863 Comments 0 rainbowsally is offline
Old

Simple C - mix pixel data, integer math (fixed point), data clamping...

Posted 06-06-2013 at 06:15 PM by rainbowsally

Simple C to mix pixel data, integer math (fixed point), data clamping

Today's Features
  • Simple program to add two pixels clamping each byte to 0xFF, but adding all four bytes in parallel for speed. There are no branches in the algorithm.
  • Another simple program to mix two colors defining a gradient using a fraction from 0 to 1. We compare floating point to fixed point math versions.


Surprisingly, the long version compiles about the same code as the short one with...
Member
Posted in Uncategorized
Views 1086 Comments 0 rainbowsally is offline
Old

New-Make And MC2, Meet MPG123 (terminal app to play MP3 and other file formats)

Posted 12-25-2012 at 08:11 PM by rainbowsally
Updated 08-06-2014 at 08:47 AM by rainbowsally (wrong acronym for alsa)

After that last rant about screwy software, I found some GREAT software. mpg123 is outstanding.

Today's Features
  • Me eating my words, even about assembler coding. ;-)

Famous last words galore! I even have to eat my words about asm. In fact this app is so cool I had to add the ability to compile asm and C sources in the same directory to the mc2 code.

MPG123 (sandboxed relocatable binary installation OR compile from code, modify, experiment, etc.) is linked...
Member
Posted in Uncategorized
Views 1094 Comments 0 rainbowsally is offline
Old

ASM: mixing assembler and C++

Posted 02-05-2012 at 12:05 PM by rainbowsally
Updated 08-06-2014 at 10:30 AM by rainbowsally

This is for intel 32 bit assembler. For 64-bits the calling convention is a bit different. See previous entries (specifically asm 64 bits) if you need a leg-up to break the 64 bit barrier.

Features:
  • Asm functions that can call class functions (using an object pointer) through jump vectors written in C.
  • Usage of extern "C" declarations to un-mangle names we need to keep simple for asm coding.

[If you really want to get down, you can use the mangled names as...
Member
Posted in Uncategorized
Views 1469 Comments 0 rainbowsally is offline
Old

ASM: Intercepting (and using) Errors (like segfaults) in asm (aka SEH)

Posted 02-03-2012 at 04:10 PM by rainbowsally

This is for i86 and x86_64 types but with a bit of poking around you can probably find a similar way to do this with other CPUs.

Note: This asm requires 'sigaction'. (See the test code. And bear in mind that this is not an attempt to create a full-blown system of signal handlers. Check the libc docs for 'sigaction' for ideas on how you can use something like this for a seed for a more extensive application.)

There used to be a lot of cool little programs for the...
Member
Posted in Uncategorized
Views 1530 Comments 0 rainbowsally is offline

  



All times are GMT -5. The time now is 01:20 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration