Giter Site home page Giter Site logo

grf's Introduction

GRF

Graphic library for Colour Maximite 2 computer. It enables simpler use of some graphic formats

Info and loaders for following formats:
General : JPG, GIF, PNG, BMP
Atari ST : PI1, PI2, PI3, PC1, PC2, PC3
C64 : DD, HED, KOA, HBM
ZX Spectrum: SCR, BSC
Also can save BMP in 8- and 16-bit colors.


FUNCTION GRF.getLuma(x AS INTEGER, y AS INTEGER, pg AS INTEGER) AS INTEGER

  • return luma of pixel(x, y, pg), 0-255

FUNCTION GRF.info(pg AS INTEGER) AS STRING

  • return MODE, BPP, y-lines, pg address, write address

SUB GRF.saveBMP(filePath AS STRING, xx AS INTEGER, yy AS INTEGER, ww AS INTEGER, hh AS INTEGER, pp AS INTEGER)

  • save BMP file from screen memory on xx,yy with size of ww,hh from page pp
  • it takes bpp from current MODE (so either 8 or 16) = makes BMP smaller than MMBASICs 24bpp

FUNCTION GRF.getImgInfo(filePath AS STRING) AS STRING

  • return info about graphic file
  • WIDTH, HEIGHT, BPP, VERSION

FUNCTION GRF.loadImg(filePath AS STRING, xx AS INTEGER, yy AS INTEGER, pg AS INTEGER, prog AS INTEGER) AS INTEGER

  • load image to x, y, page
  • optional prog will show progress bar
  • returns 0 when NOK

FUNCTION GRF.getC64info(filePath AS STRING) AS STRING

  • get info for some C64 formats

FUNCTION GRF.loadC64(filePath AS STRING, x AS INTEGER, y AS INTEGER, pg AS INTEGER, prog AS INTEGER) AS INTEGER

  • load some C64 formats to x, y, page
  • optional prog will show progress bar
  • returns 0 when NOK

FUNCTION GRF.getCMMcolor(n AS INTEGER) AS INTEGER

  • get color from standard CMM (for sprites)

FUNCTION GRF.getZXinfo(filePath AS STRING) AS STRING

  • get info for some ZX formats

FUNCTION GRF.loadZX(filePath AS STRING, x AS INTEGER, y AS INTEGER, pg AS INTEGER, prog AS INTEGER) AS INTEGER

  • load some ZX Spectrum formats to x, y, page
  • optional prog will show progress bar
  • returns 0 when NOK

FUNCTION GRF.getSTinfo(filePath AS STRING) AS STRING

  • get info for some Atari ST formats

FUNCTION GRF.loadST(filePath AS STRING, x AS INTEGER, y AS INTEGER, pg AS INTEGER, prog AS INTEGER) AS INTEGER

  • load some Atari ST formats to x, y, page
  • optional prog will show progress bar
  • returns 0 when NOK

VERSION HISTORY

v0.12

added GRF.getLuma(x, y, page)
fixed GRF.loadST - wrong colour palette

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.