<commit_before>/*
 *  libcucul++    C++ bindings for libcucul
 *  Copyright (c) 2006 <NAME> <<EMAIL>>
 *                All Rights Reserved
 *
 *  $Id$
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the Do What The Fuck You Want To
 *  Public License, Version 2, as published by Sam Hocevar. See
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
 */

/** \file cucul++.h
 *  \version \$Id$
 *  \author <NAME> <<EMAIL>>
 *  \brief The \e libcucul++ public header.
 *
 *  This header contains the public types and functions that applications
 *  using \e libcucul++ may use.
 */

#ifndef _CUCUL_PP_H
#define _CUCUL_PP_H

#include <cucul.h>


class Cucul;


class Charset
{
    unsigned long int utf8ToUtf32(char const *, unsigned int *);
    unsigned int utf32ToUtf8(char *, unsigned long int);
    unsigned char utf32ToCp437(unsigned long int);
    unsigned long int cp437ToUtf32(unsigned char);
};





/* Ugly, I know */
class Font
{
 public:
    ~Font();
    Font(void const *, unsigned int);
    char const *const * getList(void);
    unsigned int getWidth();
    unsigned int getHeight();
    void renderCanvas(Cucul *, unsigned char *, unsigned int, unsigned int, unsigned int);
    unsigned long int const *getBlocks();

 private:
    cucul_font *font;

};

class Dither
{
 public:
    Dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
    ~Dither();

    void setPalette(unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
    void setBrightness(float);
    void setGamma(float);
    void setContrast(float);
    void setInvert(int);
    void setAntialias(char const *);
    char const *const * getAntialiasList();
    void setColor(char const *);
    char const *const * getColorList();
    void setCharset(char const *);
    char const *const * getCharsetList();
    void setMode(char const *);
    char const *const * getModeList();
    void Bitmap(Cucul *, int, int, int, int, void *);

 private:
    cucul_dither *dither;

};

class Buffer
{
    friend class Cucul;
 public:
    Buffer();
    ~Buffer();
    char const *const * getExportList(void);
    void *Buffer::getData(void);
    void loadMemory(void *buf, unsigned long int size);
    void loadFile(char const *filename);
    unsigned long int getSize();

 protected:
    cucul_buffer *get_buffer();

 private:
    cucul_buffer *buffer_;
    cucul_buffer *getBuffer();
};


class Cucul
{
    friend class Caca;
    friend class Dither;
    friend class Font;
    friend class Buffer;
 public:
    Cucul();
    Cucul(int width, int height);
    Cucul(Buffer *, char const *);<commit_msg>  * Fix extra qualification bug in cucul++.h, courtesy of <NAME>.<commit_after>/*
 *  libcucul++    C++ bindings for libcucul
 *  Copyright (c) 2006 <NAME> <<EMAIL>>
 *                All Rights Reserved
 *
 *  $Id$
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the Do What The Fuck You Want To
 *  Public License, Version 2, as published by Sam Hocevar. See
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
 */

/** \file cucul++.h
 *  \version \$Id$
 *  \author <NAME> <<EMAIL>>
 *  \brief The \e libcucul++ public header.
 *
 *  This header contains the public types and functions that applications
 *  using \e libcucul++ may use.
 */

#ifndef _CUCUL_PP_H
#define _CUCUL_PP_H

#include <cucul.h>


class Cucul;


class Charset
{
    unsigned long int utf8ToUtf32(char const *, unsigned int *);
    unsigned int utf32ToUtf8(char *, unsigned long int);
    unsigned char utf32ToCp437(unsigned long int);
    unsigned long int cp437ToUtf32(unsigned char);
};





/* Ugly, I know */
class Font
{
 public:
    ~Font();
    Font(void const *, unsigned int);
    char const *const * getList(void);
    unsigned int getWidth();
    unsigned int getHeight();
    void renderCanvas(Cucul *, unsigned char *, unsigned int, unsigned int, unsigned int);
    unsigned long int const *getBlocks();

 private:
    cucul_font *font;

};

class Dither
{
 public:
    Dither(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
    ~Dither();

    void setPalette(unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[]);
    void setBrightness(float);
    void setGamma(float);
    void setContrast(float);
    void setInvert(int);
    void setAntialias(char const *);
    char const *const * getAntialiasList();
    void setColor(char const *);
    char const *const * getColorList();
    void setCharset(char const *);
    char const *const * getCharsetList();
    void setMode(char const *);
    char const *const * getModeList();
    void Bitmap(Cucul *, int, int, int, int, void *);

 private:
    cucul_dither *dither;

};

class Buffer
{
    friend class Cucul;
 public:
    Buffer();
    ~Buffer();
    char const *const * getExportList(void);
    void *getData(void);
    void loadMemory(void *buf, unsigned long int size);
    void loadFile(char const *filename);
    unsigned long int getSize();

 protected:
    cucul_buffer *get_buffer();

 private:
    cucul_buffer *buffer_;
    cucul_buffer *getBuffer();
};


class Cucul
{
    friend class Caca;
    friend class Dither;
    friend class Font;
    friend class Buffer;
 public:
    Cucul();
    Cucul(int width, int height);
    Cucul(Buffer *, char const *);
{'fraction_non_alphanumeric': 0.11473607038123167, 'fraction_numerical': 0.0076979472140762464, 'mean_word_length': 3.2566302652106085, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2168500', 'n_tokens_mistral': 1792, 'n_tokens_neox': 1715, 'n_words': 593}