Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,4 @@ ENV/
.idea/
# distutils MANIFEST
MANIFEST
.pytest_cache
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
modes.

- Fixed big resource leak in the Draw(im) constructor. The alternate
form (Draw(mode, size)) does not leak (reported by H�kan Karlsson).
form (Draw(mode, size)) does not leak (reported by Håkan Karlsson).

- Added Path object. Path objects can be used instead of coordinates
with the 'line' and 'polygon' primitives. Path objects can also be
Expand All @@ -181,3 +181,4 @@
- Use ImageColor.getrgb to resolve colors, if available.

(1.0 final released)

4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include aggdraw.cxx
include LICENSE.txt
recursive-include agg2 *.cpp
recursive-include agg2 *.h
recursive-include agg *.cpp
recursive-include agg *.h
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ The aggdraw module
.. image:: https://github.com/pytroll/aggdraw/actions/workflows/ci.yml/badge.svg?branch=main
:target: https://github.com/pytroll/aggdraw/actions?query=workflow%3A%22CI%22

----------------------------------------------------------------------
agg 2.4 notes
----------------------------------------------------------------------
aggdraw was ported to agg 2.4 and extended by

Dov Grobgeld <dov.grobgeld@gmail.com>
2016-05-30 Mon

----------------------------------------------------------------------
Original README
----------------------------------------------------------------------

A high-quality graphics engine for PIL, based on Maxim Shemanarev's
Anti-Grain Geometry library (from http://antigrain.com).
The aggdraw module implements the basic WCK 2D Drawing Interface on
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------
// Anti-Grain Geometry - Version 2.2
// Copyright (C) 2002-2004 Maxim Shemanarev (http://www.antigrain.com)
// Anti-Grain Geometry - Version 2.4
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
Expand Down Expand Up @@ -31,8 +31,8 @@
#include "agg_path_storage_integer.h"
#include "agg_rasterizer_scanline_aa.h"
#include "agg_conv_curve.h"
#include "agg_trans_affine.h"
#include "agg_font_cache_manager.h"
#include "agg_trans_affine.h"

namespace agg
{
Expand All @@ -55,15 +55,15 @@ namespace agg
// Set font parameters
//--------------------------------------------------------------------
void resolution(unsigned dpi);
bool load_font(const char* font_name, unsigned face_index, glyph_rendering ren_type);
bool load_font(const char* font_name, unsigned face_index, glyph_rendering ren_type,
const char* font_mem = 0, const long font_mem_size = 0);
bool attach(const char* file_name);
bool char_map(FT_Encoding map);
bool height(double h);
bool width(double w);
void transform(const trans_affine& mtx);
void transform(double xx, double xy, double yx, double yy);
void hinting(bool h);
void flip_y(bool f);
void transform(const trans_affine& affine);

// Set Gamma
//--------------------------------------------------------------------
Expand All @@ -79,8 +79,10 @@ namespace agg
const char* name() const { return m_name; }
unsigned num_faces() const;
FT_Encoding char_map() const { return m_char_map; }
double height() const { return double(m_height) / 64.0; }
double width() const { return double(m_width) / 64.0; }
double height() const { return double(m_height) / 64.0; }
double width() const { return double(m_width) / 64.0; }
double ascender() const;
double descender() const;
bool hinting() const { return m_hinting; }
bool flip_y() const { return m_flip_y; }

Expand All @@ -94,20 +96,20 @@ namespace agg
unsigned glyph_index() const { return m_glyph_index; }
unsigned data_size() const { return m_data_size; }
glyph_data_type data_type() const { return m_data_type; }
const rect& bounds() const { return m_bounds; }
const rect_i& bounds() const { return m_bounds; }
double advance_x() const { return m_advance_x; }
double advance_y() const { return m_advance_y; }
void write_glyph_to(int8u* data) const;
bool add_kerning(unsigned first, unsigned second,
double* x, double* y);
FT_Face m_cur_face; // handle to the current face object

private:
font_engine_freetype_base(const font_engine_freetype_base&);
const font_engine_freetype_base& operator = (const font_engine_freetype_base&);

void update_char_size();
void update_signature();
void update_transform();
int find_face(const char* face_name) const;

bool m_flag32;
Expand All @@ -120,7 +122,6 @@ namespace agg
char* m_signature;
unsigned m_height;
unsigned m_width;
FT_Matrix m_matrix;
bool m_hinting;
bool m_flip_y;
bool m_library_initialized;
Expand All @@ -129,17 +130,15 @@ namespace agg
char** m_face_names;
unsigned m_num_faces;
unsigned m_max_faces;
public:
FT_Face m_cur_face; // handle to the current face object
private:
int m_resolution;
glyph_rendering m_glyph_rendering;
unsigned m_glyph_index;
unsigned m_data_size;
glyph_data_type m_data_type;
rect m_bounds;
rect_i m_bounds;
double m_advance_x;
double m_advance_y;
trans_affine m_affine;

path_storage_integer<int16, 6> m_path16;
path_storage_integer<int32, 6> m_path32;
Expand Down
Loading
Loading