Compare commits

..

25 Commits

Author SHA1 Message Date
Nik
1a2d785093 patterns/java_class: Added MIME type 2023-06-24 11:05:10 +02:00
Nik
addec74d91 type/leb128: Fixed type always displaying 0 2023-06-22 17:35:59 +02:00
jfsbrito
ce83eedf02 patterns/7z: Added CompressData length and other improvements (#134)
* Update 7z.hexpat - v1.01

v1.01
--Minor changes.
--CompressData lenght added
--Output optimization

* Update 7z.hexpat v1.02

-Minor Changes
-Added Bzip2 verification
2023-06-22 07:27:31 +02:00
Doriel Rivalet
463ddcc62e themes: Add Catppuccin themes (#132)
* docs(README): add catppuccin theme

* themes: add catppuccin flavors

* chore: rename catppuccin files

* docs(README): update catppuccin file names
2023-06-19 23:09:16 +02:00
jfsbrito
13b97fc976 patterns/7z: Added 7Zip pattern (#128)
* 7z.hexpat

This repository contains a custom pattern for the ImHex tool that enables the analysis of 7zip files. The pattern allows for a structured view of 7zip files within ImHex, providing insights into various aspects of the file structure.

- Identification of 7zip files: The custom pattern detects and identifies 7zip file types based on their signature.
- Extraction of key information: The pattern extracts important details from the 7zip file, such as the format version, CRC values, relative offset of the end header, and file size.
- Differentiation of compression methods: The pattern distinguishes between LZMA and LZMA2 compression methods used within the 7zip file.
- Visualization of start and end headers: The pattern helps in visualizing the start and end headers of the 7zip file, making it easier to navigate through its structure.

To use the custom pattern for analyzing 7zip files in ImHex, follow these steps:

1. Install ImHex: Ensure that you have ImHex installed on your system.
2. Open a 7zip file: Launch ImHex and open the 7zip file you want to analyze.
3. Apply the custom pattern: In the "Pattern" menu, select the custom pattern for 7zip file analysis and apply it.
4. Explore the file structure: ImHex will display the matched patterns, allowing you to explore the structure of the 7zip file with the extracted information.

Please note that this custom pattern is designed specifically for 7zip files and may not be suitable for other file formats.

Contributions to this custom pattern for 7zip file analysis are welcome. If you have any improvements, bug fixes, or suggestions, feel free to submit a pull request.

This custom pattern for ImHex is licensed under the [MIT License](LICENSE.md). You are free to modify and distribute this pattern as per the terms of the license.

We would like to acknowledge the developers of ImHex for providing an excellent tool for binary file analysis. The custom pattern for 7zip file analysis in this repository builds upon the capabilities of ImHex to enhance the understanding of 7zip file structures.

---

We hope you find this custom pattern useful for analyzing 7zip files using ImHex. If you encounter any issues or have any questions, please feel free to raise them in the "Issues" section of this repository.

Thanks!

* Added test file

---------
2023-06-19 23:08:42 +02:00
luisfilipe23lol
55e4283432 patterns/cda: Added CDA pattern (#133)
* Create cda.hexpat

pattern language created for .cda files

* added test file for cda pattern

* Delete cda.hexpat.cda.cda

* Add test file cda

test file for cda pattern

* Update README.md

Add cda file in read.me
2023-06-19 14:22:17 +02:00
Nik
ea225edf12 git: Disable coverage information for now 2023-06-17 15:20:01 +02:00
blondecake433
bb19cb43ee patterns:/mp4: Added mp4 pattern (#129) 2023-06-17 15:07:08 +02:00
Nik
8f8ad0e2d5 git: Try fix Coveralls heap out of memory 2023-06-17 15:02:53 +02:00
Nik
3ad1f3969f includes/std: Fixed documentation of copy_value_to_section function 2023-06-15 22:58:44 +02:00
cryptax
5451d45158 patterns/dex: Fix pattern to see data section of DEX files + Link_data (#127) 2023-06-15 18:48:47 +02:00
Nik
e6a731fa1d includes/type: Added Base64 type 2023-06-15 17:34:20 +02:00
Jackson Barreto
8a62001705 patterns: Added TIFF pattern (#126)
* Create tiff.hexpat

* Update README.md

Update readme to include tiff hexpat

* added file to test the pattern

---------

Co-authored-by: joelalves <joel.17.alves@gmail.com>
2023-06-15 08:08:39 +02:00
Nik
1f8710b586 patterns/ntag: Fixed Length type transform function 2023-06-13 13:36:53 +02:00
Nik
acd2d4abb8 includes/std: Fixed description of array library (#125) 2023-06-12 08:10:48 +02:00
qufb
032f3c7c01 pattern/midi: Support multiple tracks (#124)
* pattern/midi: Support multiple tracks

* pattern/midi: Replace custom type used to index array
2023-06-11 13:09:23 +02:00
无以铭川
3841ff51ef pattern/java_class: Format byte code instruction (#123) 2023-06-08 23:39:39 +02:00
Nik
622721403f patterns/flac: Fixed typo 2023-06-06 08:26:01 +02:00
Nik
11291d1ebb tests: Added JPG test file 2023-06-05 10:59:12 +02:00
Nik
92e61ccf5d tests: Fixed build with new pattern language changes 2023-06-05 10:03:55 +02:00
Nik
062edfe527 includes/std: Fixed std::fxpt::to_fixed conversion issue 2023-06-05 09:48:33 +02:00
paxcut
5b32941801 patterns: Added visualizers to image patterns (#117)
* Added image visualizers to image patterns that were supported

* missing include files

* Small style fixes

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2023-06-04 22:38:25 +02:00
Nik
e99ab5b59b patterns/java_class: Fixed duplicate variables 2023-06-02 10:54:09 +02:00
Feitong Chen
775c836766 patterns/macho: Fix macho CpuType error and add CpuType::ARM64 and CpuType::ARM64_32 (#115) 2023-06-01 16:38:34 +02:00
blondecake433
43058b4c45 pattern/gif: Improved GIF pattern (#114) 2023-05-26 09:28:18 +02:00
34 changed files with 2794 additions and 219 deletions

View File

@@ -59,16 +59,18 @@ jobs:
cd tests/build
ctest --output-on-failure
- name: ⚗️ Generate Coverage Report
run: |
cd tests/build
lcov -d ./_deps/pattern_language-build/lib --gcov-tool /usr/bin/gcov-12 -c -o coverage.info
#- name: ⚗️ Generate Coverage Report
# run: |
# cd tests/build
# lcov -d ./_deps/pattern_language-build/lib --gcov-tool /usr/bin/gcov-12 -c -o coverage.info
- name: ⬆️ Upload Coverage Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: tests/build/coverage.info
#- name: ⬆️ Upload Coverage Report
# uses: coverallsapp/github-action@master
# env:
# NODE_OPTIONS: --max-old-space-size=8000
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: tests/build/coverage.info
- name: 📎 Validate JSON Files
run: |

View File

@@ -22,6 +22,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
| Name | MIME | Path | Description |
|------|------|------|-------------|
| 7Z | | [`patterns/7z.hexpat`](patterns/7z.hexpat) | 7z File Format |
| AFE2 | | [`patterns/afe2.hexpat`](patterns/afe2.hexpat) | Nintendo Switch Atmosphère CFW Fatal Error log |
| AR | `application/x-archive` | [`patterns/ar.hexpat`](patterns/ar.hexpat) | Static library archive files |
| ARM VTOR | | [`patterns/arm_cm_vtor.hexpat`](patterns/arm_cm_vtor.hexpat) | ARM Cortex M Vector Table Layout |
@@ -32,6 +33,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
| CCHVA | | [`patterns/cchva.hexpat`](patterns/cchva.hexpat) | Command and Conquer Voxel Animation |
| CCVXL | | [`patterns/ccvxl.hexpat`](patterns/ccvxl.hexpat) | Command and Conquer Voxel Model |
| CCPAL | | [`patterns/ccpal.hexpat`](patterns/ccpal.hexpat) | Command and Conquer Voxel Palette |
| CDA | | [`patterns/cda.hexpat`](patterns/cda.hexpat) | Compact Disc Audio track |
| CHM | | [`patterns/chm.hexpat`](patterns/chm.hexpat) | Windows HtmlHelp Data (ITSF / CHM) |
| COFF | `application/x-coff` | [`patterns/coff.hexpat`](patterns/coff.hexpat) | Common Object File Format (COFF) executable |
| CPIO | `application/x-cpio` | [`patterns/cpio.hexpat`](patterns/cpio.hexpat) | Old Binary CPIO Format |
@@ -60,6 +62,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
| Mach-O | `application/x-mach-binary` | [`patterns/macho.hexpat`](patterns/macho.hexpat) | Mach-O executable |
| MIDI | `audio/midi` | [`patterns/midi.hexpat`](patterns/midi.hexpat) | MIDI header, event fields provided |
| MiniDump | `application/x-dmp` | [`patterns/minidump.hexpat`](patterns/minidump.hexpat) | Windows MiniDump files |
| mp4 | `video/mp4` | [`patterns/mp4.hexpat`](patterns/mp4.hexpat) | MPEG-4 Part 14 digital multimedia container format |
| msgpack | `application/x-msgpack` | [`patterns/msgpack.hexpat`](patterns/msgpack.hexpat) | MessagePack binary serialization format |
| NACP | | [`patterns/nacp.hexpat`](patterns/nacp.hexpat) | Nintendo Switch NACP files |
| NBT | | [`patterns/nbt.hexpat`](patterns/nbt.hexpat) | Minecraft NBT format |
@@ -82,6 +85,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
| STL | `model/stl` | [`patterns/stl.hexpat`](patterns/stl.hexpat) | STL 3D Model format |
| StuffItV5 | `application/x-stuffit` | [`patterns/sit5.hexpat`](patterns/sit5.hexpat) | StuffIt V5 archive |
| TAR | `application/x-tar` | [`patterns/tar.hexpat`](patterns/tar.hexpat) | Tar file format |
| TIFF | `image/tiff` | [`patterns/tiff.hexpat`](patterns/tiff.hexpat) | Tag Image File Format |
| TGA | `image/tga` | [`patterns/tga.hexpat`](patterns/tga.hexpat) | Truevision TGA/TARGA image |
| UEFI | | [`patterns/uefi.hexpat`](patterns/uefi.hexpat)` | UEFI structs for parsing efivars |
| UF2 | | [`patterns/uf2.hexpat`](patterns/uf2.hexpat) | [USB Flashing Format](https://github.com/microsoft/uf2) |
@@ -182,3 +186,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|------|------|-------------|
| Visual Studio Dark | [`themes/vs_dark.json`](themes/vs_dark.json) | Theme similar to Visual Studio's Dark theme |
| Solarized Dark | [`themes/solarized_dark.json`](themes/solarized_dark.json) | Solarized Dark Theme |
| Catppuccin Latte | [`themes/catppuccin-latte.json`](themes/catppuccin-latte.json) | Catppuccin Latte Flavor (Light Theme) |
| Catppuccin Frappe | [`themes/catppuccin-frappe.json`](themes/catppuccin-frappe.json) | Catppuccin Frappe Flavor (Dark Theme) |
| Catppuccin Macchiato | [`themes/catppuccin-macchiato.json`](themes/catppuccin-macchiato.json) | Catppuccin Macchiato Flavor (Dark Theme) |
| Catppuccin Mocha | [`themes/catppuccin-mocha.json`](themes/catppuccin-mocha.json) | Catppuccin Mocha Flavor (Dark Theme) |

View File

@@ -1,8 +1,8 @@
#pragma once
/*!
The array library contains various helper functions and types to make
it easier to work with Arrays.
The array library contains a helper type to make it easier to create multi-dimensional arrays
and pass arrays to functions as parameters.
*/
namespace std {
@@ -16,4 +16,4 @@ namespace std {
T data[Size] [[inline]];
};
}
}

View File

@@ -28,7 +28,7 @@ namespace std::fxpt {
@return The fixed point representation of flt
*/
fn to_fixed(double flt, u32 precision) {
return fixed((flt * (1 << precision)));
return s128((flt * (1 << precision)));
};
/**

View File

@@ -174,10 +174,9 @@ namespace std::mem {
/**
Copies a range of bytes from the main section into a custom section
@param from_section The section to copy from
@param from_address The address to copy from
@param value The pattern whose bytes should be copied
@param to_section The section to copy to
@param to_address The address to copy to
@param size The size of the range to copy
*/
fn copy_value_to_section(ref auto value, Section to_section, u64 to_address) {
builtin::std::mem::copy_value_to_section(value, to_section, to_address);

63
includes/type/base64.pat Normal file
View File

@@ -0,0 +1,63 @@
#include <std/io.pat>
#include <std/string.pat>
#include <std/mem.pat>
/*!
Type representing a Base64 encoded string
*/
namespace type {
/**
Type representing a Base64 encoded string
@tparam T String type
*/
struct Base64<T> {
T string;
} [[sealed, format("type::impl::transform_base64")]];
namespace impl {
fn get_decoded_value(char c) {
if (c >= 'A' && c <= 'Z') return c - 'A';
if (c >= 'a' && c <= 'z') return c - 'a' + 26;
if (c >= '0' && c <= '9') return c - '0' + 52;
if (c == '+') return 62;
if (c == '/') return 63;
return -1; // Invalid character
};
fn decode_base64(str input) {
u64 inputLength = std::string::length(input);
str result;
s32 val = 0;
s32 bits = -8;
for (u32 i = 0, i < inputLength, i += 1) {
char c = input[i];
if (c == '=')
break;
s32 index = type::impl::get_decoded_value(c);
if (index == -1)
continue;
val = (val << 6) + index;
bits += 6;
if (bits >= 0) {
result += char((val >> bits) & 0xFF);
bits -= 8;
}
}
return result;
};
fn transform_base64(ref auto base64) {
return type::impl::decode_base64(base64.string);
};
}
}

View File

@@ -33,7 +33,7 @@ namespace type {
namespace impl {
fn transform_uleb128_array(auto array) {
fn transform_uleb128_array(ref auto array) {
u128 res = array[0] & 0x7f;
for(u8 i = 1, array[i-1] & 0x80 != 0, i+=1) {
res |= u128(array[i] & 0x7f) << 7 * i;
@@ -41,7 +41,7 @@ namespace type {
return res;
};
fn transform_sleb128_array(auto array) {
fn transform_sleb128_array(ref auto array) {
s128 res = type::impl::transform_uleb128_array(array);
if (res & 0x40 != 0) {
res |= ~0 << (sizeof(array) / sizeof(u8)) * 7;
@@ -49,21 +49,21 @@ namespace type {
return res;
};
fn format_uleb128(auto leb128) {
fn format_uleb128(ref auto leb128) {
u128 res = type::impl::transform_uleb128_array(leb128.array);
return std::format("{} ({:#x})", res, res);
};
fn transform_uleb128(auto leb128) {
fn transform_uleb128(ref auto leb128) {
return type::impl::transform_uleb128_array(leb128.array);
};
fn format_sleb128(auto leb128) {
fn format_sleb128(ref auto leb128) {
s128 res = type::impl::transform_sleb128_array(leb128.array);
return std::format("{} ({:#x})", res, res);
};
fn transform_sleb128(auto leb128) {
fn transform_sleb128(ref auto leb128) {
return type::impl::transform_sleb128_array(leb128.array);
};

99
patterns/7z.hexpat Normal file
View File

@@ -0,0 +1,99 @@
#include <std/io.pat>
#include <std/mem.pat>
#include <std/math.pat>
enum Type:u8{
startPosition = 0x00, // Start position
sizeStartHeader = 0x20, // Size of start Header
};
enum TypeB:u48{
sevenZipSignature = 0x1C27AFBC7A37, // Defining 7z signature
};
struct StartHeader {
// File signature
u48 signature [[color("FF0000")] ];
// Version format
u16 formatVersion [[color("00FF00")]];
// CRC start header
u32 crcOfTheFollowing20Bytes [[color("0000FF")]];
// Relative offset of End Header
u64 relativeOffsetEndHeader [[color("FFFF00")]];
// Length of End Header
u64 theLengthOfEndHeader [[color("00FFFF")]];
// CRC of End Ender
u32 crcOftheEndHeader [[color("FF00FF")]];
// File size calculation
u64 fileSize = relativeOffsetEndHeader + theLengthOfEndHeader + Type::sizeStartHeader;
// Absolute offset calculation End Header
u64 startEndHeader = relativeOffsetEndHeader + Type::sizeStartHeader;
};
StartHeader startheader @ Type::startPosition;
struct CompressedData {
// Start of compressed data
u8 startOfCompressedData[4] [[color("C0C0C0")]];
};
CompressedData compresseddata @ Type::sizeStartHeader;
struct EndHeader {
// Set padding to place End Header in right position
padding[startheader.relativeOffsetEndHeader];
// Mark link to meta block
u8 linkToMetaBlock [[color("FF0000")]];
// Mark all End Header
char fullEndHeader[startheader.theLengthOfEndHeader] [[color("63954A")]];
// Detect LZMA signature
u64 lzmaSignaturePosition = std::mem::find_sequence_in_range(0, addressof(fullEndHeader), addressof(fullEndHeader) + sizeof(fullEndHeader), 0x23, 0x03, 0x01, 0x01, 0x05, 0x5D);
// Mark positions if LZMA signature was detected
if(lzmaSignaturePosition != 0xFFFFFFFFFFFFFFFF){
u48 lzmaSignature @ lzmaSignaturePosition [[color("0000FF")]];
}
};
EndHeader endheader @ Type::sizeStartHeader;
// Check 7z type
if(startheader.signature == TypeB::sevenZipSignature){
std::print("It is a 7z File Type");
}else{
std::print("The file is not 7z type");
}
std::print("Format Version {} ",startheader.formatVersion);
// Version verification
if(startheader.formatVersion == 0x0400){
std::print("Major Version 0x00 || 0 - Minor Version 0x04 || 4");
}
// Verification of the compressed method is LZMA, Bzip2 or LZMA2
if(compresseddata.startOfCompressedData[0] == Type::startPosition){
std::print("Compressed Method LZMA");
}else if(compresseddata.startOfCompressedData[0] == 0x42){
std::print("Compressed Method Bzip2");
}else{
std::print("Compressed Method LZMA2");
}
std::print("CRC Start Header 0x{:X}",startheader.crcOfTheFollowing20Bytes);
std::print("CRC End Header 0x{:X} ", startheader.crcOftheEndHeader);
std::print("CompressedData length 0x{:X} || {} bytes ",startheader.relativeOffsetEndHeader, startheader.relativeOffsetEndHeader);
std::print("Relative Offset of End Header 0x{:X} || {} bytes",startheader.relativeOffsetEndHeader, startheader.relativeOffsetEndHeader);
std::print("Offset to start End Header 0x{:X} || {} bytes",startheader.startEndHeader,startheader.startEndHeader);
std::print("End Header length 0x{:X} || {} bytes",startheader.theLengthOfEndHeader,startheader.theLengthOfEndHeader);
std::print("File size 0x{:X} || {} bytes",startheader.fileSize, startheader.fileSize);

View File

@@ -1,5 +1,6 @@
#pragma MIME image/bmp
#pragma endian little
#include <std/mem.pat>
struct BitmapFileHeader {
u8 bfType[2];
@@ -31,6 +32,7 @@ struct Colors {
};
struct Bitmap {
u8 data[std::mem::size()] [[no_unique_address, hidden]];
BitmapFileHeader bmfh;
BitmapInfoHeader bmih;
@@ -46,6 +48,6 @@ struct Bitmap {
u8 lineData[bmih.biSizeImage];
else
u8 lineData[bmfh.bfSize - $];
};
} [[hex::visualize("image", this.data)]];
Bitmap bitmap @ 0x00;

29
patterns/cda.hexpat Normal file
View File

@@ -0,0 +1,29 @@
struct Header {
u32 RIFF;
s32 size;
u32 CDDA;
u32 fmt;
u32 lenghtofthechunck;
u16 versionofcdformat;
u16 numberofrange;
u32 identifier;
};
struct DataInfo {
u32 range;
u32 duration;
u8 rangepositionframes;
u8 rangepositionseconds;
u8 rangepositionminutes;
u8 nullbyte;
u8 durationtrackframes;
u8 durationtrackseconds;
u8 durationtrackminutes;
u8 nullbytee;
};
Header header @ 0;
DataInfo data @ 0x1C;

View File

@@ -170,5 +170,8 @@ struct Dex {
field_id_item field_ids[header.field_ids_size] @ header.field_ids_off;
method_id_item method_ids[header.method_ids_size] @ header.method_ids_off;
class_def_item class_defs[header.class_defs_size] @ header.class_defs_off;
u8 data[header.data_size] @header.data_off;
map_list map_list @ header.map_off;
u8 link_data[header.link_size] @ header.link_off;
};
Dex dex @ 0x00;
Dex dex @ 0x00;

View File

@@ -138,7 +138,7 @@ enum PICTURE_TYPE : u32 {
struct METADATA_BLOCK_PICTURE {
PICTURE_TYPE pictureType;
u32 mimeTypeLength;
char mimeType[mineTypeLength];
char mimeType[mimeTypeLength];
u32 descriptionLength;
char description[descriptionLength];
u32 width, height;

View File

@@ -1,20 +1,23 @@
#pragma MIME image/gif
// Extension Labels
#define LABEL_GC 0xF9
#define LABEL_COMMENT 0xFE
#define LABEL_APPLICATION 0xFF
#define LABEL_PLAINTEXT 0x01
#define LABEL_APPLICATION_NETSCAPE "NETSCAPE"
#define CODE_FRAME 0x2C
#define CODE_EXTENSION 0x21
#define CODE_TRAILER 0x3B
#define MAX_BLOCKS 4096
#define GCT_ACCESS parent.parent.parent.parent.header.gct
// Indentifier Magics
#define IMAGE_SEPERATOR_MAGIC 0x2C
#define EXTENSION_INTRODUCER_MAGIC 0x21
#define GIF_TRAILER_MAGIC 0x3B
#include <std/io.pat>
#include <std/core.pat>
#include <std/mem.pat>
#include <std/string.pat>
#include <std/math.pat>
#pragma MIME image/gif
#include <type/magic.pat>
bitfield GCT_Flags {
size : 3 [[comment("physical size = 2^(flags.size + 1)")]];
@@ -23,106 +26,114 @@ bitfield GCT_Flags {
enabled : 1;
};
bitfield LCT_Flags {
size : 3 [[comment("physical size = 2^(flags.size + 1)")]];
padding : 2;
sort : 1 [[comment("Indicates if the table is sorted by importance")]];
interlace : 1;
enable : 1;
bitfield ImageDescriptorFlags {
lctSize: 3;
reserved: 2;
lctSort: 1;
interlaceFlag: 1;
lctEnable: 1;
};
bitfield GC_Flags {
bitfield GCE_Flags {
transparent : 1;
userInput : 1;
disposalMode : 3 [[format("format::dispose_enum")]];
reserved : 3;
};
struct color {
u8 r, g, b;
} [[color(std::format("{:02X}{:02X}{:02X}", r, g, b))]];
struct Color {
u8 red;
u8 green;
u8 blue;
} [[color(std::format("{:02X}{:02X}{:02X}", red, green, blue))]];
struct subblock {
u8 size;
if(size == 0) break;
u8 data[size];
struct _SubBlocks {
u8 data_size;
u8 data[data_size];
};
struct block {
subblock blocks[MAX_BLOCKS];
};
fn exp2(auto n) {
return 1 << n;
struct DataSubBlocks {
_SubBlocks subBlocks[while(std::mem::read_unsigned($, 1) != 0)];
};
struct Header {
char magic[3];
type::Magic<"GIF"> magic;
char version[3];
};
struct LogicalScreenDescriptor {
u16 width;
u16 height;
GCT_Flags gctFlags;
u8 bgColorIndex;
u8 pixelAscpet;
if (gctFlags.enabled) {
color gct[(exp2(gctFlags.size + 1))];
color bgColor = gct[bgColorIndex];
Color gct[std::math::pow(2, gctFlags.size + 1)];
}
};
};
struct frame {
u16 x;
u16 y;
u16 width;
u16 height;
LCT_Flags lctFlags;
if(lctFlags.enable) {
color lct[(exp2(lctFlags.size + 1))];
struct ImageDescriptor {
u16 imageLeftPosition;
u16 imageTopPosition;
u16 imageWidth;
u16 imageHeight;
ImageDescriptorFlags flags;
if(flags.lctEnable) {
Color lct[std::math::pow(2, flags.lctSize + 1)];
}
u8 lzwMinCode [[comment("This byte determines the initial number of bits used for LZW codes in the image data")]];
block lzwCompressedData [[comment("Data is pallet indecies either into current LDC or GCT and is compressed using LZW")]];
DataSubBlocks lzwCompressedData [[comment("Data is pallet indecies either into current LDC or GCT and is compressed using LZW")]];
};
struct comment {
block data [[hidden]];
char comment[] @ addressof(data.blocks) + 1; // TODO : need to find a better way of doing this
struct CommentExtension {
DataSubBlocks commentData;
};
struct application {
u8 blockSize [[hidden]];
char identifier[8] [[comment("Only known are: NETSCAPE")]];
char version[3] [[comment("Only known for NETSCAPE: '2.0'")]];
block b [[hidden]];
if(identifier == LABEL_APPLICATION_NETSCAPE) {
u16 loopcount @ addressof(b.blocks[0].data) + 1 [[comment("0, = Forever")]];
}
struct ApplicationExtension {
u8 blockSize;
char identifier[8];
char authenticationCode[3];
DataSubBlocks applicationData;
};
struct plaintext {
u8 blockSize [[hidden]];
u16 gridLeftPos;
u16 gridTopPos;
u16 gridWidth;
u16 gridHeight;
u8 cellWidth;
u8 cellHeight;
u8 textForegroundColorIndex [[hidden]];
u8 textBackgroundColorIndex [[hidden]];
color textForegroundColor @ addressof(GCT_ACCESS[textForegroundColorIndex]);
color textBackgroundColor @ addressof(GCT_ACCESS[textBackgroundColorIndex]);
block data [[hidden]];
char text[] @ addressof(data.blocks) + 1;
//char text[data.blocks[std::core::array_index()].size] @ addressof(data.blocks[std::core::array_index()].data);
struct PlainTextExtension {
u8 blockSize;
u16 textGridLeftPos;
u16 textGridTopPos;
u16 textGridWidth;
u16 textGridHeight;
u8 charCellWidth;
u8 charCellHeight;
u8 textForegroundColorIndex;
u8 textBackgroundColorIndex;
DataSubBlocks plainTextData;
};
struct graphical_control {
u8 blockSize [[hidden]];
GC_Flags flags;
struct GraphicControlExtension {
u8 blockSize;
std::assert_warn(blockSize == 4, "Unexpected GCE block size");
GCE_Flags flags;
u16 delay [[format("format::delay")]];
u8 transparentColorIndex;
block b [[hidden]];
};
struct Extension {
u8 label [[format("format::extension_name")]];
if(label == LABEL_GC) GraphicControlExtension gce [[inline]];
if(label == LABEL_COMMENT) CommentExtension c [[inline]];
if(label == LABEL_APPLICATION) ApplicationExtension a [[inline]];
if(label == LABEL_PLAINTEXT) PlainTextExtension p [[inline]];
};
struct Block {
u8 identifier [[format("format::identifier_name")]];
if(identifier == IMAGE_SEPERATOR_MAGIC) ImageDescriptor i [[inline]];
if(identifier == EXTENSION_INTRODUCER_MAGIC) Extension e [[inline]];
if(identifier == GIF_TRAILER_MAGIC) break;
u8 blockTerminator;
} [[format("format::block_name")]];
namespace format {
fn dispose_enum(u8 value) {
if(value == 0x00) return "Do nothing";
@@ -139,11 +150,18 @@ namespace format {
return "Unknown Extension";
};
fn content_name(ref frame f) {
if(f.code == CODE_FRAME) return "Frame";
if(f.code == CODE_EXTENSION) return "Extension";
if(f.code == CODE_TRAILER) return "End";
return "Unknown Content";
fn block_name(ref Block b) {
if(b.identifier == IMAGE_SEPERATOR_MAGIC) return "Image Descriptor";
if(b.identifier == EXTENSION_INTRODUCER_MAGIC) return "Extension";
if(b.identifier == GIF_TRAILER_MAGIC) return "Trailer";
return "Unknown Block Type";
};
fn identifier_name(u8 identifier) {
if(identifier == IMAGE_SEPERATOR_MAGIC) return "Image Separator";
if(identifier == EXTENSION_INTRODUCER_MAGIC) return "Extension Introducer";
if(identifier == GIF_TRAILER_MAGIC) return "GIF Trailer";
return "Unknown Identifier";
};
fn delay(u16 delay) {
@@ -154,28 +172,12 @@ namespace format {
};
}
struct extension {
u8 label [[format("format::extension_name")]];
if(label == LABEL_GC) graphical_control gc [[inline]];
if(label == LABEL_COMMENT) comment c [[inline]];
if(label == LABEL_APPLICATION) application a [[inline]];
if(label == LABEL_PLAINTEXT) plaintext [[inline]];
};
struct content {
u8 code [[hidden]];
if(code == CODE_FRAME) frame f [[inline]];
if(code == CODE_EXTENSION) extension e [[inline]];
if(code == CODE_TRAILER) break;
} [[format("format::content_name")]];
struct Data {
content contents[while(!std::mem::eof())] [[inline]];
};
struct Gif {
u8 data[std::mem::size()] [[no_unique_address, hidden]];
Header header;
Data data;
};
std::assert_warn(header.version == "89a" || header.version == "87a", "Unsupported format version");
LogicalScreenDescriptor logicalScreenDescriptor;
Block blocks[while(!std::mem::eof())];
} [[hex::visualize("image", this.data)]];
Gif gif @ 0x00;

View File

@@ -1,5 +1,7 @@
#pragma endian big
#pragma pattern_limit 100000000
#pragma MIME application/x-java-applet
#include <std/string.pat>
#include <std/math.pat>
#include <std/core.pat>
@@ -141,6 +143,234 @@ namespace fmt {
(_): return fmt::const_ref(index);
}
};
fn byte_code_fmt(auto value) {
match(value) {
(00): return "nop";
(01): return "aconst_null";
(02): return "iconst_m1";
(03): return "iconst_0";
(04): return "iconst_1";
(05): return "iconst_2";
(06): return "iconst_3";
(07): return "iconst_4";
(08): return "iconst_5";
(09): return "lconst_0";
(10): return "lconst_1";
(11): return "fconst_0";
(12): return "fconst_1";
(13): return "fconst_2";
(14): return "dconst_0";
(15): return "dconst_1";
(16): return "bipush";
(17): return "sipush";
(18): return "ldc";
(19): return "ldc_w";
(20): return "ldc2_w";
(21): return "iload";
(22): return "lload";
(23): return "fload";
(24): return "dload";
(25): return "aload";
(26): return "iload_0";
(27): return "iload_1";
(28): return "iload_2";
(29): return "iload_3";
(30): return "lload_0";
(31): return "lload_1";
(32): return "lload_2";
(33): return "lload_3";
(34): return "fload_0";
(35): return "fload_1";
(36): return "fload_2";
(37): return "fload_3";
(38): return "dload_0";
(39): return "dload_1";
(40): return "dload_2";
(41): return "dload_3";
(42): return "aload_0";
(43): return "aload_1";
(44): return "aload_2";
(45): return "aload_3";
(46): return "iaload";
(47): return "laload";
(48): return "faload";
(49): return "daload";
(50): return "aaload";
(51): return "baload";
(52): return "caload";
(53): return "saload";
(54): return "istore";
(55): return "lstore";
(56): return "fstore";
(57): return "dstore";
(58): return "astore";
(59): return "istore_0";
(60): return "istore_1";
(61): return "istore_2";
(62): return "istore_3";
(63): return "lstore_0";
(64): return "lstore_1";
(65): return "lstore_2";
(66): return "lstore_3";
(67): return "fstore_0";
(68): return "fstore_1";
(69): return "fstore_2";
(70): return "fstore_3";
(71): return "dstore_0";
(72): return "dstore_1";
(73): return "dstore_2";
(74): return "dstore_3";
(75): return "astore_0";
(76): return "astore_1";
(77): return "astore_2";
(78): return "astore_3";
(79): return "iastore";
(80): return "lastore";
(81): return "fastore";
(82): return "dastore";
(83): return "aastore";
(84): return "bastore";
(85): return "castore";
(86): return "sastore";
(87): return "pop";
(88): return "pop2";
(89): return "dup";
(90): return "dup_x1";
(91): return "dup_x2";
(92): return "dup2";
(93): return "dup2_x1";
(94): return "dup2_x2";
(95): return "swap";
(96): return "iadd";
(97): return "ladd";
(98): return "fadd";
(99): return "dadd";
(100): return "isub";
(101): return "lsub";
(102): return "fsub";
(103): return "dsub";
(104): return "imul";
(105): return "lmul";
(106): return "fmul";
(107): return "dmul";
(108): return "idiv";
(109): return "ldiv";
(110): return "fdiv";
(111): return "ddiv";
(112): return "irem";
(113): return "lrem";
(114): return "frem";
(115): return "drem";
(116): return "ineg";
(117): return "lneg";
(118): return "fneg";
(119): return "dneg";
(120): return "ishl";
(121): return "lshl";
(122): return "ishr";
(123): return "lshr";
(124): return "iushr";
(125): return "lushr";
(126): return "iand";
(127): return "land";
(128): return "ior";
(129): return "lor";
(130): return "ixor";
(131): return "lxor";
(132): return "iinc";
(133): return "i2l";
(134): return "i2f";
(135): return "i2d";
(136): return "l2i";
(137): return "l2f";
(138): return "l2d";
(139): return "f2i";
(140): return "f2l";
(141): return "f2d";
(142): return "d2i";
(143): return "d2l";
(144): return "d2f";
(145): return "i2b";
(146): return "i2c";
(147): return "i2s";
(148): return "lcmp";
(149): return "fcmpl";
(150): return "fcmpg";
(151): return "dcmpl";
(152): return "dcmpg";
(153): return "ifeq";
(154): return "ifne";
(155): return "iflt";
(156): return "ifge";
(157): return "ifgt";
(158): return "ifle";
(159): return "if_icmpeq";
(160): return "if_icmpne";
(161): return "if_icmplt";
(162): return "if_icmpge";
(163): return "if_icmpgt";
(164): return "if_icmple";
(165): return "if_acmpeq";
(166): return "if_acmpne";
(167): return "goto";
(168): return "jsr";
(169): return "ret";
(170): return "tableswitch";
(171): return "lookupswitch";
(172): return "ireturn";
(173): return "lreturn";
(174): return "freturn";
(175): return "dreturn";
(176): return "areturn";
(177): return "return";
(178): return "getstatic";
(179): return "putstatic";
(180): return "getfield";
(181): return "putfield";
(182): return "invokevirtual";
(183): return "invokespecial";
(184): return "invokestatic";
(185): return "invokeinterface";
(186): return "invokedynamic";
(187): return "new";
(188): return "newarray";
(189): return "anewarray";
(190): return "arraylength";
(191): return "athrow";
(192): return "checkcast";
(193): return "instanceof";
(194): return "monitorenter";
(195): return "monitorexit";
(196): return "wide";
(197): return "multianewarray";
(198): return "ifnull";
(199): return "ifnonnull";
(200): return "goto_w";
(201): return "jsr_w";
(202): return "breakpoint";
(254): return "impdep1";
(255): return "impdep2";
(_): return std::format("{:d} [Unknown]", value);
}
};
fn atype_fmt(auto atype) {
match(atype) {
(4): return "T_BOOLEAN";
(5): return "T_CHAR";
(6): return "T_FLOAT";
(7): return "T_DOUBLE";
(8): return "T_BYTE";
(9): return "T_SHORT";
(10): return "T_INT";
(11): return "T_LONG";
}
};
fn instruction_code_fmt(ref auto code) {
return fmt::byte_code_fmt(code.mnemonic);
};
fn attribute(auto info) {
return file.constant_pool[info.attribute_name_index-1].bytes;
@@ -381,13 +611,13 @@ struct attribute_exception {
struct inner_class {
cp_ref inner_class_info_index;
u16 __ [[hidden]];
if(__ != 0) {
cp_ref outer_class_info_index @ addressof(__);
u16 potential_outer_class_info_index [[hidden]];
if(potential_outer_class_info_index != 0) {
cp_ref outer_class_info_index @ addressof(potential_outer_class_info_index);
}
u16 ___ [[hidden]];
if(___ != 0) {
cp_ref inner_name_index @ addressof(___);
u16 potential_inner_name_index [[hidden]];
if(potential_inner_name_index != 0) {
cp_ref inner_name_index @ addressof(potential_inner_name_index);
}
u2 inner_class_access_flags;
};
@@ -604,9 +834,9 @@ struct attribute_bootstrap_methods {
};
struct method_parameter {
u2 name_index [[hidden]];
if (name_index != 0) {
cp_ref name_index @ addressof(name_index);
u2 potential_name_index [[hidden]];
if (potential_name_index != 0) {
cp_ref name_index @ addressof(potential_name_index);
}
u2 access_flags;
};
@@ -619,9 +849,9 @@ struct attribute_method_parameters {
struct require {
cp_ref require_index;
access_flags_module require_flags;
u2 require_version_index [[hidden]];
if (require_version_index != 0) {
cp_ref require_version_index @ addressof(require_version_index);
u2 potential_require_version_index [[hidden]];
if (potential_require_version_index != 0) {
cp_ref require_version_index @ addressof(potential_require_version_index);
}
};
@@ -648,9 +878,9 @@ struct provide {
struct attribute_module {
cp_ref module_name_index;
u2 module_flags;
u2 module_version_index [[hidden]];
if (module_version_index != 0) {
cp_ref module_version_index @ addressof(module_version_index);
u2 potential_module_version_index [[hidden]];
if (potential_module_version_index != 0) {
cp_ref module_version_index @ addressof(potential_module_version_index);
}
u2 requires_count;
require requires[requires_count];
@@ -748,11 +978,86 @@ struct exception {
u2 catch_type;
} [[static]];
struct match_offset {
u4 match_case;
u4 offset;
};
struct instruction {
u1 mnemonic [[format("fmt::byte_code_fmt")]];
match(mnemonic) {
(0 ... 15 | 26 ... 53 | 59 ... 131 | 133 ... 152 | 172 ... 177 | 190 | 191 | 194 | 195): {}
(16): {
u1 byte;
}
(17): {
u2 value;
}
(18):{
u1 index [[format("fmt::const_ref_top")]];
}
(19|20 | 178 ... 184 | 187 | 189 | 192 | 193): {
cp_ref cp_index;
}
(21 ... 25 | 54 ... 58 | 169): {
u1 local_index;
}
(132): {
u1 local_index;
u1 const_;
}
(153 ... 168 | 198 | 199): {
u2 branch_offset;
}
(185): {
cp_ref index;
u1 count;
padding[1];
}
(186): {
cp_ref cp_index;
padding[2];
}
(188): {
u1 atype [[format("fmt::atype_fmt")]];
}
(196): {
u1 op_code [[format("fmt::byte_code_fmt")]];
u2 local_index;
if(op_code == 132){
u2 const_byte;
}
}
(197): {
cp_ref cp_index;
u1 dimensions;
}
(200 | 201): {
u4 branch_offset;
}
(170): {
padding[(4 - ($ - addressof(parent) -8) % 4) % 4];
u4 default_offset;
u4 low;
u4 high;
u4 jump_offset[high-low+1];
}
(171): {
padding[(4 - ($ - addressof(parent) -8) % 4) % 4];
u4 default_offset;
u4 npairs;
match_offset match_offsets[npairs];
}
}
} [[format("fmt::instruction_code_fmt")]];
struct attribute_code {
u2 max_stack;
u2 max_locals;
u4 code_length;
u1 code[code_length];
u4 target_addr = $ + code_length;
instruction code[while($ < target_addr)];
u2 exception_table_length;
exception exception_table[exception_table_length];
u2 attributes_count;
@@ -795,4 +1100,4 @@ struct ClassFile {
attribute_info<constant_pool> attributes[attributes_count];
};
ClassFile file @ 0x0;
ClassFile file @ 0x0;

View File

@@ -119,4 +119,4 @@ struct Segment {
}
};
Segment segments[while(!std::mem::eof())] @ 0x00;
Segment segments[while(!std::mem::eof())] @ 0x00 [[hex::visualize("image", this)]];

View File

@@ -8,6 +8,7 @@ enum Magic : u32 {
};
enum CpuType : u32 {
ANY = -1,
VAX = 1,
ROMP = 2,
BS32032 = 4,
@@ -17,14 +18,16 @@ enum CpuType : u32 {
X86_64 = CpuType::I386 | 0x100'0000,
MIPS = 8,
NS32532 = 9,
MC98000 = 10,
HPPA = 11,
ARM = 12,
ARM64 = CpuType::ARM | 0x100'0000,
ARM64_32 = CpuType::ARM | 0x200'0000,
MC88000 = 13,
SPARC = 14,
I860 = be u32(15),
I860_LITTLE = 16,
RS6000 = 17,
MC980000 = 18,
POWERPC = 18,
POWERPC64 = CpuType::POWERPC | 0x100'0000,
VEO = 255

View File

@@ -1,72 +1,278 @@
#include <std/core.pat>
#pragma MIME audio/midi
#pragma endian big
using Delta = u8;
using NoteValue = u8;
using Velocity = u8;
using EOF = u8;
// this is just for debugging midi file generation
// I'm testing a known good file against a bad one
// the file is hard coded in file format 0, and if
// you're expecting meta events anywhere add a specific
// call for those
// Only supports format 0
// https://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html
enum NoteEvent : u8 {
NoteOn = 0x90,
NoteOff = 0x80
bool g_has_more_messages = true;
bool g_has_more_tracks = true;
fn signed14(s16 n) {
// Converts to 14-bit in range 0..16383. Note that MIDI data bytes
// have their first (most significant) bit clear (0), thus each byte
// is in range 0..127
n = ((n & 0x7f) << 7) | ((n >> 8) & 0x7f);
if (n >= 0) {
n -= 0x2000;
}
return n;
};
enum MetaFlag : u16 {
Footer = 0xFF2F,
KeySigEvent = 0xFF59,
TimeSigEvent = 0xFF58,
TempoEvent = 0xFF51,
TrackNameEvent = 0xFF03
fn u32ify(u32 vlq) {
// Converts from variable-length quantity to u32. These numbers are
// represented 7 bits per byte, most significant bits first. All bytes
// except the last have bit 7 set, and the last byte has bit 7 clear.
// If the number is in range 0..127, it is thus represented exactly
// as one byte.
u32 n = vlq & 0x7f;
if (vlq & 0x8000 == 0x8000) {
n += ((vlq & 0x7f00) >> 8) * 0x80;
}
if (vlq & 0x800000 == 0x800000) {
n += ((vlq & 0x7f0000) >> 8 * 2) * 0x80 * 0x80;
}
if (vlq & 0x80000000 == 0x80000000) {
n += ((vlq & 0x7f000000) >> 8 * 3) * 0x80 * 0x80 * 0x80;
}
return n;
};
enum Status : u8 {
NoteOff = 0x80 ... 0x8F,
NoteOn = 0x90 ... 0x9F,
PolyphonicAfterTouch = 0xA0 ... 0xAF,
ControlChange = 0xB0 ... 0xBF,
ProgramChange = 0xC0 ... 0xCF,
ChannelAfterTouch = 0xD0 ... 0xDF,
PitchWheel = 0xE0 ... 0xEF,
SysEx = 0xF0,
TimeCodeQtrFrame = 0xF1,
SongPositionPointer = 0xF2,
SongSelect = 0xF3,
Undefined = 0xF4 ... 0xF5,
TuneRequest = 0xF6,
EndOfSysEx = 0xF7,
TimingClock = 0xF8,
Undefined = 0xF9,
Start = 0xFA,
Continue = 0xFB,
Stop = 0xFC,
Undefined = 0xFD,
ActiveSensing = 0xFE,
MetaEvent = 0xFF,
};
Status g_next_status;
enum MetaType : u8 {
SequenceNumber = 0x00,
Text = 0x01,
CopyrightNotice = 0x02,
TrackName = 0x03,
InstrumentName = 0x04,
Lyric = 0x05,
Marker = 0x06,
CuePoint = 0x07,
ChannelPrefix = 0x20,
EndOfTrack = 0x2F,
SetTempo = 0x51,
SMPTEOffset = 0x54,
TimeSignature = 0x58,
KeySignature = 0x59,
SequencerSpecific = 0x7F
};
enum ControlChangeType : u8 {
Bank_Select_MSB = 0,
Modulation_Wheel_MSB = 1,
Breath_Controller_MSB = 2,
Undefined_MSB = 3,
Foot_Pedal_MSB = 4,
Portamento_Time_MSB = 5,
Data_Entry_MSB = 6,
Volume_MSB = 7,
Balance_MSB = 8,
Undefined_MSB = 9,
Pan_MSB = 10,
Expression_MSB = 11,
Effect_Controller_1_MSB = 12,
Effect_Controller_2_MSB = 13,
Undefined_MSB = 14,
Undefined_MSB = 15,
General_Purpose_MSB = 16 ... 19,
Undefined_MSB = 20 ... 31,
Bank_Select_LSB = 32,
Modulation_Wheel_LSB = 33,
Breath_Controller_LSB = 34,
Undefined_LSB = 35,
Foot_Pedal_LSB = 36,
Portamento_Time_LSB = 37,
Data_Entry_LSB = 38,
Volume_LSB = 39,
Balance_LSB = 40,
Undefined_LSB = 41,
Pan_LSB = 42,
Expression_LSB = 43,
Effect_Controller_1_LSB = 44,
Effect_Controller_2_LSB = 45,
Undefined_LSB = 46,
Undefined_LSB = 47,
General_Purpose_LSB = 48 ... 51,
Undefined_LSB = 52 ... 63,
Damper_Pedal = 64,
Portamento = 65,
Sostenuto_Pedal = 66,
Soft_Pedal = 67,
Legato_FootSwitch = 68,
Hold_2 = 69,
Sound_Controller_1 = 70,
Sound_Controller_2 = 71,
Sound_Controller_3 = 72,
Sound_Controller_4 = 73,
Sound_Controller_6 = 75,
Sound_Controller_7 = 76,
Sound_Controller_8 = 77,
Sound_Controller_9 = 78,
Sound_Controller_10 = 79,
General_Purpose_CC_Control = 80 ... 83,
Portamento_CC_Control = 84,
Undefined = 85 ... 87,
High_Resolution_Velocity_Prefix = 88,
Effect_2_Depth = 92,
Effect_3_Depth = 93,
Effect_4_Depth = 94,
Effect_5_Depth = 95,
Data_Increment = 96,
Data_Decrement = 97,
Non_Registered_Parameter_Number_LSB = 98,
Non_Registered_Parameter_Number_MSB = 99,
Registered_Parameter_Number_LSB = 100,
Registered_Parameter_Number_MSB = 101,
Undefined = 102 ... 119,
All_Sound_Off = 120,
Reset_All_Controllers = 121,
Local_Switch = 122,
All_Notes_Off = 123,
Omni_Mode_Off = 124,
Omni_Mode_On = 125,
Mono_Mode = 126,
Poly_Mode = 127,
};
enum HeaderFlag : u32 {
MThd = 0x4D546864
};
enum TrackChunk : u32 {
enum TrackFlag : u32 {
MTrk = 0x4D54726B
};
struct TimeSigEvent {
Delta delta;
MetaFlag flag;
u16 numerator;
u8 denominator;
u8 ticks_per_click; // not used
u8 thirty_second_notes_per_crotchet;
struct VariableLengthQuantity<auto name> {
if (std::mem::read_unsigned($, 1) & 0x80 == 0x80) {
if (std::mem::read_unsigned($ + 1, 1) & 0x80 == 0x80) {
if (std::mem::read_unsigned($ + 2, 1) & 0x80 == 0x80) {
u32 value [[format("u32ify"), name(name)]];
} else {
u24 value [[format("u32ify"), name(name)]];
}
} else {
u16 value [[format("u32ify"), name(name)]];
}
} else {
u8 value [[format("u32ify"), name(name)]];
}
};
struct KeySigEvent {
Delta delta;
MetaFlag flag;
u16 key;
u8 mode;
struct MessageData {
match (u8(g_next_status) & 0xf0) {
(Status::NoteOff | Status::NoteOn): {
u8 note_number;
u8 velocity;
}
(Status::PolyphonicAfterTouch): {
u8 note_number;
u8 amount;
}
(Status::ControlChange): {
ControlChangeType cc_number;
u8 value;
}
(Status::ProgramChange): {
u8 program_number;
}
(Status::ChannelAfterTouch): {
u8 amount;
}
(Status::PitchWheel): {
s16 value [[format("signed14")]];
}
}
match (g_next_status) {
(Status::SysEx | Status::EndOfSysEx): {
// "EndOfSysEx" can appear as the last data byte in a
// system exclusive message, or as the starting byte in
// multi-packet messages
VariableLengthQuantity<"sysex_length"> sysex_length [[inline]];
u8 sysex_data[sysex_length.value];
}
(Status::SongPositionPointer): {
u8 lsb;
u8 msb;
}
(Status::SongSelect): {
u8 song_number;
}
(Status::MetaEvent): {
MetaType meta_type;
VariableLengthQuantity<"meta_length"> meta_length [[inline]];
match (meta_type) {
(MetaType::EndOfTrack): {
g_has_more_messages = false;
g_has_more_tracks = std::mem::read_unsigned($, 4) == le u32(TrackFlag::MTrk);
}
(MetaType::Text
| MetaType::CopyrightNotice
| MetaType::TrackName
| MetaType::InstrumentName
| MetaType::Lyric
| MetaType::Marker
| MetaType::CuePoint): {
char text[meta_length.value];
}
(MetaType::TimeSignature): {
u8 numerator;
u8 denominator;
u8 ticks_per_click;
u8 thirty_second_notes_per_crotchet;
}
(MetaType::KeySignature): {
u8 key;
u8 mode;
}
(MetaType::SetTempo): {
u24 micro_seconds_per_click; // default 1 million
}
(_): {
u8 meta_data[meta_length.value];
}
}
}
}
};
struct TempoEvent {
Delta delta;
MetaFlag flag;
u32 micro_seconds_per_click; // default 1 million
};
struct Message {
VariableLengthQuantity<"delta"> delta [[inline]];
struct TrackNameEvent {
Delta delta;
MetaFlag flag;
u8 length;
u8 text;
};
// Status bytes of MIDI channel messages may be omitted if the
// preceding event is a MIDI channel message with the same status
if (std::mem::read_unsigned($, 1) > 0x7f) {
Status status;
g_next_status = status;
}
struct Note {
Delta delta;
NoteEvent ne;
NoteValue note;
Velocity vel;
MessageData data [[inline]];
};
struct HeaderChunk {
@@ -75,21 +281,18 @@ struct HeaderChunk {
u16 mode;
u16 num_tracks;
u16 ticks_per_quarter;
TrackChunk chunk;
u32 track_length;
};
struct Footer {
Delta d;
MetaFlag m;
EOF eof;
struct TrackChunk {
TrackFlag flag;
u32 length;
g_has_more_messages = true;
Message messages[while(g_has_more_messages)];
};
struct MidiFile {
HeaderChunk header;
// whatever meta flags can be in here
Note notes[12]; //however many notes you're looking at
Footer f;
TrackChunk tracks[while(g_has_more_tracks)];
};
MidiFile midi_file @ 0x00;

286
patterns/mp4.hexpat Normal file
View File

@@ -0,0 +1,286 @@
#pragma endian big
#pragma MIME audio/mp4
#pragma MIME video/mp4
#pragma MIME application/mp4
#include <std/io.pat>
#include <std/mem.pat>
#include <std/string.pat>
fn to_string(auto var) {
return str(var);
};
fn format_string(auto string) {
return string.value;
};
struct string {
char value[std::mem::find_sequence_in_range(0, $, std::mem::size(), 0x00) - $];
} [[sealed, format("format_string")]];
struct BaseBox {
u64 boxSize = 0;
u64 startOffset = $;
u64 endOffset = 0;
u32 size;
char type[4];
// Calculate the size of the current box
// 1. If the size is equal to 1 -> the box size is equal to 'largeSize' attribute.
// 2. If the size is equal to 0 -> The box extends to the end of the file.
// 3. Otherwise, size is equaly to the 'size' attribute.
if (this.size == 1) {
u64 largeSize;
boxSize = largeSize;
endOffset = startOffset + boxSize;
} else if (this.size == 0) {
boxSize = std::mem::size() - startOffset;
endOffset = std::mem::size();
} else {
boxSize = size;
endOffset = startOffset + boxSize;
}
if (this.type == "uuid") {
char usertype[16];
}
};
struct FullBox : BaseBox {
u8 version;
u24 flags;
};
struct UnknownBox : BaseBox {
u8 unk[while($ != endOffset)];
};
using brand = u32 [[format("to_string")]];
struct FileTypeBox : BaseBox {
brand major_brand;
u32 minor_version;
brand compatible_brands[(endOffset - $) / sizeof(brand)];
};
struct MovieHeaderBox : FullBox {
if (this.version == 1) {
u64 creation_time;
u64 modification_time;
u32 timescale;
u64 duration;
} else { // version == 0
u32 creation_time;
u32 modification_time;
u32 timescale;
u32 duration;
}
u32 rate [[comment("Fixed point number 16.16")]];
u16 volume [[comment("Fixed point number 8.8")]];
u8 reserved[10] [[sealed]];
u32 matrix[9];
u32 preview_time;
u32 preview_duration;
u32 poster_time;
u32 selection_time;
u32 selection_duration;
u32 current_time;
u32 next_track_id;
};
struct TrackHeaderBox : FullBox {
if (this.version == 1) {
u64 creation_time;
u64 modification_time;
u32 track_id;
u32 reserved;
u64 duration;
} else { // version == 0
u32 creation_time;
u32 modification_time;
u32 track_id;
u32 reserved;
u32 duration;
}
u32 reserved_2[2] [[sealed]];
s16 layer;
s16 alternate_group;
s16 volume;
u16 reserved_3;
s32 matrix[9];
u32 width;
u32 height;
};
struct DataEntryBox : FullBox {
if (std::string::contains(this.type, "url")) {
string location;
} else if (std::string::contains(this.type, "urn")) {
string name;
string location;
} else {
std::error("Invalid DataEntryBox");
}
};
struct DataReferenceBox : FullBox {
u32 entry_count;
DataEntryBox data_entries[this.entry_count];
};
struct SubDataInformationBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("dref"): DataReferenceBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("DataInformationBox({})", box.type))]];
struct DataInformationBox : BaseBox {
SubDataInformationBox box[while($ < endOffset)] [[inline]];
};
struct HandlerBox : FullBox {
u32 component_type;
u32 handler_type;
u32 reserved[3];
char name[endOffset - $];
};
struct VideoMediaHeaderBox : FullBox {
u16 graphicsmode;
u16 opcolor[3];
};
struct SubMediaInformationBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("vmhd"): VideoMediaHeaderBox box [[inline]];
("hdlr"): HandlerBox box [[inline]];
("dinf"): DataInformationBox box [[inline]];
(_): UnknownBox box [[inline]];
// TODO: Add stbl
}
} [[name(std::format("MediaInformationBox({})", box.type))]];
struct MediaInformationBox : BaseBox {
SubMediaInformationBox box[while($ < endOffset)] [[inline]];
};
struct MediaHeaderBox : FullBox {
if (this.version == 1) {
u64 creation_time;
u64 modification_time;
u32 timescale;
u64 duration;
} else { // version==0
u32 creation_time;
u32 modification_time;
u32 timescale;
u32 duration;
}
u16 language [[comment("ISO-639-2/T language code")]];
u16 quality;
};
struct SubMediaBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("mdhd"): MediaHeaderBox box [[inline]];
("hdlr"): HandlerBox box [[inline]];
("minf"): MediaInformationBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("MediaBox({})", box.type))]];
struct MediaBox : BaseBox {
SubMediaBox box[while($ < endOffset)] [[inline]];
};
struct EditListEntry64 {
u64 segment_duration;
s64 media_time;
s16 media_rate_integer;
s16 media_rate_fraction;
};
struct EditListEntry32 {
u32 segment_duration;
s32 media_time;
s16 media_rate_integer;
s16 media_rate_fraction;
};
struct EditListBox : FullBox {
u32 entry_count;
if (this.version == 1) {
EditListEntry64 entry_list[this.entry_count];
} else { // version 0
EditListEntry32 entry_list[this.entry_count];
}
};
struct SubEditBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("elst"): EditListBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("EditBox({})", box.type))]];
struct EditBox : BaseBox {
SubEditBox box[while($ < endOffset)] [[inline]];
};
struct SubTrackBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("mdia"): MediaBox box [[inline]];
("edts"): EditBox box [[inline]];
("tkhd"): TrackHeaderBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("TrackBox({})", box.type))]];
struct TrackBox : BaseBox {
SubTrackBox box[while($ < endOffset)] [[inline]];
};
struct SubMovieBox {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("mvhd"): MovieHeaderBox box [[inline]];
("trak"): TrackBox box [[inline]];
(_): UnknownBox box [[inline]];
// TODO: Add "iods" box
}
} [[name(std::format("MovieBox({})", box.type))]];
struct MovieBox : BaseBox {
SubMovieBox box[while($ < endOffset)] [[inline]];
};
struct MediaDataBox : BaseBox {
u8 data[while($ < endOffset)] [[sealed]];
};
struct Box {
u32 type = std::mem::read_unsigned($ + 4, 4, std::mem::Endian::Big);
match (str(type)) {
("ftyp"): FileTypeBox box [[inline]];
("moov"): MovieBox box [[inline]];
("mdat"): MediaDataBox box [[inline]];
(_): UnknownBox box [[inline]];
}
} [[name(std::format("Box({})", box.type))]];
Box mp4[while(!std::mem::eof())] @ 0x0;

View File

@@ -77,7 +77,7 @@ struct Length {
u8 length;
} [[sealed, transform("transform_length"), format("transform_length")]];
fn transform_length(Length length) {
fn transform_length(ref auto length) {
return length.length;
};

View File

@@ -1,6 +1,8 @@
#pragma MIME image/png
#pragma endian big
#include <std/mem.pat>
struct header_t {
u8 highBitByte;
char signature[3];
@@ -178,6 +180,7 @@ struct chunk_set {
chunk_t chunks[while(builtin::std::mem::read_string($ + 4, 4) != "IEND")] [[inline]];
} [[inline]];
u8 visualizer[std::mem::size()] @ 0x00 [[sealed, hex::visualize("image", this)]];
header_t header @ 0x00 [[comment("PNG file signature"), name("Signature")]];
chunk_t ihdr_chunk @ 0x08 [[comment("PNG Header chunk"), name("IHDR")]];
chunk_set set @ $ [[comment("PNG Chunks"), name("Chunks"), inline]];

View File

@@ -75,5 +75,6 @@ struct Footer {
char zero;
};
u8 visualizer[std::mem::size()] @ 0x00 [[sealed, hex::visualize("image", this)]];
Header header @ 0x0;
Footer footer @ std::mem::size() - 0x1A;

318
patterns/tiff.hexpat Normal file
View File

@@ -0,0 +1,318 @@
#pragma MIME image/tiff
#pragma eval_depth 100
#include <std/io.pat>
#include <std/mem.pat>
#include <std/string.pat>
#include <std/core.pat>
#define BIG 1
#define LITTLE 2
u32 stripCount = 0;
s32 current_strip = 0;
fn get_next_strip_index(){
if (current_strip <= stripCount) {
current_strip = current_strip + 1;
return current_strip - 1;
} else {
return stripCount+1;
}
};
fn reset_counter_strip(){
current_strip = 0;
stripCount = 0;
};
fn start_counter_strip(u32 total){
current_strip = 0;
stripCount = total;
};
fn set_endian(str magic) {
if (std::string::starts_with(magic, "II")) {
std::core::set_endian(std::mem::Endian::Little);
} else if (std::string::starts_with(magic, "MM")) {
std::core::set_endian(std::mem::Endian::Big);
}
};
fn get_total_IFDs(u32 first_offset){
u32 ifd_count = 0;
u32 current_offset = first_offset;
while (current_offset != 0) {
u16 ifd_entries_count = std::mem::read_unsigned(current_offset, 2, std::core::get_endian());
current_offset = std::mem::read_unsigned(current_offset + 2 + ifd_entries_count * 12, 4, std::core::get_endian());
ifd_count = ifd_count + 1;
}
return ifd_count;
};
fn get_ifds_offsets(u32 first_offset) {
u32 total_ifds = get_total_IFDs(first_offset);
u32 index = 0;
u32 current_offset = first_offset;
u32 ifd_offsets[total_ifds];
while (current_offset != 0) {
ifd_offsets[index] = current_offset;
u16 ifd_entries_count = std::mem::read_unsigned(current_offset, 2, std::core::get_endian());
current_offset = std::mem::read_unsigned(current_offset + 2 + ifd_entries_count * 12, 4, std::core::get_endian());
index = index + 1;
}
return ifd_offsets;
};
using TIFFFieldType;
using TIFFTag;
fn get_entry_value(u32 offset, TIFFTag Tag){
u16 count = std::mem::read_unsigned(offset, 2, std::core::get_endian());
u8 step = 12;
offset = offset + 2;
while (count != 0) {
if (std::mem::read_unsigned(offset, 2, std::core::get_endian()) == Tag) {
if (std::mem::read_unsigned(offset + 2, 2, std::core::get_endian()) == TIFFFieldType::SHORT) {
return std::mem::read_unsigned(offset + 8, 2, std::core::get_endian());
} else if (std::mem::read_unsigned(offset + 2, 2, std::core::get_endian()) == TIFFFieldType::LONG) {
return std::mem::read_unsigned(offset + 8, 4, std::core::get_endian());
}
}
count = count - 1;
offset = offset + step;
}
};
struct TIFFHeader {
char Magic[2];
set_endian(Magic);
u16 Version;
u32 Offset;
};
enum TIFFFieldType : u16 {
BYTE = 1,
ASCII = 2,
SHORT = 3,
LONG = 4,
RATIONAL = 5,
SBYTE = 6,
UNDEFINED = 7,
SSHORT = 8,
SLONG = 9,
SRATIONAL = 10,
FLOAT = 11,
DOUBLE = 12
};
enum TIFFTag : u16 {
NewSubfileType = 0x00FE,
SubfileType = 0x00FF,
ImageWidth = 0x0100,
ImageLength = 0x0101,
BitsPerSample = 0x0102,
Compression = 0x0103,
PhotometricInterpretation = 0x0106,
Threshholding = 0x0107,
CellWidth = 0x0108,
CellLength = 0x0109,
FillOrder = 0x010A,
DocumentName = 0x010D,
ImageDescription = 0x010E,
Make = 0x010F,
Model = 0x0110,
StripOffsets = 0x0111,
Orientation = 0x0112,
SamplesPerPixel = 0x0115,
RowsPerStrip = 0x0116,
StripByteCounts = 0x0117,
MinSampleValue = 0x0118,
MaxSampleValue = 0x0119,
XResolution = 0x011A,
YResolution = 0x011B,
PlanarConfiguration = 0x011C,
PageName = 0x011D,
XPosition = 0x011E,
YPosition = 0x011F,
FreeOffsets = 0x0120,
FreeByteCounts = 0x0121,
GrayResponseUnit = 0x0122,
GrayResponseCurve = 0x0123,
T4Options = 0x0124,
T6Options = 0x0125,
ResolutionUnit = 0x0128,
PageNumber = 0x0129,
TransferFunction = 0x012D,
Software = 0x0131,
DateTime = 0x0132,
Artist = 0x013B,
HostComputer = 0x013C,
Predictor = 0x013D,
WhitePoint = 0x013E,
PrimaryChromaticities = 0x013F,
ColorMap = 0x0140,
HalftoneHints = 0x0141,
TileWidth = 0x0142,
TileLength = 0x0143,
TileOffsets = 0x0144,
TileByteCounts = 0x0145,
InkSet = 0x014C,
InkNames = 0x014D,
NumberOfInks = 0x014E,
DotRange = 0x0150,
TargetPrinter = 0x0151,
ExtraSamples = 0x0152,
SampleFormat = 0x0153,
SMinSampleValue = 0x0154,
SMaxSampleValue = 0x0155,
TransferRange = 0x0156,
JPEGProc = 0x0200,
JPEGInterchangeFormat = 0x0201,
JPEGInterchangeFormatLngth = 0x0202,
JPEGRestartInterval = 0x0203,
JPEGLosslessPredictors = 0x0205,
JPEGPointTransforms = 0x0206,
JPEGQTables = 0x0207,
JPEGDCTables = 0x0208,
JPEGACTables = 0x0209,
YCbCrCoefficients = 0x0211,
YCbCrSubSampling = 0x0212,
YCbCrPositioning = 0x0213,
ReferenceBlackWhite = 0x0214,
Copyright = 0x8298,
InterColorProfile = 0x8773
};
struct IFDEntry {
TIFFTag Tag;
TIFFFieldType Type;
u32 Count;
match (Type) {
(TIFFFieldType::BYTE): {
if (std::core::get_endian() == BIG){
u8 Value;
padding[3];
} else {
u32 Value;
}
}
(TIFFFieldType::ASCII): {
u32 value_offset[[hidden]];
char Value[Count] @ value_offset;
}
(TIFFFieldType::SHORT): {
if (std::core::get_endian() == BIG){
u16 Value;
padding[2];
} else {
u32 Value;
}
}
(TIFFFieldType::LONG): u32 Value;
(TIFFFieldType::RATIONAL): {
u32 value_offset[[hidden]];
u32 Numerator @ value_offset;
u32 Denominator @ value_offset + 4;
}
(TIFFFieldType::SBYTE): {
if (std::core::get_endian() == BIG){
s8 Value;
padding[3];
} else {
s32 Value;
}
}
(TIFFFieldType::UNDEFINED): {
u32 value_offset[[hidden]];
u8 Value[Count] @ value_offset;
}
(TIFFFieldType::SSHORT): {
if (std::core::get_endian() == BIG){
s16 Value;
padding[2];
} else {
s32 Value;
}
}
(TIFFFieldType::SLONG): s32 Value;
(TIFFFieldType::SRATIONAL): {
u32 value_offset[[hidden]];
s32 Numerator @ value_offset;
s32 Denominator @ value_offset + 4;
}
(TIFFFieldType::FLOAT): float Value;
(TIFFFieldType::DOUBLE): {
u32 value_offset[[hidden]];
double Value @ value_offset;
}
(_): {
padding[4];
std::print("TIFFFieldType not supported");
}
}
};
struct StripList {
u16 entry_count [[hidden]];
u32 ImageLength = get_entry_value(addressof(this), TIFFTag::ImageLength);
u32 RowsPerStrip = get_entry_value(addressof(this), TIFFTag::RowsPerStrip);
u32 StripByteCounts = get_entry_value(addressof(this), TIFFTag::StripByteCounts);
u32 StripOffsets = get_entry_value(addressof(this), TIFFTag::StripOffsets);
s32 next_strip_index = get_next_strip_index();
if ((ImageLength/RowsPerStrip) > 1) {
u32 StripOffsetsArray[ImageLength/RowsPerStrip] @ StripOffsets [[hidden]];
u32 StripByteCountsArray[ImageLength/RowsPerStrip] @ StripByteCounts [[hidden]];
u8 Strip[StripByteCountsArray[next_strip_index]] @ StripOffsetsArray[next_strip_index];
} else {
u8 Strip[StripByteCounts] @ StripOffsets;
}
if (current_strip < stripCount) {
StripList strips @ addressof(this);
} else {
reset_counter_strip();
break;
}
}[[inline]];
struct IFD {
u16 NumberDirectoryEntries;
IFDEntry DirectoryEntry[NumberDirectoryEntries];
u32 NextIFD;
u32 ImageLength = get_entry_value(addressof(this), TIFFTag::ImageLength);
u32 RowsPerStrip = get_entry_value(addressof(this), TIFFTag::RowsPerStrip);
u32 StripByteCounts = get_entry_value(addressof(this), TIFFTag::StripByteCounts);
u32 StripOffsets = get_entry_value(addressof(this), TIFFTag::StripOffsets);
u32 StripOffsetsArray[ImageLength/RowsPerStrip] @ StripOffsets;
u32 StripByteCountsArray[ImageLength/RowsPerStrip] @ StripByteCounts;
start_counter_strip(ImageLength/RowsPerStrip);
StripList ImageData[] @ addressof(this);
};
struct IFDS {
IFD IFD;
if (IFD.NextIFD > 0) {
IFDS IFD_tmp @ IFD.NextIFD;
}else {
break;
}
}[[inline]];
struct TIFFFile {
TIFFHeader Header;
set_endian(Header.Magic);
u32 total_ifds = get_total_IFDs(Header.Offset);
IFDS IFDs[total_ifds] @ Header.Offset;
};
TIFFFile File @ 0x00;

View File

@@ -51,16 +51,8 @@ int main(int argc, char **argv) {
runtime.addPragma("pattern_limit", DummyPragmaHandler);
runtime.addDefine("__PL_UNIT_TESTS__");
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
for (const auto &[level, message] : runtime.getConsoleLog()) {
runtime.setLogCallback([](auto level, const std::string &message) {
switch (level) {
using enum pl::core::LogConsole::Level;
case Debug: fmt::print(" [DEBUG] "); break;
@@ -70,7 +62,15 @@ int main(int argc, char **argv) {
}
fmt::print("{}\n", message);
}
});
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
return EXIT_FAILURE;
}

View File

@@ -52,16 +52,8 @@ int main(int argc, char **argv) {
runtime.setIncludePaths({ includePath });
runtime.addPragma("MIME", DummyPragmaHandler);
runtime.addDefine("__PL_UNIT_TESTS__");
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
for (const auto &[level, message] : runtime.getConsoleLog()) {
runtime.setLogCallback([](auto level, const std::string &message) {
switch (level) {
using enum pl::core::LogConsole::Level;
case Debug: fmt::print(" [DEBUG] "); break;
@@ -71,7 +63,16 @@ int main(int argc, char **argv) {
}
fmt::print("{}\n", message);
}
});
}
// Execute pattern
if (!runtime.executeString(patternFile.readString())) {
fmt::print("Error during execution!\n");
if (const auto &hardError = runtime.getError(); hardError.has_value())
fmt::print("Hard error: {}:{} - {}\n\n", hardError->line, hardError->column, hardError->message);
return EXIT_FAILURE;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,312 @@
{
"base": "Dark",
"colors": {
"imgui": {
"border": "#A5ADCEFF",
"border-shadow": "#B5BFE2FF",
"button": "#8CAAEE7F",
"button-active": "#BABBF1FF",
"button-hovered": "#99D1DB7F",
"check-mark": "#8CAAEEFF",
"child-background": "#292C3CFF",
"docking-empty-background": "#303446FF",
"docking-preview": "#99D1DBFF",
"drag-drop-target": "#85C1DCFF",
"frame-background": "#303446FF",
"frame-background-active": "#BABBF1FF",
"frame-background-hovered": "#99D1DB7F",
"header": "#85C1DC7F",
"header-active": "#BABBF17F",
"header-hovered": "#99D1DB7F",
"menu-bar-background": "#303446FF",
"modal-window-dim-background": "#B5BFE27F",
"nav-highlight": "#BABBF1FF",
"nav-windowing-background": "#C6D0F5FF",
"nav-windowing-highlight": "#737994FF",
"plot-histogram": "#E5C890FF",
"plot-histogram-hovered": "#EF9F767F",
"plot-lines": "#A5ADCEFF",
"plot-lines-hovered": "#F4B8E47F",
"popup-background": "#303446FF",
"resize-grip": "#838BA7FF",
"resize-grip-active": "#BABBF1FF",
"resize-grip-hovered": "#99D1DB7F",
"scrollbar-background": "#303446FF",
"scrollbar-grab": "#838BA7FF",
"scrollbar-grab-active": "#BABBF1FF",
"scrollbar-grab-hovered": "#99D1DB7F",
"separator": "#838BA7FF",
"separator-active": "#BABBF1FF",
"separator-hovered": "#99D1DB7F",
"slider-grab": "#737994FF",
"slider-grab-active": "#BABBF1FF",
"tab": "#737994FF",
"tab-active": "#BABBF17F",
"tab-hovered": "#99D1DB7F",
"tab-unfocused": "#838BA77F",
"tab-unfocused-active": "#7379947F",
"table-border-light": "#838BA7FF",
"table-border-strong": "#949CBBFF",
"table-header-background": "#737994FF",
"table-row-background": "#292C3CFF",
"table-row-background-alt": "#232634FF",
"text": "#C6D0F5FF",
"text-disabled": "#838BA7FF",
"text-selected-background": "#6268807F",
"title-background": "#292C3CFF",
"title-background-active": "#292C3CFF",
"title-background-collapse": "#292C3CFF",
"window-background": "#303446FF"
},
"imhex": {
"desc-button": "#51576DFF",
"desc-button-active": "#BABBF1FF",
"desc-button-hovered": "#99D1DB7F",
"highlight": "#A6D189FF",
"toolbar-blue": "#8CAAEEFF",
"toolbar-brown": "#F2D5CFFF",
"toolbar-gray": "#838BA7FF",
"toolbar-green": "#A6D189FF",
"toolbar-purple": "#CA9EE6FF",
"toolbar-red": "#E78284FF",
"toolbar-yellow": "#E5C890FF"
},
"imnodes": {
"box-selector": "#8CAAEEFF",
"box-selector-outline": "#8CAAEE7F",
"grid-background": "#292C3CFF",
"grid-line": "#949CBBFF",
"grid-line-primary": "#838BA7FF",
"link": "#8CAAEEFF",
"link-hovered": "#99D1DBFF",
"link-selected": "#BABBF1FF",
"mini-map-background": "#C6D0F57F",
"mini-map-background-hovered": "#B5BFE27F",
"mini-map-canvas": "#51576D7F",
"mini-map-canvas-outline": "#4145597F",
"mini-map-link": "#8CAAEEFF",
"mini-map-link-selected": "#BABBF1FF",
"mini-map-node-background": "#6268807F",
"mini-map-node-background-hovered": "#4145597F",
"mini-map-node-background-selected": "#BABBF1FF",
"mini-map-node-outline": "#838BA7FF",
"mini-map-outline": "#838BA77F",
"mini-map-outline-hovered": "#B5BFE27F",
"node-background": "#737994FF",
"node-background-hovered": "#99D1DB7F",
"node-background-selected": "#BABBF1FF",
"node-outline": "#737994FF",
"pin": "#8CAAEE7F",
"pin-hovered": "#99D1DB7F",
"title-bar": "#414559FF",
"title-bar-hovered": "#99D1DB7F",
"title-bar-selected": "#BABBF1FF"
},
"implot": {
"axis-bg": "#C6D0F521",
"axis-bg-active": "#B5BFE27F",
"axis-bg-hovered": "#A5ADCE7F",
"axis-grid": "#303446FF",
"axis-text": "#00000000",
"axis-tick": "#B5BFE27F",
"crosshairs": "#C6D0F57F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#303446FF",
"inlay-text": "#C6D0F5FF",
"legend-bg": "#737994FF",
"legend-border": "#838BA7FF",
"legend-text": "#C6D0F5FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#8CAAEE21",
"plot-border": "#00000000",
"selection": "#6268807F",
"title-text": "#C6D0F5FF"
},
"text-editor": {
"background": "#303446FF",
"breakpoint": "#E78284FF",
"char-literal": "#A6D189FF",
"comment": "#737994FF",
"current-line-edge": "#838BA77F",
"current-line-fill": "#838BA77F",
"current-line-fill-inactive": "#7379947F",
"cursor": "#F2D5CFFF",
"default": "#838BA7FF",
"error-marker": "#E782847F",
"identifier": "#949CBBFF",
"keyword": "#CA9EE6FF",
"known-identifier": "#E78284FF",
"line-number": "#838BA7FF",
"multi-line-comment": "#737994FF",
"number": "#EF9F76FF",
"preproc-identifier": "#BABBF1FF",
"preprocessor": "#A5ADCEFF",
"punctuation": "#C6D0F5FF",
"selection": "#6268807F",
"string": "#A6D189FF"
}
},
"image_postfix": "_dark",
"name": "Catppuccin Frappe",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}

View File

@@ -0,0 +1,312 @@
{
"base": "Light",
"colors": {
"imgui": {
"border": "#6C6F85FF",
"border-shadow": "#5C5F77FF",
"button": "#1E66F57F",
"button-active": "#7287FDFF",
"button-hovered": "#04A5E57F",
"check-mark": "#1E66F5FF",
"child-background": "#E6E9EFFF",
"docking-empty-background": "#EFF1F5FF",
"docking-preview": "#04A5E5FF",
"drag-drop-target": "#209FB5FF",
"frame-background": "#EFF1F5FF",
"frame-background-active": "#7287FDFF",
"frame-background-hovered": "#04A5E57F",
"header": "#209FB57F",
"header-active": "#7287FD7F",
"header-hovered": "#04A5E57F",
"menu-bar-background": "#EFF1F5FF",
"modal-window-dim-background": "#5C5F777F",
"nav-highlight": "#7287FDFF",
"nav-windowing-background": "#4C4F69FF",
"nav-windowing-highlight": "#9CA0B0FF",
"plot-histogram": "#DF8E1DFF",
"plot-histogram-hovered": "#FE640B7F",
"plot-lines": "#6C6F85FF",
"plot-lines-hovered": "#EA76CB7F",
"popup-background": "#EFF1F5FF",
"resize-grip": "#8C8FA1FF",
"resize-grip-active": "#7287FDFF",
"resize-grip-hovered": "#04A5E57F",
"scrollbar-background": "#EFF1F5FF",
"scrollbar-grab": "#8C8FA1FF",
"scrollbar-grab-active": "#7287FDFF",
"scrollbar-grab-hovered": "#04A5E57F",
"separator": "#8C8FA1FF",
"separator-active": "#7287FDFF",
"separator-hovered": "#04A5E57F",
"slider-grab": "#9CA0B0FF",
"slider-grab-active": "#7287FDFF",
"tab": "#9CA0B0FF",
"tab-active": "#7287FD7F",
"tab-hovered": "#04A5E57F",
"tab-unfocused": "#8C8FA17F",
"tab-unfocused-active": "#9CA0B07F",
"table-border-light": "#8C8FA1FF",
"table-border-strong": "#7C7F93FF",
"table-header-background": "#9CA0B0FF",
"table-row-background": "#E6E9EFFF",
"table-row-background-alt": "#DCE0E8FF",
"text": "#4C4F69FF",
"text-disabled": "#8C8FA1FF",
"text-selected-background": "#ACB0BE7F",
"title-background": "#E6E9EFFF",
"title-background-active": "#E6E9EFFF",
"title-background-collapse": "#E6E9EFFF",
"window-background": "#EFF1F5FF"
},
"imhex": {
"desc-button": "#BCC0CCFF",
"desc-button-active": "#7287FDFF",
"desc-button-hovered": "#04A5E57F",
"highlight": "#40A02BFF",
"toolbar-blue": "#1E66F5FF",
"toolbar-brown": "#DC8A78FF",
"toolbar-gray": "#8C8FA1FF",
"toolbar-green": "#40A02BFF",
"toolbar-purple": "#8839EFFF",
"toolbar-red": "#D20F39FF",
"toolbar-yellow": "#DF8E1DFF"
},
"imnodes": {
"box-selector": "#1E66F5FF",
"box-selector-outline": "#1E66F57F",
"grid-background": "#E6E9EFFF",
"grid-line": "#7C7F93FF",
"grid-line-primary": "#8C8FA1FF",
"link": "#1E66F5FF",
"link-hovered": "#04A5E5FF",
"link-selected": "#7287FDFF",
"mini-map-background": "#4C4F697F",
"mini-map-background-hovered": "#5C5F777F",
"mini-map-canvas": "#BCC0CC7F",
"mini-map-canvas-outline": "#CCD0DA7F",
"mini-map-link": "#1E66F5FF",
"mini-map-link-selected": "#7287FDFF",
"mini-map-node-background": "#ACB0BE7F",
"mini-map-node-background-hovered": "#CCD0DA7F",
"mini-map-node-background-selected": "#7287FDFF",
"mini-map-node-outline": "#8C8FA1FF",
"mini-map-outline": "#8C8FA17F",
"mini-map-outline-hovered": "#5C5F777F",
"node-background": "#9CA0B0FF",
"node-background-hovered": "#04A5E57F",
"node-background-selected": "#7287FDFF",
"node-outline": "#9CA0B0FF",
"pin": "#1E66F57F",
"pin-hovered": "#04A5E57F",
"title-bar": "#CCD0DAFF",
"title-bar-hovered": "#04A5E57F",
"title-bar-selected": "#7287FDFF"
},
"implot": {
"axis-bg": "#4C4F6921",
"axis-bg-active": "#5C5F777F",
"axis-bg-hovered": "#6C6F857F",
"axis-grid": "#EFF1F5FF",
"axis-text": "#00000000",
"axis-tick": "#5C5F777F",
"crosshairs": "#4C4F697F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#EFF1F5FF",
"inlay-text": "#4C4F69FF",
"legend-bg": "#9CA0B0FF",
"legend-border": "#8C8FA1FF",
"legend-text": "#4C4F69FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#1E66F521",
"plot-border": "#00000000",
"selection": "#ACB0BE7F",
"title-text": "#4C4F69FF"
},
"text-editor": {
"background": "#EFF1F5FF",
"breakpoint": "#D20F39FF",
"char-literal": "#40A02BFF",
"comment": "#9CA0B0FF",
"current-line-edge": "#8C8FA17F",
"current-line-fill": "#8C8FA17F",
"current-line-fill-inactive": "#9CA0B07F",
"cursor": "#DC8A78FF",
"default": "#8C8FA1FF",
"error-marker": "#D20F397F",
"identifier": "#7C7F93FF",
"keyword": "#8839EFFF",
"known-identifier": "#D20F39FF",
"line-number": "#8C8FA1FF",
"multi-line-comment": "#9CA0B0FF",
"number": "#FE640BFF",
"preproc-identifier": "#7287FDFF",
"preprocessor": "#6C6F85FF",
"punctuation": "#4C4F69FF",
"selection": "#ACB0BE7F",
"string": "#40A02BFF"
}
},
"image_postfix": "_light",
"name": "Catppuccin Latte",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}

View File

@@ -0,0 +1,312 @@
{
"base": "Dark",
"colors": {
"imgui": {
"border": "#A5ADCBFF",
"border-shadow": "#B8C0E0FF",
"button": "#8AADF47F",
"button-active": "#B7BDF8FF",
"button-hovered": "#91D7E37F",
"check-mark": "#8AADF4FF",
"child-background": "#1E2030FF",
"docking-empty-background": "#24273AFF",
"docking-preview": "#91D7E3FF",
"drag-drop-target": "#7DC4E4FF",
"frame-background": "#24273AFF",
"frame-background-active": "#B7BDF8FF",
"frame-background-hovered": "#91D7E37F",
"header": "#7DC4E47F",
"header-active": "#B7BDF87F",
"header-hovered": "#91D7E37F",
"menu-bar-background": "#24273AFF",
"modal-window-dim-background": "#B8C0E07F",
"nav-highlight": "#B7BDF8FF",
"nav-windowing-background": "#CAD3F5FF",
"nav-windowing-highlight": "#6E738DFF",
"plot-histogram": "#EED49FFF",
"plot-histogram-hovered": "#F5A97F7F",
"plot-lines": "#A5ADCBFF",
"plot-lines-hovered": "#F5BDE67F",
"popup-background": "#24273AFF",
"resize-grip": "#8087A2FF",
"resize-grip-active": "#B7BDF8FF",
"resize-grip-hovered": "#91D7E37F",
"scrollbar-background": "#24273AFF",
"scrollbar-grab": "#8087A2FF",
"scrollbar-grab-active": "#B7BDF8FF",
"scrollbar-grab-hovered": "#91D7E37F",
"separator": "#8087A2FF",
"separator-active": "#B7BDF8FF",
"separator-hovered": "#91D7E37F",
"slider-grab": "#6E738DFF",
"slider-grab-active": "#B7BDF8FF",
"tab": "#6E738DFF",
"tab-active": "#B7BDF87F",
"tab-hovered": "#91D7E37F",
"tab-unfocused": "#8087A27F",
"tab-unfocused-active": "#6E738D7F",
"table-border-light": "#8087A2FF",
"table-border-strong": "#939AB7FF",
"table-header-background": "#6E738DFF",
"table-row-background": "#1E2030FF",
"table-row-background-alt": "#181926FF",
"text": "#CAD3F5FF",
"text-disabled": "#8087A2FF",
"text-selected-background": "#5B60787F",
"title-background": "#1E2030FF",
"title-background-active": "#1E2030FF",
"title-background-collapse": "#1E2030FF",
"window-background": "#24273AFF"
},
"imhex": {
"desc-button": "#494D64FF",
"desc-button-active": "#B7BDF8FF",
"desc-button-hovered": "#91D7E37F",
"highlight": "#A6DA95FF",
"toolbar-blue": "#8AADF4FF",
"toolbar-brown": "#F4DBD6FF",
"toolbar-gray": "#8087A2FF",
"toolbar-green": "#A6DA95FF",
"toolbar-purple": "#C6A0F6FF",
"toolbar-red": "#ED8796FF",
"toolbar-yellow": "#EED49FFF"
},
"imnodes": {
"box-selector": "#8AADF4FF",
"box-selector-outline": "#8AADF47F",
"grid-background": "#1E2030FF",
"grid-line": "#939AB7FF",
"grid-line-primary": "#8087A2FF",
"link": "#8AADF4FF",
"link-hovered": "#91D7E3FF",
"link-selected": "#B7BDF8FF",
"mini-map-background": "#CAD3F57F",
"mini-map-background-hovered": "#B8C0E07F",
"mini-map-canvas": "#494D647F",
"mini-map-canvas-outline": "#363A4F7F",
"mini-map-link": "#8AADF4FF",
"mini-map-link-selected": "#B7BDF8FF",
"mini-map-node-background": "#5B60787F",
"mini-map-node-background-hovered": "#363A4F7F",
"mini-map-node-background-selected": "#B7BDF8FF",
"mini-map-node-outline": "#8087A2FF",
"mini-map-outline": "#8087A27F",
"mini-map-outline-hovered": "#B8C0E07F",
"node-background": "#6E738DFF",
"node-background-hovered": "#91D7E37F",
"node-background-selected": "#B7BDF8FF",
"node-outline": "#6E738DFF",
"pin": "#8AADF47F",
"pin-hovered": "#91D7E37F",
"title-bar": "#363A4FFF",
"title-bar-hovered": "#91D7E37F",
"title-bar-selected": "#B7BDF8FF"
},
"implot": {
"axis-bg": "#CAD3F521",
"axis-bg-active": "#B8C0E07F",
"axis-bg-hovered": "#A5ADCB7F",
"axis-grid": "#24273AFF",
"axis-text": "#00000000",
"axis-tick": "#B8C0E07F",
"crosshairs": "#CAD3F57F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#24273AFF",
"inlay-text": "#CAD3F5FF",
"legend-bg": "#6E738DFF",
"legend-border": "#8087A2FF",
"legend-text": "#CAD3F5FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#8AADF421",
"plot-border": "#00000000",
"selection": "#5B60787F",
"title-text": "#CAD3F5FF"
},
"text-editor": {
"background": "#24273AFF",
"breakpoint": "#ED8796FF",
"char-literal": "#A6DA95FF",
"comment": "#6E738DFF",
"current-line-edge": "#8087A27F",
"current-line-fill": "#8087A27F",
"current-line-fill-inactive": "#6E738D7F",
"cursor": "#F4DBD6FF",
"default": "#8087A2FF",
"error-marker": "#ED87967F",
"identifier": "#939AB7FF",
"keyword": "#C6A0F6FF",
"known-identifier": "#ED8796FF",
"line-number": "#8087A2FF",
"multi-line-comment": "#6E738DFF",
"number": "#F5A97FFF",
"preproc-identifier": "#B7BDF8FF",
"preprocessor": "#A5ADCBFF",
"punctuation": "#CAD3F5FF",
"selection": "#5B60787F",
"string": "#A6DA95FF"
}
},
"image_postfix": "_dark",
"name": "Catppuccin Macchiato",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}

View File

@@ -0,0 +1,312 @@
{
"base": "Dark",
"colors": {
"imgui": {
"border": "#A6ADC8FF",
"border-shadow": "#BAC2DEFF",
"button": "#89B4FA7F",
"button-active": "#B4BEFEFF",
"button-hovered": "#89DCEB7F",
"check-mark": "#89B4FAFF",
"child-background": "#181825FF",
"docking-empty-background": "#1E1E2EFF",
"docking-preview": "#89DCEBFF",
"drag-drop-target": "#74C7ECFF",
"frame-background": "#1E1E2EFF",
"frame-background-active": "#B4BEFEFF",
"frame-background-hovered": "#89DCEB7F",
"header": "#74C7EC7F",
"header-active": "#B4BEFE7F",
"header-hovered": "#89DCEB7F",
"menu-bar-background": "#1E1E2EFF",
"modal-window-dim-background": "#BAC2DE7F",
"nav-highlight": "#B4BEFEFF",
"nav-windowing-background": "#CDD6F4FF",
"nav-windowing-highlight": "#6C7086FF",
"plot-histogram": "#F9E2AFFF",
"plot-histogram-hovered": "#FAB3877F",
"plot-lines": "#A6ADC8FF",
"plot-lines-hovered": "#F5C2E77F",
"popup-background": "#1E1E2EFF",
"resize-grip": "#7F849CFF",
"resize-grip-active": "#B4BEFEFF",
"resize-grip-hovered": "#89DCEB7F",
"scrollbar-background": "#1E1E2EFF",
"scrollbar-grab": "#7F849CFF",
"scrollbar-grab-active": "#B4BEFEFF",
"scrollbar-grab-hovered": "#89DCEB7F",
"separator": "#7F849CFF",
"separator-active": "#B4BEFEFF",
"separator-hovered": "#89DCEB7F",
"slider-grab": "#6C7086FF",
"slider-grab-active": "#B4BEFEFF",
"tab": "#6C7086FF",
"tab-active": "#B4BEFE7F",
"tab-hovered": "#89DCEB7F",
"tab-unfocused": "#7F849C7F",
"tab-unfocused-active": "#6C70867F",
"table-border-light": "#7F849CFF",
"table-border-strong": "#9399B2FF",
"table-header-background": "#6C7086FF",
"table-row-background": "#181825FF",
"table-row-background-alt": "#11111BFF",
"text": "#CDD6F4FF",
"text-disabled": "#7F849CFF",
"text-selected-background": "#585B707F",
"title-background": "#181825FF",
"title-background-active": "#181825FF",
"title-background-collapse": "#181825FF",
"window-background": "#1E1E2EFF"
},
"imhex": {
"desc-button": "#45475AFF",
"desc-button-active": "#B4BEFEFF",
"desc-button-hovered": "#89DCEB7F",
"highlight": "#A6E3A1FF",
"toolbar-blue": "#89B4FAFF",
"toolbar-brown": "#F5E0DCFF",
"toolbar-gray": "#7F849CFF",
"toolbar-green": "#A6E3A1FF",
"toolbar-purple": "#CBA6F7FF",
"toolbar-red": "#F38BA8FF",
"toolbar-yellow": "#F9E2AFFF"
},
"imnodes": {
"box-selector": "#89B4FAFF",
"box-selector-outline": "#89B4FA7F",
"grid-background": "#181825FF",
"grid-line": "#9399B2FF",
"grid-line-primary": "#7F849CFF",
"link": "#89B4FAFF",
"link-hovered": "#89DCEBFF",
"link-selected": "#B4BEFEFF",
"mini-map-background": "#CDD6F47F",
"mini-map-background-hovered": "#BAC2DE7F",
"mini-map-canvas": "#45475A7F",
"mini-map-canvas-outline": "#3132447F",
"mini-map-link": "#89B4FAFF",
"mini-map-link-selected": "#B4BEFEFF",
"mini-map-node-background": "#585B707F",
"mini-map-node-background-hovered": "#3132447F",
"mini-map-node-background-selected": "#B4BEFEFF",
"mini-map-node-outline": "#7F849CFF",
"mini-map-outline": "#7F849C7F",
"mini-map-outline-hovered": "#BAC2DE7F",
"node-background": "#6C7086FF",
"node-background-hovered": "#89DCEB7F",
"node-background-selected": "#B4BEFEFF",
"node-outline": "#6C7086FF",
"pin": "#89B4FA7F",
"pin-hovered": "#89DCEB7F",
"title-bar": "#313244FF",
"title-bar-hovered": "#89DCEB7F",
"title-bar-selected": "#B4BEFEFF"
},
"implot": {
"axis-bg": "#CDD6F421",
"axis-bg-active": "#BAC2DE7F",
"axis-bg-hovered": "#A6ADC87F",
"axis-grid": "#1E1E2EFF",
"axis-text": "#00000000",
"axis-tick": "#BAC2DE7F",
"crosshairs": "#CDD6F47F",
"error-bar": "#00000000",
"fill": "#00000000",
"frame-bg": "#1E1E2EFF",
"inlay-text": "#CDD6F4FF",
"legend-bg": "#6C7086FF",
"legend-border": "#7F849CFF",
"legend-text": "#CDD6F4FF",
"line": "#00000000",
"marker-fill": "#00000000",
"marker-outline": "#00000000",
"plot-bg": "#89B4FA21",
"plot-border": "#00000000",
"selection": "#585B707F",
"title-text": "#CDD6F4FF"
},
"text-editor": {
"background": "#1E1E2EFF",
"breakpoint": "#F38BA8FF",
"char-literal": "#A6E3A1FF",
"comment": "#6C7086FF",
"current-line-edge": "#7F849C7F",
"current-line-fill": "#7F849C7F",
"current-line-fill-inactive": "#6C70867F",
"cursor": "#F5E0DCFF",
"default": "#7F849CFF",
"error-marker": "#F38BA87F",
"identifier": "#9399B2FF",
"keyword": "#CBA6F7FF",
"known-identifier": "#F38BA8FF",
"line-number": "#7F849CFF",
"multi-line-comment": "#6C7086FF",
"number": "#FAB387FF",
"preproc-identifier": "#B4BEFEFF",
"preprocessor": "#A6ADC8FF",
"punctuation": "#CDD6F4FF",
"selection": "#585B707F",
"string": "#A6E3A1FF"
}
},
"image_postfix": "_dark",
"name": "Catppuccin Mocha",
"styles": {
"imgui": {
"alpha": 1.0,
"button-text-align": [
0.5,
0.5
],
"cell-padding": [
4.0,
2.0
],
"child-border-size": 1.0,
"child-rounding": 0.0,
"disabled-alpha": 0.6000000238418579,
"frame-border-size": 0.0,
"frame-padding": [
4.0,
3.0
],
"frame-rounding": 0.0,
"grab-min-size": 12.0,
"grab-rounding": 0.0,
"indent-spacing": 10.0,
"item-inner-spacing": [
4.0,
4.0
],
"item-spacing": [
8.0,
4.0
],
"popup-border-size": 1.0,
"popup-rounding": 0.0,
"scrollbar-rounding": 9.0,
"scrollbar-size": 14.0,
"selectable-text-align": [
0.0,
0.0
],
"tab-rounding": 4.0,
"window-border-size": 1.0,
"window-min-size": [
32.0,
32.0
],
"window-padding": [
8.0,
8.0
],
"window-rounding": 0.0,
"window-title-align": [
0.0,
0.5
]
},
"imnodes": {
"grid-spacing": 24.0,
"link-hover-distance": 10.0,
"link-line-segments-per-length": 0.10000000149011612,
"link-thickness": 3.0,
"mini-map-offset": [
4.0,
4.0
],
"mini-map-padding": [
8.0,
8.0
],
"node-border-thickness": 1.0,
"node-corner-rounding": 4.0,
"node-padding": [
8.0,
8.0
],
"pin-circle-radius": 4.0,
"pin-hover-radius": 10.0,
"pin-line-thickness": 1.0,
"pin-offset": 0.0,
"pin-quad-side-length": 7.0,
"pin-triangle-side-length": 9.5
},
"implot": {
"annotation-padding": [
2.0,
2.0
],
"digital-bit-gap": 4.0,
"digital-bit-height": 8.0,
"error-bar-size": 5.0,
"error-bar-weight": 1.5,
"fill-alpha": 1.0,
"fit-padding": [
0.0,
0.0
],
"label-padding": [
5.0,
5.0
],
"legend-inner-padding": [
5.0,
5.0
],
"legend-padding": [
10.0,
10.0
],
"legend-spacing": [
5.0,
0.0
],
"line-weight": 1.0,
"major-grid-size": [
1.0,
1.0
],
"major-tick-len": [
10.0,
10.0
],
"major-tick-size": [
1.0,
1.0
],
"marker-size": 4.0,
"marker-weight": 1.0,
"minor-alpha": 0.25,
"minor-grid-size": [
1.0,
1.0
],
"minor-tick-len": [
5.0,
5.0
],
"minor-tick-size": [
1.0,
1.0
],
"mouse-pos-padding": [
10.0,
10.0
],
"plot-border-size": 1.0,
"plot-default-size": [
400.0,
300.0
],
"plot-min-size": [
200.0,
150.0
],
"plot-padding": [
10.0,
10.0
]
}
}
}