Omegicus Digest: Font Antialiasing and Encryption and Compression Library

    Good afternoon! At the moment, I am completing the alpha version of my OS ( tyts ), what will happen - it will be, then there is no way and time to do it further, but I will bring it to some state, which I will inform about in a separate post.

    In principle, in my coding one way or another, everything revolves around an axis, i.e. AXIS. Sometimes it spits out into individual micro-projects, which I’ll talk about now.

    The first thing - font smoothing (antialiasing)


    My fonts are raster, 8x8. Why not otherwise, just like that. Since glamor is a necessary thing, I wanted to smooth out the font output a bit. But, as usual, I would not be me if the smoothing code turned out to be very large or that eats a lot of memory. Accordingly, I decided to just look at how the smoothed letter looks and reproduce it. Speech, by the way, is not about sub-pixel smoothing, but about simple - i.e. antialiasing.

    So how is it done with me.

    When outputting a character, we go through each bit and output accordingly. pixel We wedge into this process from the second line from the top (we skip the first). We process not a single pixel, but a group of four (current, right, top, and right-top). Those. process a square of four pixels.

    The resulting “matrix” is transferred to the processing procedure and already it, depending on the resulting combination, changes the color of each of these pixels. I note that not all combinations are processed, only 6 - this is enough. In the second picture (i.e. the one on the right), all processed combinations are visible (these are generally available combinations, and not specifically for the letter S). If the matrix is ​​the desired one, change the black (i.e. active) pixels to dark gray, and the transparent (white, inactive) pixels to light gray.
    If the matrix is ​​not one of the 6 required ones, we don’t touch anything at all in it. Colors (black, gray, etc.) are for test purposes only, of course, that a transparent pixel must be taken from the screen, and "gray" is the degree of translucency.

    image

    And so every pixel of the row. We process the next line in the same way, i.e. each row (except the 1st) gets processed twice - as the current row and as a row from the top in the matrix.
    But here, in fact, is the result. For me - very good minimal resources and effort.

    image

    The code and the compiled program-example are here .

    The second thing - a ready-to-use collection of source codes for encryption and compression


    He is here . Actually, everything is clear - just collected in one library sources for encryption (GOST (both), RC4, VMPC, RC6, AES, Serpent, Blowfish), hashing (CRC32 \ 64, MD5, GOST (both)) and data compression (LZMA , LZW, LZO).

    How to use the cryptographic set is on the github and in the example ( test.exe , its source is there).

    ... but here's how to use compression:


    thing number three - my little WinKAR archiver. Based on the above “library”. Acc. can compress with LZMA (almost 7zip), LZW and LZO. LZW is just for beauty, because there is no special meaning in it, although in theory it should have become a compromise between LZMA and LZO.

    You can also use encryption in the archiver if a password is specified. For each file in the archive, you can use both your own compression method and your own encryption method (and password).

    You can download it here or here . By the way, the archiver weighs 38 kilobytes without any packers.

    I did more for myself, so I apologize for the inconvenient interface.

    Also popular now: