Commit graph

228 commits

Author SHA1 Message Date
Gered cfd7d479ec add variable_screen_size example project
not a super exciting project. might be removed later on when i
eventually get to adding more exciting examples
2023-03-29 15:43:58 -04:00
Gered f2f1d83edf update Standard system resource with variable screen size support 2023-03-29 15:40:37 -04:00
Gered 7143430769 update DosLike system resource with variable screen size support
also re-did DosLikeConfig at the same time, making usage a bit clearer
2023-03-29 15:38:39 -04:00
Gered e18238405c
add actions workflow to do cargo check and test
not sure if this will work. first time trying github actions and this is entirely based on what github suggested for this action.
2023-03-28 21:03:09 -04:00
Gered 7f19f4e7d4 fix a bunch of clippy warnings
but not all of them. just the easy ones for now!
2023-03-28 16:29:44 -04:00
Gered aa22786d43 update dependencies 2023-03-28 14:04:48 -04:00
Gered 6973d5e039 add rustfmt.toml to the project root
rather than just relying on $HOME/.rustfmt.toml ...
2023-03-27 18:46:33 -04:00
Gered ceaefad030 lets try using rustfmt again ...
i unfortunately feel like i should really force myself to use rustfmt
even though i very much dislike it. most rust developers seem to use it
so i should probably get used to it ...

however, case-in-point for me is the amount of times i used either
#[rustfmt::skip] or adding a blank `//` comment to force separate
lines, etc, really proves how terrible basing almost all of your
formatting rules on arbitrary length thresholds really is. code
formatting is far more subjective than that.
2023-03-27 18:43:41 -04:00
Gered 36c4cc1a41 remove these two unneeded extern crate lines
i'm going to guess this was added early on automatically by clion
and i just never caught it. they'd been here since the project was
first committed to a git repo. oh well.
2023-03-27 16:59:55 -04:00
Gered e503cfb718 remove old display size constants as well as cargo feature flags
we'll be introducing variable display size features next, so these
screen dimension compile-time constants are not going to be useful.

the "low_res" and "wide" features were also tied to the idea of
compile-time constants for display sizing so these need to go too,
and will be brought back via runtime configuration
2023-03-27 16:58:37 -04:00
Gered 806725654a fix lingering compile errors in the example projects 2023-03-27 16:46:04 -04:00
Gered e4608dee82 add visual tests for RgbaBitmap color tinted blit methods 2023-03-26 18:34:58 -04:00
Gered cf021aa1de add RgbaBitmap color tinted blit methods
BlendFunction has a tinted blend that is similar, but it is also
useful to be able to color tint without blending
2023-03-26 18:34:18 -04:00
Gered 7209907193 change to a better tint color used in visual test
figure it is best to use a color that contains all different and
non-zero RGB components
2023-03-26 17:59:42 -04:00
Gered b94ef4df4e add visual tests for BlendFunction blending 2023-03-26 17:45:22 -04:00
Gered d2bc28754f add visual tests for RgbaBitmap blended drawing primitives 2023-03-26 16:57:22 -04:00
Gered f233f810e6 add RgbaBitmap blended drawing primitives 2023-03-26 16:36:53 -04:00
Gered 5c2571755a update blended_pixel_drawing visual test to test an unchecked method too 2023-03-26 16:29:55 -04:00
Gered d238031166 update blended_rect visual test to reflect bug fix
the previous commit fixed a minor 1-pixel-off issue related to
clipping
2023-03-26 16:29:07 -04:00
Gered 3864f36706 update IndexedBitmap blended primitives to use new generic functions 2023-03-26 16:27:14 -04:00
Gered a667a657d2 add generic primitive drawing methods accepting custom pixel functions 2023-03-26 16:26:15 -04:00
Gered 847149607d some cleanups and fixes 2023-03-26 13:49:16 -04:00
Gered 48a76a59e0 add visual tests for the new blending RgbaBitmap blit methods
note that we're not testing all of the different blend combinations
for each blit method. specific BlendFunction visual tests will be added
2023-03-26 13:15:56 -04:00
Gered 0345571851 reorder blit method enums in a different and still arbitrary order 2023-03-26 12:37:54 -04:00
Gered b38a4b55bc add RgbaBitmap blending blit methods 2023-03-25 19:09:01 -04:00
Gered 050c2ac6e9 add color blending and tinting functions
this is definitely one of those things where i wonder if there are
probably better names (more standardized names) that could be used
here instead
2023-03-25 19:08:20 -04:00
Gered a087c35024 add pixel format option to RgbaBitmap png saving 2023-03-24 20:11:08 -04:00
Gered 29ab739323 update IndexedBitmap graphics visual tests to match the rgb tests 2023-03-21 21:20:35 -04:00
Gered 9dcfa91502 add graphics visual tests for RgbaBitmap drawing operations
obviously only for the operations implemented so far. there are going
to be more in the near future.
2023-03-21 21:19:37 -04:00
Gered bb4a3655dc update graphics visual test references images that used the vga palette
necessary after the previous change fixing the 6-bit to 8-bit
conversion
2023-03-21 18:21:26 -04:00
Gered 1f232c51bb fix 6-bit to 8-bit palette conversion
this now produces "full range" results, e.g. VGA color 15 (bright white)
now converts to 255,255,255 instead of 252,252,252.
2023-03-21 18:20:36 -04:00
Gered ba75ae04f1 set default pixel color for new Bitmap's differently based on type
this is mainly to prevent RgbaBitmap's from being initialized by
default to all black with alpha=0. this can still be manually done if
desired, but the assumption is that most of the time you'd want
alpha=255.

