summaryrefslogtreecommitdiff
path: root/tvg
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-02-13 00:56:03 -0500
committerMicha White <botahamec@outlook.com>2023-02-13 00:56:03 -0500
commitbcc14d80b3d29651c228efcecc05ceec9a922773 (patch)
tree9d56af63e7f132c972e8efd4bbbe0301e2d9c7bc /tvg
parent38008d6a84457afad717e4524adcf963305fb0b7 (diff)
Expose the color module
Diffstat (limited to 'tvg')
-rw-r--r--tvg/src/colors.rs2
-rw-r--r--tvg/src/lib.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/tvg/src/colors.rs b/tvg/src/colors.rs
index 9f4e7e5..494e6aa 100644
--- a/tvg/src/colors.rs
+++ b/tvg/src/colors.rs
@@ -11,7 +11,7 @@ use crate::TvgError;
/// For the three defined color encodings, each will yield a list of
/// `color_count` RGBA tuples.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct ColorTable<C: Color> {
+pub(crate) struct ColorTable<C: Color> {
colors: Box<[C]>,
}
diff --git a/tvg/src/lib.rs b/tvg/src/lib.rs
index 6b07ff0..5c9e1d2 100644
--- a/tvg/src/lib.rs
+++ b/tvg/src/lib.rs
@@ -1,26 +1,26 @@
use std::io::{self, Read};
use byteorder::{LittleEndian, ReadBytesExt};
-use colors::ColorTable;
+use colors::{Color, ColorTable};
use commands::Command;
use header::{CoordinateRange, Scale, TvgHeader};
use thiserror::Error;
-mod colors;
+pub mod colors;
mod commands;
mod header;
mod path;
-pub use colors::{Color, Rgb565, Rgba16, Rgba8888, RgbaF32};
pub use header::SUPPORTED_VERSION;
+#[derive(Debug, Clone)]
pub struct TvgFile<C: Color> {
header: TvgHeader,
color_table: ColorTable<C>,
commands: Box<[Command]>,
}
-impl<C: Color + std::fmt::Debug> TvgFile<C> {
+impl<C: Color> TvgFile<C> {
/// Read a TinyVG file.
pub fn read_from(reader: &mut impl Read) -> Result<Self, TvgError> {
let header = TvgHeader::read(reader)?;