for the most part this doesn't matter one way or the other except when
we get to blending (not yet done for RgbaBitmaps, but coming soon) and
saving RgbaBitmap's to PNG files where it becomes blatantly obvious
when you have a bitmap with all/mostly alpha=0 pixels!
2023-03-21 16:55:57 -04:00
Gered 6a0be2756a add some useful rgba color constants
copied from the default VGA/EGA palette
2023-03-21 16:53:00 -04:00
Gered ec437974ee add RgbaBitmap::load_file 2023-03-21 15:40:31 -04:00
Gered 04f57cf8da convert graphics visual tests reference images to png
this just makes it a lot easier to open up in whatever graphics tool
is available during development
2023-03-21 15:25:25 -04:00
Gered b6e69ca084 allow png files to be loaded via IndexedBitmap::load_file 2023-03-21 15:23:47 -04:00
Gered 6829800caa organize test assets a little bit better 2023-03-21 15:09:47 -04:00
Gered 3d9d97db08 rename to avoid compiler warning
for now until we later fully implement this function and use these
arguments
2023-03-20 22:19:14 -04:00
Gered 11625f58a5 add png save tests 2023-03-20 22:18:15 -04:00
Gered a5c8af67ad set alpha component consistently with other colours during palette read
when reading palette files/streams, we set up the colour entries
using helper functions that automatically set an alpha component of 255.
however, we were first initializing the palette with 0 (alpha component
of 0 too).

this meant that if a palette of less than 256 colours was loaded, the
remaining entries (since Palette is always sized for 256 colours), were
black (0,0,0) with alpha components of 0.

this change makes all palette entries have a consistent alpha value
(which is never really used anyway ...) when loaded.
2023-03-20 22:18:02 -04:00
Gered 148a24ca42 implement png saving
note that we only allow RgbaBitmaps to save RGBA colour format pngs.
likewise, IndexedBitmaps can only save indexed-colour format pngs.
2023-03-20 21:47:02 -04:00
Gered ac4df9e8ed merge functionality of PixelDecoder and ScanlineBuffer together 2023-03-20 17:47:18 -04:00
Gered 48c694192b maybe improve png decoding, sorta, kinda, i guess? 2023-03-20 17:14:38 -04:00
Gered d02b81b1fb extra tests for other unsupported png scenarios 2023-03-20 12:06:10 -04:00
Gered 76d0289a0f add png loading tests 2023-03-20 12:02:55 -04:00
Gered 6e09c84c4a implement working filter-aware png scanline decoding
this is all gross at the moment, but it works. which is the goal right
now.
2023-03-19 22:55:46 -04:00
Gered eb5869b600 initial and semi-incomplete png loading support
- no filters other than filter 0 right now
- no png file saving
- inefficiencies
- maybe some bugs, not a full test suite yet
2023-03-16 21:20:43 -04:00
Gered 6de4bf3ef0 add temporary (and wasteful) methods to load gif/iff/pcx to RgbaBitmaps
temporary measure until i feel like making the existing loading process
for all of these able to handle variable pixel bit-depth destinations.
not super high on my priority list so this may not happen for a while.
2023-03-13 13:03:55 -04:00
Gered bc59442311 add method to convert an IndexedBitmap to an RgbaBitmap
doing the reverse is a fair bit more complicated, so we'll leave that
alone for now!
2023-03-13 13:02:21 -04:00
Gered 99de921f64 fix solid_blit pointer stuff
i did not read the doc comments for pointer methods and mistakenly
thought i needed to calculate raw byte offsets here, but actually it
works in units of size T (where T in our case is either u8 or u32)
2023-03-11 21:14:01 -05:00