mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-01 10:13:22 +00:00
Use C99 uint*_t instead of ase_uint*.
This commit is contained in:
parent
f816425d5d
commit
69dff9b5d0
4
config.h
4
config.h
@ -42,10 +42,6 @@ void verbose_printf(const char* format, ...);
|
||||
#include <allegro/base.h>
|
||||
#include <allegro/debug.h> // ASSERT
|
||||
|
||||
typedef uint8_t ase_uint8;
|
||||
typedef uint16_t ase_uint16;
|
||||
typedef uint32_t ase_uint32;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Overloaded new/delete operators to detect memory-leaks
|
||||
|
||||
|
@ -236,7 +236,7 @@ std::string Color::toFormalString(int imgtype, bool long_format) const
|
||||
case Color::IndexType: {
|
||||
int i = m_value.index;
|
||||
if (i >= 0 && i < (int)get_current_palette()->size()) {
|
||||
ase_uint32 _c = get_current_palette()->getEntry(i);
|
||||
uint32_t _c = get_current_palette()->getEntry(i);
|
||||
result << "Index " << i
|
||||
<< " (RGB "
|
||||
<< (int)_rgba_getr(_c) << " "
|
||||
@ -469,7 +469,7 @@ int Color::getHue() const
|
||||
int i = m_value.index;
|
||||
ASSERT(i >= 0 && i < get_current_palette()->size());
|
||||
|
||||
ase_uint32 c = get_current_palette()->getEntry(i);
|
||||
uint32_t c = get_current_palette()->getEntry(i);
|
||||
|
||||
return Hsv(Rgb(_rgba_getr(c),
|
||||
_rgba_getg(c),
|
||||
@ -504,7 +504,7 @@ int Color::getSaturation() const
|
||||
int i = m_value.index;
|
||||
ASSERT(i >= 0 && i < get_current_palette()->size());
|
||||
|
||||
ase_uint32 c = get_current_palette()->getEntry(i);
|
||||
uint32_t c = get_current_palette()->getEntry(i);
|
||||
|
||||
return Hsv(Rgb(_rgba_getr(c),
|
||||
_rgba_getg(c),
|
||||
@ -539,7 +539,7 @@ int Color::getValue() const
|
||||
int i = m_value.index;
|
||||
ASSERT(i >= 0 && i < get_current_palette()->size());
|
||||
|
||||
ase_uint32 c = get_current_palette()->getEntry(i);
|
||||
uint32_t c = get_current_palette()->getEntry(i);
|
||||
|
||||
return Hsv(Rgb(_rgba_getr(c),
|
||||
_rgba_getg(c),
|
||||
@ -574,7 +574,7 @@ int Color::getGray() const
|
||||
int i = m_value.index;
|
||||
ASSERT(i >= 0 && i < get_current_palette()->size());
|
||||
|
||||
ase_uint32 c = get_current_palette()->getEntry(i);
|
||||
uint32_t c = get_current_palette()->getEntry(i);
|
||||
|
||||
return 255 * Hsv(Rgb(_rgba_getr(c),
|
||||
_rgba_getg(c),
|
||||
|
@ -95,7 +95,7 @@ int color_utils::color_for_allegro(const Color& color, int depth)
|
||||
if (depth != 8) {
|
||||
ASSERT(c >= 0 && c < (int)get_current_palette()->size());
|
||||
|
||||
ase_uint32 _c = get_current_palette()->getEntry(c);
|
||||
uint32_t _c = get_current_palette()->getEntry(c);
|
||||
c = makeacol_depth(depth,
|
||||
_rgba_getr(_c),
|
||||
_rgba_getg(_c),
|
||||
|
@ -541,9 +541,9 @@ void PaletteEntryEditor::setPaletteEntry(const Color& color)
|
||||
PaletteView* palView = app_get_colorbar()->getPaletteView();
|
||||
palView->getSelectedEntries(array);
|
||||
|
||||
ase_uint32 new_pal_color = _rgba(color.getRed(),
|
||||
color.getGreen(),
|
||||
color.getBlue(), 255);
|
||||
uint32_t new_pal_color = _rgba(color.getRed(),
|
||||
color.getGreen(),
|
||||
color.getBlue(), 255);
|
||||
|
||||
Palette* palette = get_current_palette();
|
||||
for (int c=0; c<palette->size(); c++) {
|
||||
@ -558,7 +558,7 @@ void PaletteEntryEditor::setPaletteEntryChannel(const Color& color, ColorSliders
|
||||
PaletteView* palView = app_get_colorbar()->getPaletteView();
|
||||
palView->getSelectedEntries(array);
|
||||
|
||||
ase_uint32 src_color;
|
||||
uint32_t src_color;
|
||||
int r, g, b;
|
||||
|
||||
Palette* palette = get_current_palette();
|
||||
|
@ -92,10 +92,10 @@ void ScreenShotCommand::onExecute(Context* context)
|
||||
|
||||
// Convert Allegro "BITMAP" to ASE "Image".
|
||||
if (imgtype == IMAGE_RGB) {
|
||||
ase_uint32 *address;
|
||||
uint32_t* address;
|
||||
|
||||
for (y=0; y<image->h; ++y) {
|
||||
address = (ase_uint32 *)image->line[y];
|
||||
address = (uint32_t*)image->line[y];
|
||||
for (x=0; x<image->w; ++x) {
|
||||
c = getpixel(bmp, x, y);
|
||||
r = getr(c);
|
||||
@ -106,10 +106,10 @@ void ScreenShotCommand::onExecute(Context* context)
|
||||
}
|
||||
}
|
||||
else if (imgtype == IMAGE_INDEXED) {
|
||||
ase_uint8 *address;
|
||||
uint8_t* address;
|
||||
|
||||
for (y=0; y<image->h; ++y) {
|
||||
address = (ase_uint8 *)image->line[y];
|
||||
address = (uint8_t*)image->line[y];
|
||||
for (x=0; x<image->w; ++x) {
|
||||
*(address++) = getpixel(bmp, x, y);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ bool FilterManagerImpl::applyStep()
|
||||
if ((m_row >= 0) && (m_row < m_h)) {
|
||||
if ((m_mask) && (m_mask->bitmap)) {
|
||||
m_d = div(m_x-m_mask->x+m_offset_x, 8);
|
||||
m_mask_address = ((ase_uint8 **)m_mask->bitmap->line)[m_row+m_y-m_mask->y+m_offset_y]+m_d.quot;
|
||||
m_mask_address = ((uint8_t**)m_mask->bitmap->line)[m_row+m_y-m_mask->y+m_offset_y]+m_d.quot;
|
||||
}
|
||||
else
|
||||
m_mask_address = NULL;
|
||||
@ -293,9 +293,9 @@ void FilterManagerImpl::flush()
|
||||
const void* FilterManagerImpl::getSourceAddress()
|
||||
{
|
||||
switch (m_sprite->getImgType()) {
|
||||
case IMAGE_RGB: return ((ase_uint32**)m_src->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_GRAYSCALE: return ((ase_uint16**)m_src->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_INDEXED: return ((ase_uint8**)m_src->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_RGB: return ((uint32_t**)m_src->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_GRAYSCALE: return ((uint16_t**)m_src->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_INDEXED: return ((uint8_t**)m_src->line)[m_row+m_y]+m_x;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -303,9 +303,9 @@ const void* FilterManagerImpl::getSourceAddress()
|
||||
void* FilterManagerImpl::getDestinationAddress()
|
||||
{
|
||||
switch (m_sprite->getImgType()) {
|
||||
case IMAGE_RGB: return ((ase_uint32**)m_dst->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_GRAYSCALE: return ((ase_uint16**)m_dst->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_INDEXED: return ((ase_uint8**)m_dst->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_RGB: return ((uint32_t**)m_dst->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_GRAYSCALE: return ((uint16_t**)m_dst->line)[m_row+m_y]+m_x;
|
||||
case IMAGE_INDEXED: return ((uint8_t**)m_dst->line)[m_row+m_y]+m_x;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -169,8 +169,8 @@ static Image* render_text(Sprite* sprite, FONT *f, const char *text, int color)
|
||||
#define DO(type, colfunc) \
|
||||
{ \
|
||||
register int c; \
|
||||
ase_uint32 *src = (ase_uint32 *)bmp->dat; \
|
||||
type *dst = (type *)image->dat; \
|
||||
uint32_t* src = (uint32_t*)bmp->dat; \
|
||||
type* dst = (type*)image->dat; \
|
||||
for (i=0; i<pixels; i++) { \
|
||||
c = *src; \
|
||||
*dst = colfunc; \
|
||||
@ -210,17 +210,17 @@ static Image* render_text(Sprite* sprite, FONT *f, const char *text, int color)
|
||||
switch (image->imgtype) {
|
||||
|
||||
case IMAGE_RGB:
|
||||
DO(ase_uint32, _rgba(_rgba_getr(color),
|
||||
_rgba_getg(color),
|
||||
_rgba_getb(color), getg32(c)));
|
||||
DO(uint32_t, _rgba(_rgba_getr(color),
|
||||
_rgba_getg(color),
|
||||
_rgba_getb(color), getg32(c)));
|
||||
break;
|
||||
|
||||
case IMAGE_GRAYSCALE:
|
||||
DO(ase_uint16, _graya(_graya_getv(color), getg32(c)));
|
||||
DO(uint16_t, _graya(_graya_getv(color), getg32(c)));
|
||||
break;
|
||||
|
||||
case IMAGE_INDEXED:
|
||||
DO(ase_uint8, c == makecol32(255, 0, 255) ? 0: color);
|
||||
DO(uint8_t, c == makecol32(255, 0, 255) ? 0: color);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef DOCUMENT_ID_H_INCLUDED
|
||||
#define DOCUMENT_ID_H_INCLUDED
|
||||
|
||||
typedef ase_uint32 DocumentId;
|
||||
typedef uint32_t DocumentId;
|
||||
|
||||
const DocumentId WithoutDocumentId = 0;
|
||||
|
||||
|
@ -47,27 +47,27 @@ typedef struct ASE_Header
|
||||
{
|
||||
long pos;
|
||||
|
||||
ase_uint32 size;
|
||||
ase_uint16 magic;
|
||||
ase_uint16 frames;
|
||||
ase_uint16 width;
|
||||
ase_uint16 height;
|
||||
ase_uint16 depth;
|
||||
ase_uint32 flags;
|
||||
ase_uint16 speed; // Deprecated, use "duration" of FrameHeader
|
||||
ase_uint32 next;
|
||||
ase_uint32 frit;
|
||||
ase_uint8 transparent_index;
|
||||
ase_uint8 ignore[3];
|
||||
ase_uint16 ncolors;
|
||||
uint32_t size;
|
||||
uint16_t magic;
|
||||
uint16_t frames;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint16_t depth;
|
||||
uint32_t flags;
|
||||
uint16_t speed; // Deprecated, use "duration" of FrameHeader
|
||||
uint32_t next;
|
||||
uint32_t frit;
|
||||
uint8_t transparent_index;
|
||||
uint8_t ignore[3];
|
||||
uint16_t ncolors;
|
||||
} ASE_Header;
|
||||
|
||||
typedef struct ASE_FrameHeader
|
||||
{
|
||||
ase_uint32 size;
|
||||
ase_uint16 magic;
|
||||
ase_uint16 chunks;
|
||||
ase_uint16 duration;
|
||||
uint32_t size;
|
||||
uint16_t magic;
|
||||
uint16_t chunks;
|
||||
uint16_t duration;
|
||||
} ASE_FrameHeader;
|
||||
|
||||
// TODO Warning: the writing routines aren't thread-safe
|
||||
@ -744,8 +744,8 @@ class PixelIO
|
||||
public:
|
||||
typename ImageTraits::pixel_t read_pixel(FILE* f);
|
||||
void write_pixel(FILE* f, typename ImageTraits::pixel_t c);
|
||||
void read_scanline(typename ImageTraits::address_t address, int w, ase_uint8* buffer);
|
||||
void write_scanline(typename ImageTraits::address_t address, int w, ase_uint8* buffer);
|
||||
void read_scanline(typename ImageTraits::address_t address, int w, uint8_t* buffer);
|
||||
void write_scanline(typename ImageTraits::address_t address, int w, uint8_t* buffer);
|
||||
};
|
||||
|
||||
template<>
|
||||
@ -766,7 +766,7 @@ public:
|
||||
fputc(_rgba_getb(c), f);
|
||||
fputc(_rgba_geta(c), f);
|
||||
}
|
||||
void read_scanline(RgbTraits::address_t address, int w, ase_uint8* buffer)
|
||||
void read_scanline(RgbTraits::address_t address, int w, uint8_t* buffer)
|
||||
{
|
||||
for (int x=0; x<w; ++x) {
|
||||
r = *(buffer++);
|
||||
@ -776,7 +776,7 @@ public:
|
||||
*(address++) = _rgba(r, g, b, a);
|
||||
}
|
||||
}
|
||||
void write_scanline(RgbTraits::address_t address, int w, ase_uint8* buffer)
|
||||
void write_scanline(RgbTraits::address_t address, int w, uint8_t* buffer)
|
||||
{
|
||||
for (int x=0; x<w; ++x) {
|
||||
*(buffer++) = _rgba_getr(*address);
|
||||
@ -802,7 +802,7 @@ public:
|
||||
fputc(_graya_getv(c), f);
|
||||
fputc(_graya_geta(c), f);
|
||||
}
|
||||
void read_scanline(GrayscaleTraits::address_t address, int w, ase_uint8* buffer)
|
||||
void read_scanline(GrayscaleTraits::address_t address, int w, uint8_t* buffer)
|
||||
{
|
||||
for (int x=0; x<w; ++x) {
|
||||
k = *(buffer++);
|
||||
@ -810,7 +810,7 @@ public:
|
||||
*(address++) = _graya(k, a);
|
||||
}
|
||||
}
|
||||
void write_scanline(GrayscaleTraits::address_t address, int w, ase_uint8* buffer)
|
||||
void write_scanline(GrayscaleTraits::address_t address, int w, uint8_t* buffer)
|
||||
{
|
||||
for (int x=0; x<w; ++x) {
|
||||
*(buffer++) = _graya_getv(*address);
|
||||
@ -830,11 +830,11 @@ public:
|
||||
void write_pixel(FILE* f, IndexedTraits::pixel_t c) {
|
||||
fputc(c, f);
|
||||
}
|
||||
void read_scanline(IndexedTraits::address_t address, int w, ase_uint8* buffer)
|
||||
void read_scanline(IndexedTraits::address_t address, int w, uint8_t* buffer)
|
||||
{
|
||||
memcpy(address, buffer, w);
|
||||
}
|
||||
void write_scanline(IndexedTraits::address_t address, int w, ase_uint8* buffer)
|
||||
void write_scanline(IndexedTraits::address_t address, int w, uint8_t* buffer)
|
||||
{
|
||||
memcpy(buffer, address, w);
|
||||
}
|
||||
@ -888,9 +888,9 @@ static void read_compressed_image(FILE* f, Image* image, size_t chunk_end, FileO
|
||||
if (err != Z_OK)
|
||||
throw base::Exception("ZLib error %d in inflateInit().", err);
|
||||
|
||||
std::vector<ase_uint8> scanline(ImageTraits::scanline_size(image->w));
|
||||
std::vector<ase_uint8> uncompressed(image->h * ImageTraits::scanline_size(image->w));
|
||||
std::vector<ase_uint8> compressed(4096);
|
||||
std::vector<uint8_t> scanline(ImageTraits::scanline_size(image->w));
|
||||
std::vector<uint8_t> uncompressed(image->h * ImageTraits::scanline_size(image->w));
|
||||
std::vector<uint8_t> compressed(4096);
|
||||
int uncompressed_offset = 0;
|
||||
|
||||
while (true) {
|
||||
@ -960,8 +960,8 @@ static void write_compressed_image(FILE* f, Image* image)
|
||||
if (err != Z_OK)
|
||||
throw base::Exception("ZLib error %d in deflateInit().", err);
|
||||
|
||||
std::vector<ase_uint8> scanline(ImageTraits::scanline_size(image->w));
|
||||
std::vector<ase_uint8> compressed(4096);
|
||||
std::vector<uint8_t> scanline(ImageTraits::scanline_size(image->w));
|
||||
std::vector<uint8_t> compressed(4096);
|
||||
|
||||
for (y=0; y<image->h; y++) {
|
||||
typename ImageTraits::address_t address = image_address_fast<ImageTraits>(image, 0, y);
|
||||
|
@ -45,9 +45,9 @@ class BmpFormat : public FileFormat
|
||||
int format; // bmp format.
|
||||
int compression; // bmp compression.
|
||||
int bits_per_pixel; // Bits per pixel.
|
||||
ase_uint32 red_mask; // Mask for red channel.
|
||||
ase_uint32 green_mask; // Mask for green channel.
|
||||
ase_uint32 blue_mask; // Mask for blue channel.
|
||||
uint32_t red_mask; // Mask for red channel.
|
||||
uint32_t green_mask; // Mask for green channel.
|
||||
uint32_t blue_mask; // Mask for blue channel.
|
||||
};
|
||||
|
||||
const char* onGetName() const { return "bmp"; }
|
||||
@ -81,43 +81,43 @@ FileFormat* CreateBmpFormat()
|
||||
|
||||
typedef struct BITMAPFILEHEADER
|
||||
{
|
||||
ase_uint32 bfType;
|
||||
ase_uint32 bfSize;
|
||||
ase_uint16 bfReserved1;
|
||||
ase_uint16 bfReserved2;
|
||||
ase_uint32 bfOffBits;
|
||||
uint32_t bfType;
|
||||
uint32_t bfSize;
|
||||
uint16_t bfReserved1;
|
||||
uint16_t bfReserved2;
|
||||
uint32_t bfOffBits;
|
||||
} BITMAPFILEHEADER;
|
||||
|
||||
// Used for both OS/2 and Windows BMP.
|
||||
// Contains only the parameters needed to load the image.
|
||||
typedef struct BITMAPINFOHEADER
|
||||
{
|
||||
ase_uint32 biWidth;
|
||||
ase_uint32 biHeight;
|
||||
ase_uint16 biBitCount;
|
||||
ase_uint32 biCompression;
|
||||
uint32_t biWidth;
|
||||
uint32_t biHeight;
|
||||
uint16_t biBitCount;
|
||||
uint32_t biCompression;
|
||||
} BITMAPINFOHEADER;
|
||||
|
||||
typedef struct WINBMPINFOHEADER // Size: 40.
|
||||
{
|
||||
ase_uint32 biWidth;
|
||||
ase_uint32 biHeight;
|
||||
ase_uint16 biPlanes;
|
||||
ase_uint16 biBitCount;
|
||||
ase_uint32 biCompression;
|
||||
ase_uint32 biSizeImage;
|
||||
ase_uint32 biXPelsPerMeter;
|
||||
ase_uint32 biYPelsPerMeter;
|
||||
ase_uint32 biClrUsed;
|
||||
ase_uint32 biClrImportant;
|
||||
uint32_t biWidth;
|
||||
uint32_t biHeight;
|
||||
uint16_t biPlanes;
|
||||
uint16_t biBitCount;
|
||||
uint32_t biCompression;
|
||||
uint32_t biSizeImage;
|
||||
uint32_t biXPelsPerMeter;
|
||||
uint32_t biYPelsPerMeter;
|
||||
uint32_t biClrUsed;
|
||||
uint32_t biClrImportant;
|
||||
} WINBMPINFOHEADER;
|
||||
|
||||
typedef struct OS2BMPINFOHEADER // Size: 12.
|
||||
{
|
||||
ase_uint16 biWidth;
|
||||
ase_uint16 biHeight;
|
||||
ase_uint16 biPlanes;
|
||||
ase_uint16 biBitCount;
|
||||
uint16_t biWidth;
|
||||
uint16_t biHeight;
|
||||
uint16_t biPlanes;
|
||||
uint16_t biBitCount;
|
||||
} OS2BMPINFOHEADER;
|
||||
|
||||
/* read_bmfileheader:
|
||||
|
@ -662,7 +662,7 @@ void fop_sequence_set_color(FileOp *fop, int index, int r, int g, int b)
|
||||
|
||||
void fop_sequence_get_color(FileOp *fop, int index, int *r, int *g, int *b)
|
||||
{
|
||||
ase_uint32 c = fop->seq.palette->getEntry(index);
|
||||
uint32_t c = fop->seq.palette->getEntry(index);
|
||||
|
||||
*r = _rgba_getr(c);
|
||||
*g = _rgba_getg(c);
|
||||
|
@ -363,7 +363,7 @@ bool GifFormat::onSave(FileOp* fop)
|
||||
case IMAGE_RGB:
|
||||
for (int y = 0; y < sprite_h; ++y)
|
||||
for (int x = 0; x < sprite_w; ++x) {
|
||||
ase_uint32 pixel_value = image_getpixel_fast<RgbTraits>(buffer_image, x, y);
|
||||
uint32_t pixel_value = image_getpixel_fast<RgbTraits>(buffer_image, x, y);
|
||||
image_putpixel_fast<IndexedTraits>(current_image, x, y,
|
||||
(_rgba_geta(pixel_value) >= 128) ?
|
||||
current_palette->findBestfit(_rgba_getr(pixel_value),
|
||||
@ -377,7 +377,7 @@ bool GifFormat::onSave(FileOp* fop)
|
||||
case IMAGE_GRAYSCALE:
|
||||
for (int y = 0; y < sprite_h; ++y)
|
||||
for (int x = 0; x < sprite_w; ++x) {
|
||||
ase_uint16 pixel_value = image_getpixel_fast<GrayscaleTraits>(buffer_image, x, y);
|
||||
uint16_t pixel_value = image_getpixel_fast<GrayscaleTraits>(buffer_image, x, y);
|
||||
image_putpixel_fast<IndexedTraits>(current_image, x, y,
|
||||
(_graya_geta(pixel_value) >= 128) ?
|
||||
current_palette->findBestfit(_graya_getv(pixel_value),
|
||||
|
@ -52,36 +52,36 @@ FileFormat* CreateIcoFormat()
|
||||
|
||||
struct ICONDIR
|
||||
{
|
||||
ase_uint16 reserved;
|
||||
ase_uint16 type;
|
||||
ase_uint16 entries;
|
||||
uint16_t reserved;
|
||||
uint16_t type;
|
||||
uint16_t entries;
|
||||
};
|
||||
|
||||
struct ICONDIRENTRY
|
||||
{
|
||||
ase_uint8 width;
|
||||
ase_uint8 height;
|
||||
ase_uint8 color_count;
|
||||
ase_uint8 reserved;
|
||||
ase_uint16 planes;
|
||||
ase_uint16 bpp;
|
||||
ase_uint32 image_size;
|
||||
ase_uint32 image_offset;
|
||||
uint8_t width;
|
||||
uint8_t height;
|
||||
uint8_t color_count;
|
||||
uint8_t reserved;
|
||||
uint16_t planes;
|
||||
uint16_t bpp;
|
||||
uint32_t image_size;
|
||||
uint32_t image_offset;
|
||||
};
|
||||
|
||||
struct BITMAPINFOHEADER
|
||||
{
|
||||
ase_uint32 size;
|
||||
ase_uint32 width;
|
||||
ase_uint32 height;
|
||||
ase_uint16 planes;
|
||||
ase_uint16 bpp;
|
||||
ase_uint32 compression;
|
||||
ase_uint32 imageSize;
|
||||
ase_uint32 xPelsPerMeter;
|
||||
ase_uint32 yPelsPerMeter;
|
||||
ase_uint32 clrUsed;
|
||||
ase_uint32 clrImportant;
|
||||
uint32_t size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint16_t planes;
|
||||
uint16_t bpp;
|
||||
uint32_t compression;
|
||||
uint32_t imageSize;
|
||||
uint32_t xPelsPerMeter;
|
||||
uint32_t yPelsPerMeter;
|
||||
uint32_t clrUsed;
|
||||
uint32_t clrImportant;
|
||||
};
|
||||
|
||||
bool IcoFormat::onLoad(FileOp* fop)
|
||||
@ -111,7 +111,7 @@ bool IcoFormat::onLoad(FileOp* fop)
|
||||
// Read all entries
|
||||
std::vector<ICONDIRENTRY> entries;
|
||||
entries.reserve(header.entries);
|
||||
for (ase_uint16 n=0; n<header.entries; ++n) {
|
||||
for (uint16_t n=0; n<header.entries; ++n) {
|
||||
ICONDIRENTRY entry;
|
||||
entry.width = fgetc(f); // width
|
||||
entry.height = fgetc(f); // height
|
||||
|
@ -190,13 +190,13 @@ bool JpegFormat::onLoad(FileOp* fop)
|
||||
|
||||
/* RGB */
|
||||
if (image->imgtype == IMAGE_RGB) {
|
||||
ase_uint8 *src_address;
|
||||
ase_uint32 *dst_address;
|
||||
uint8_t* src_address;
|
||||
uint32_t* dst_address;
|
||||
int x, y, r, g, b;
|
||||
|
||||
for (y=0; y<(int)num_scanlines; y++) {
|
||||
src_address = ((ase_uint8 **)buffer)[y];
|
||||
dst_address = ((ase_uint32 **)image->line)[cinfo.output_scanline-1+y];
|
||||
src_address = ((uint8_t**)buffer)[y];
|
||||
dst_address = ((uint32_t**)image->line)[cinfo.output_scanline-1+y];
|
||||
|
||||
for (x=0; x<image->w; x++) {
|
||||
r = *(src_address++);
|
||||
@ -208,13 +208,13 @@ bool JpegFormat::onLoad(FileOp* fop)
|
||||
}
|
||||
/* Grayscale */
|
||||
else {
|
||||
ase_uint8 *src_address;
|
||||
ase_uint16 *dst_address;
|
||||
uint8_t* src_address;
|
||||
uint16_t* dst_address;
|
||||
int x, y;
|
||||
|
||||
for (y=0; y<(int)num_scanlines; y++) {
|
||||
src_address = ((ase_uint8 **)buffer)[y];
|
||||
dst_address = ((ase_uint16 **)image->line)[cinfo.output_scanline-1+y];
|
||||
src_address = ((uint8_t**)buffer)[y];
|
||||
dst_address = ((uint16_t**)image->line)[cinfo.output_scanline-1+y];
|
||||
|
||||
for (x=0; x<image->w; x++)
|
||||
*(dst_address++) = _graya(*(src_address++), 255);
|
||||
@ -313,12 +313,12 @@ bool JpegFormat::onSave(FileOp* fop)
|
||||
while (cinfo.next_scanline < cinfo.image_height) {
|
||||
// RGB
|
||||
if (image->imgtype == IMAGE_RGB) {
|
||||
ase_uint32 *src_address;
|
||||
ase_uint8 *dst_address;
|
||||
uint32_t* src_address;
|
||||
uint8_t* dst_address;
|
||||
int x, y;
|
||||
for (y=0; y<(int)buffer_height; y++) {
|
||||
src_address = ((ase_uint32 **)image->line)[cinfo.next_scanline+y];
|
||||
dst_address = ((ase_uint8 **)buffer)[y];
|
||||
src_address = ((uint32_t**)image->line)[cinfo.next_scanline+y];
|
||||
dst_address = ((uint8_t**)buffer)[y];
|
||||
for (x=0; x<image->w; x++) {
|
||||
c = *(src_address++);
|
||||
*(dst_address++) = _rgba_getr(c);
|
||||
@ -329,12 +329,12 @@ bool JpegFormat::onSave(FileOp* fop)
|
||||
}
|
||||
// Grayscale.
|
||||
else {
|
||||
ase_uint16 *src_address;
|
||||
ase_uint8 *dst_address;
|
||||
uint16_t* src_address;
|
||||
uint8_t* dst_address;
|
||||
int x, y;
|
||||
for (y=0; y<(int)buffer_height; y++) {
|
||||
src_address = ((ase_uint16 **)image->line)[cinfo.next_scanline+y];
|
||||
dst_address = ((ase_uint8 **)buffer)[y];
|
||||
src_address = ((uint16_t**)image->line)[cinfo.next_scanline+y];
|
||||
dst_address = ((uint8_t**)buffer)[y];
|
||||
for (x=0; x<image->w; x++)
|
||||
*(dst_address++) = _graya_getv(*(src_address++));
|
||||
}
|
||||
|
@ -130,14 +130,14 @@ bool PcxFormat::onLoad(FileOp* fop)
|
||||
if (bpp == 8) {
|
||||
while (c--) {
|
||||
if (x < image->w)
|
||||
*(((ase_uint8 **)image->line)[y]+x) = ch;
|
||||
*(((uint8_t**)image->line)[y]+x) = ch;
|
||||
x++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
while (c--) {
|
||||
if (xx < image->w)
|
||||
*(((ase_uint32 **)image->line)[y]+xx) |= (ch & 0xff) << po;
|
||||
*(((uint32_t**)image->line)[y]+xx) |= (ch & 0xff) << po;
|
||||
x++;
|
||||
if (x == bytes_per_line) {
|
||||
xx = 0;
|
||||
|
@ -238,8 +238,8 @@ bool PngFormat::onLoad(FileOp* fop)
|
||||
|
||||
/* RGB_ALPHA */
|
||||
if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
|
||||
register ase_uint8 *src_address = row_pointer;
|
||||
register ase_uint32 *dst_address = ((ase_uint32 **)image->line)[y];
|
||||
register uint8_t* src_address = row_pointer;
|
||||
register uint32_t* dst_address = ((uint32_t**)image->line)[y];
|
||||
register unsigned int x, r, g, b, a;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -252,8 +252,8 @@ bool PngFormat::onLoad(FileOp* fop)
|
||||
}
|
||||
/* RGB */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
|
||||
register ase_uint8 *src_address = row_pointer;
|
||||
register ase_uint32 *dst_address = ((ase_uint32 **)image->line)[y];
|
||||
register uint8_t* src_address = row_pointer;
|
||||
register uint32_t* dst_address = ((uint32_t**)image->line)[y];
|
||||
register unsigned int x, r, g, b;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -265,8 +265,8 @@ bool PngFormat::onLoad(FileOp* fop)
|
||||
}
|
||||
/* GRAY_ALPHA */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
|
||||
register ase_uint8 *src_address = row_pointer;
|
||||
register ase_uint16 *dst_address = ((ase_uint16 **)image->line)[y];
|
||||
register uint8_t* src_address = row_pointer;
|
||||
register uint16_t* dst_address = ((uint16_t**)image->line)[y];
|
||||
register unsigned int x, k, a;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -277,8 +277,8 @@ bool PngFormat::onLoad(FileOp* fop)
|
||||
}
|
||||
/* GRAY */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) {
|
||||
register ase_uint8 *src_address = row_pointer;
|
||||
register ase_uint16 *dst_address = ((ase_uint16 **)image->line)[y];
|
||||
register uint8_t* src_address = row_pointer;
|
||||
register uint16_t* dst_address = ((uint16_t**)image->line)[y];
|
||||
register unsigned int x, k;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -288,8 +288,8 @@ bool PngFormat::onLoad(FileOp* fop)
|
||||
}
|
||||
/* PALETTE */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||
register ase_uint8 *src_address = row_pointer;
|
||||
register ase_uint8 *dst_address = ((ase_uint8 **)image->line)[y];
|
||||
register uint8_t* src_address = row_pointer;
|
||||
register uint8_t* dst_address = ((uint8_t**)image->line)[y];
|
||||
register unsigned int x, c;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -455,8 +455,8 @@ bool PngFormat::onSave(FileOp* fop)
|
||||
for (y = 0; y < height; y++) {
|
||||
/* RGB_ALPHA */
|
||||
if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
|
||||
register ase_uint32 *src_address = ((ase_uint32 **)image->line)[y];
|
||||
register ase_uint8 *dst_address = row_pointer;
|
||||
register uint32_t* src_address = ((uint32_t**)image->line)[y];
|
||||
register uint8_t* dst_address = row_pointer;
|
||||
register unsigned int x, c;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -469,8 +469,8 @@ bool PngFormat::onSave(FileOp* fop)
|
||||
}
|
||||
/* RGB */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
|
||||
register ase_uint32 *src_address = ((ase_uint32 **)image->line)[y];
|
||||
register ase_uint8 *dst_address = row_pointer;
|
||||
register uint32_t* src_address = ((uint32_t**)image->line)[y];
|
||||
register uint8_t* dst_address = row_pointer;
|
||||
register unsigned int x, c;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -482,8 +482,8 @@ bool PngFormat::onSave(FileOp* fop)
|
||||
}
|
||||
/* GRAY_ALPHA */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
|
||||
register ase_uint16 *src_address = ((ase_uint16 **)image->line)[y];
|
||||
register ase_uint8 *dst_address = row_pointer;
|
||||
register uint16_t* src_address = ((uint16_t**)image->line)[y];
|
||||
register uint8_t* dst_address = row_pointer;
|
||||
register unsigned int x, c;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -494,8 +494,8 @@ bool PngFormat::onSave(FileOp* fop)
|
||||
}
|
||||
/* GRAY */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) {
|
||||
register ase_uint16 *src_address = ((ase_uint16 **)image->line)[y];
|
||||
register ase_uint8 *dst_address = row_pointer;
|
||||
register uint16_t* src_address = ((uint16_t**)image->line)[y];
|
||||
register uint8_t* dst_address = row_pointer;
|
||||
register unsigned int x, c;
|
||||
|
||||
for (x=0; x<width; x++) {
|
||||
@ -505,8 +505,8 @@ bool PngFormat::onSave(FileOp* fop)
|
||||
}
|
||||
/* PALETTE */
|
||||
else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||
register ase_uint8 *src_address = ((ase_uint8 **)image->line)[y];
|
||||
register ase_uint8 *dst_address = row_pointer;
|
||||
register uint8_t* src_address = ((uint8_t**)image->line)[y];
|
||||
register uint8_t* dst_address = row_pointer;
|
||||
register unsigned int x;
|
||||
|
||||
for (x=0; x<width; x++)
|
||||
|
@ -71,8 +71,8 @@ static void rle_tga_read(unsigned char *address, int w, int type, FILE *f)
|
||||
if (type == 1)
|
||||
*(address++) = value;
|
||||
else {
|
||||
*((ase_uint16 *)address) = value;
|
||||
address += sizeof(ase_uint16);
|
||||
*((uint16_t*)address) = value;
|
||||
address += sizeof(uint16_t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,8 +85,8 @@ static void rle_tga_read(unsigned char *address, int w, int type, FILE *f)
|
||||
}
|
||||
else {
|
||||
for (g=0; g<count; g++) {
|
||||
*((ase_uint16 *)address) = fgetc(f);
|
||||
address += sizeof(ase_uint16);
|
||||
*((uint16_t*)address) = fgetc(f);
|
||||
address += sizeof(uint16_t);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -96,7 +96,7 @@ static void rle_tga_read(unsigned char *address, int w, int type, FILE *f)
|
||||
/* rle_tga_read32:
|
||||
* Helper for reading 32 bit RLE data from TGA files.
|
||||
*/
|
||||
static void rle_tga_read32 (ase_uint32 *address, int w, FILE *f)
|
||||
static void rle_tga_read32 (uint32_t* address, int w, FILE *f)
|
||||
{
|
||||
unsigned char value[4];
|
||||
int count;
|
||||
@ -125,7 +125,7 @@ static void rle_tga_read32 (ase_uint32 *address, int w, FILE *f)
|
||||
/* rle_tga_read24:
|
||||
* Helper for reading 24 bit RLE data from TGA files.
|
||||
*/
|
||||
static void rle_tga_read24(ase_uint32 *address, int w, FILE *f)
|
||||
static void rle_tga_read24(uint32_t* address, int w, FILE *f)
|
||||
{
|
||||
unsigned char value[4];
|
||||
int count;
|
||||
@ -154,10 +154,10 @@ static void rle_tga_read24(ase_uint32 *address, int w, FILE *f)
|
||||
/* rle_tga_read16:
|
||||
* Helper for reading 16 bit RLE data from TGA files.
|
||||
*/
|
||||
static void rle_tga_read16(ase_uint32 *address, int w, FILE *f)
|
||||
static void rle_tga_read16(uint32_t* address, int w, FILE *f)
|
||||
{
|
||||
unsigned int value;
|
||||
ase_uint32 color;
|
||||
uint32_t color;
|
||||
int count;
|
||||
int c = 0;
|
||||
|
||||
@ -334,7 +334,7 @@ bool TgaFormat::onLoad(FileOp* fop)
|
||||
fread(image->line[yc], 1, image_width, f);
|
||||
else {
|
||||
for (x=0; x<image_width; x++)
|
||||
*(((ase_uint16 **)image->line)[yc]+x) =
|
||||
*(((uint16_t**)image->line)[yc]+x) =
|
||||
_graya(fgetc(f), 255);
|
||||
}
|
||||
break;
|
||||
@ -342,36 +342,36 @@ bool TgaFormat::onLoad(FileOp* fop)
|
||||
case 2:
|
||||
if (bpp == 32) {
|
||||
if (compressed) {
|
||||
rle_tga_read32((ase_uint32 *)image->line[yc], image_width, f);
|
||||
rle_tga_read32((uint32_t*)image->line[yc], image_width, f);
|
||||
}
|
||||
else {
|
||||
for (x=0; x<image_width; x++) {
|
||||
fread(rgb, 1, 4, f);
|
||||
*(((ase_uint32 **)image->line)[yc]+x) =
|
||||
*(((uint32_t**)image->line)[yc]+x) =
|
||||
_rgba(rgb[2], rgb[1], rgb[0], rgb[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bpp == 24) {
|
||||
if (compressed) {
|
||||
rle_tga_read24((ase_uint32 *)image->line[yc], image_width, f);
|
||||
rle_tga_read24((uint32_t*)image->line[yc], image_width, f);
|
||||
}
|
||||
else {
|
||||
for (x=0; x<image_width; x++) {
|
||||
fread(rgb, 1, 3, f);
|
||||
*(((ase_uint32 **)image->line)[yc]+x) =
|
||||
*(((uint32_t**)image->line)[yc]+x) =
|
||||
_rgba(rgb[2], rgb[1], rgb[0], 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (compressed) {
|
||||
rle_tga_read16((ase_uint32 *)image->line[yc], image_width, f);
|
||||
rle_tga_read16((uint32_t*)image->line[yc], image_width, f);
|
||||
}
|
||||
else {
|
||||
for (x=0; x<image_width; x++) {
|
||||
c = fgetw(f);
|
||||
*(((ase_uint32 **)image->line)[yc]+x) =
|
||||
*(((uint32_t**)image->line)[yc]+x) =
|
||||
_rgba(((c >> 10) & 0x1F),
|
||||
((c >> 5) & 0x1F),
|
||||
(c & 0x1F), 255);
|
||||
|
@ -55,8 +55,8 @@ const char* ColorCurveFilter::getName()
|
||||
|
||||
void ColorCurveFilter::applyToRgba(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint32* src_address = (ase_uint32*)filterMgr->getSourceAddress();
|
||||
ase_uint32* dst_address = (ase_uint32*)filterMgr->getDestinationAddress();
|
||||
const uint32_t* src_address = (uint32_t*)filterMgr->getSourceAddress();
|
||||
uint32_t* dst_address = (uint32_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
Target target = filterMgr->getTarget();
|
||||
int x, c, r, g, b, a;
|
||||
@ -86,8 +86,8 @@ void ColorCurveFilter::applyToRgba(FilterManager* filterMgr)
|
||||
|
||||
void ColorCurveFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint16* src_address = (ase_uint16*)filterMgr->getSourceAddress();
|
||||
ase_uint16* dst_address = (ase_uint16*)filterMgr->getDestinationAddress();
|
||||
const uint16_t* src_address = (uint16_t*)filterMgr->getSourceAddress();
|
||||
uint16_t* dst_address = (uint16_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
Target target = filterMgr->getTarget();
|
||||
int x, c, k, a;
|
||||
@ -113,8 +113,8 @@ void ColorCurveFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
|
||||
void ColorCurveFilter::applyToIndexed(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint8* src_address = (ase_uint8*)filterMgr->getSourceAddress();
|
||||
ase_uint8* dst_address = (ase_uint8*)filterMgr->getDestinationAddress();
|
||||
const uint8_t* src_address = (uint8_t*)filterMgr->getSourceAddress();
|
||||
uint8_t* dst_address = (uint8_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
Target target = filterMgr->getTarget();
|
||||
const Palette* pal = filterMgr->getIndexedData()->getPalette();
|
||||
|
@ -49,7 +49,7 @@ namespace {
|
||||
|
||||
struct GetPixelsDelegate
|
||||
{
|
||||
ase_uint32 color;
|
||||
uint32_t color;
|
||||
int div;
|
||||
const int* matrixData;
|
||||
|
||||
@ -148,9 +148,9 @@ void ConvolutionMatrixFilter::applyToRgba(FilterManager* filterMgr)
|
||||
return;
|
||||
|
||||
const Image* src = filterMgr->getSourceImage();
|
||||
ase_uint32* dst_address = (ase_uint32*)filterMgr->getDestinationAddress();
|
||||
uint32_t* dst_address = (uint32_t*)filterMgr->getDestinationAddress();
|
||||
Target target = filterMgr->getTarget();
|
||||
ase_uint32 color;
|
||||
uint32_t color;
|
||||
GetPixelsDelegateRgba delegate;
|
||||
int x = filterMgr->getX();
|
||||
int x2 = x+filterMgr->getWidth();
|
||||
@ -215,9 +215,9 @@ void ConvolutionMatrixFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
return;
|
||||
|
||||
const Image* src = filterMgr->getSourceImage();
|
||||
ase_uint16* dst_address = (ase_uint16*)filterMgr->getDestinationAddress();
|
||||
uint16_t* dst_address = (uint16_t*)filterMgr->getDestinationAddress();
|
||||
Target target = filterMgr->getTarget();
|
||||
ase_uint16 color;
|
||||
uint16_t color;
|
||||
GetPixelsDelegateGrayscale delegate;
|
||||
int x = filterMgr->getX();
|
||||
int x2 = x+filterMgr->getWidth();
|
||||
@ -268,11 +268,11 @@ void ConvolutionMatrixFilter::applyToIndexed(FilterManager* filterMgr)
|
||||
return;
|
||||
|
||||
const Image* src = filterMgr->getSourceImage();
|
||||
ase_uint8* dst_address = (ase_uint8*)filterMgr->getDestinationAddress();
|
||||
uint8_t* dst_address = (uint8_t*)filterMgr->getDestinationAddress();
|
||||
const Palette* pal = filterMgr->getIndexedData()->getPalette();
|
||||
const RgbMap* rgbmap = filterMgr->getIndexedData()->getRgbMap();
|
||||
Target target = filterMgr->getTarget();
|
||||
ase_uint8 color;
|
||||
uint8_t color;
|
||||
GetPixelsDelegateIndexed delegate(pal);
|
||||
int x = filterMgr->getX();
|
||||
int x2 = x+filterMgr->getWidth();
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
private:
|
||||
SharedPtr<ConvolutionMatrix> m_matrix;
|
||||
TiledMode m_tiledMode;
|
||||
std::vector<ase_uint8*> m_lines;
|
||||
std::vector<uint8_t*> m_lines;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,8 +33,8 @@ const char* InvertColorFilter::getName()
|
||||
|
||||
void InvertColorFilter::applyToRgba(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint32* src_address = (ase_uint32*)filterMgr->getSourceAddress();
|
||||
ase_uint32* dst_address = (ase_uint32*)filterMgr->getDestinationAddress();
|
||||
const uint32_t* src_address = (uint32_t*)filterMgr->getSourceAddress();
|
||||
uint32_t* dst_address = (uint32_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
Target target = filterMgr->getTarget();
|
||||
int x, c, r, g, b, a;
|
||||
@ -64,8 +64,8 @@ void InvertColorFilter::applyToRgba(FilterManager* filterMgr)
|
||||
|
||||
void InvertColorFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint16* src_address = (ase_uint16*)filterMgr->getSourceAddress();
|
||||
ase_uint16* dst_address = (ase_uint16*)filterMgr->getDestinationAddress();
|
||||
const uint16_t* src_address = (uint16_t*)filterMgr->getSourceAddress();
|
||||
uint16_t* dst_address = (uint16_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
Target target = filterMgr->getTarget();
|
||||
int x, c, k, a;
|
||||
@ -91,8 +91,8 @@ void InvertColorFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
|
||||
void InvertColorFilter::applyToIndexed(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint8* src_address = (ase_uint8*)filterMgr->getSourceAddress();
|
||||
ase_uint8* dst_address = (ase_uint8*)filterMgr->getDestinationAddress();
|
||||
const uint8_t* src_address = (uint8_t*)filterMgr->getSourceAddress();
|
||||
uint8_t* dst_address = (uint8_t*)filterMgr->getDestinationAddress();
|
||||
const Palette* pal = filterMgr->getIndexedData()->getPalette();
|
||||
const RgbMap* rgbmap = filterMgr->getIndexedData()->getRgbMap();
|
||||
int w = filterMgr->getWidth();
|
||||
|
@ -63,10 +63,10 @@ const char* MedianFilter::getName()
|
||||
namespace {
|
||||
struct GetPixelsDelegateRgba
|
||||
{
|
||||
std::vector<std::vector<ase_uint8> >& channel;
|
||||
std::vector<std::vector<uint8_t> >& channel;
|
||||
int c;
|
||||
|
||||
GetPixelsDelegateRgba(std::vector<std::vector<ase_uint8> >& channel) : channel(channel) { }
|
||||
GetPixelsDelegateRgba(std::vector<std::vector<uint8_t> >& channel) : channel(channel) { }
|
||||
|
||||
void reset() { c = 0; }
|
||||
|
||||
@ -82,10 +82,10 @@ namespace {
|
||||
|
||||
struct GetPixelsDelegateGrayscale
|
||||
{
|
||||
std::vector<std::vector<ase_uint8> >& channel;
|
||||
std::vector<std::vector<uint8_t> >& channel;
|
||||
int c;
|
||||
|
||||
GetPixelsDelegateGrayscale(std::vector<std::vector<ase_uint8> >& channel) : channel(channel) { }
|
||||
GetPixelsDelegateGrayscale(std::vector<std::vector<uint8_t> >& channel) : channel(channel) { }
|
||||
|
||||
void reset() { c = 0; }
|
||||
|
||||
@ -100,11 +100,11 @@ namespace {
|
||||
struct GetPixelsDelegateIndexed
|
||||
{
|
||||
const Palette* pal;
|
||||
std::vector<std::vector<ase_uint8> >& channel;
|
||||
std::vector<std::vector<uint8_t> >& channel;
|
||||
Target target;
|
||||
int c;
|
||||
|
||||
GetPixelsDelegateIndexed(const Palette* pal, std::vector<std::vector<ase_uint8> >& channel, Target target)
|
||||
GetPixelsDelegateIndexed(const Palette* pal, std::vector<std::vector<uint8_t> >& channel, Target target)
|
||||
: pal(pal), channel(channel), target(target) { }
|
||||
|
||||
void reset() { c = 0; }
|
||||
@ -127,7 +127,7 @@ namespace {
|
||||
void MedianFilter::applyToRgba(FilterManager* filterMgr)
|
||||
{
|
||||
const Image* src = filterMgr->getSourceImage();
|
||||
ase_uint32* dst_address = (ase_uint32*)filterMgr->getDestinationAddress();
|
||||
uint32_t* dst_address = (uint32_t*)filterMgr->getDestinationAddress();
|
||||
Target target = filterMgr->getTarget();
|
||||
int color;
|
||||
int r, g, b, a;
|
||||
@ -184,7 +184,7 @@ void MedianFilter::applyToRgba(FilterManager* filterMgr)
|
||||
void MedianFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
{
|
||||
const Image* src = filterMgr->getSourceImage();
|
||||
ase_uint16* dst_address = (ase_uint16*)filterMgr->getDestinationAddress();
|
||||
uint16_t* dst_address = (uint16_t*)filterMgr->getDestinationAddress();
|
||||
Target target = filterMgr->getTarget();
|
||||
int color, k, a;
|
||||
GetPixelsDelegateGrayscale delegate(m_channel);
|
||||
@ -226,7 +226,7 @@ void MedianFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
void MedianFilter::applyToIndexed(FilterManager* filterMgr)
|
||||
{
|
||||
const Image* src = filterMgr->getSourceImage();
|
||||
ase_uint8* dst_address = (ase_uint8*)filterMgr->getDestinationAddress();
|
||||
uint8_t* dst_address = (uint8_t*)filterMgr->getDestinationAddress();
|
||||
const Palette* pal = filterMgr->getIndexedData()->getPalette();
|
||||
const RgbMap* rgbmap = filterMgr->getIndexedData()->getRgbMap();
|
||||
Target target = filterMgr->getTarget();
|
||||
|
@ -47,7 +47,7 @@ private:
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_ncolors;
|
||||
std::vector<std::vector<ase_uint8> > m_channel;
|
||||
std::vector<std::vector<uint8_t> > m_channel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -50,8 +50,8 @@ const char* ReplaceColorFilter::getName()
|
||||
|
||||
void ReplaceColorFilter::applyToRgba(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint32* src_address = (ase_uint32*)filterMgr->getSourceAddress();
|
||||
ase_uint32* dst_address = (ase_uint32*)filterMgr->getDestinationAddress();
|
||||
const uint32_t* src_address = (uint32_t*)filterMgr->getSourceAddress();
|
||||
uint32_t* dst_address = (uint32_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
int src_r, src_g, src_b, src_a;
|
||||
int dst_r, dst_g, dst_b, dst_a;
|
||||
@ -88,8 +88,8 @@ void ReplaceColorFilter::applyToRgba(FilterManager* filterMgr)
|
||||
|
||||
void ReplaceColorFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint16* src_address = (ase_uint16*)filterMgr->getSourceAddress();
|
||||
ase_uint16* dst_address = (ase_uint16*)filterMgr->getDestinationAddress();
|
||||
const uint16_t* src_address = (uint16_t*)filterMgr->getSourceAddress();
|
||||
uint16_t* dst_address = (uint16_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
int src_k, src_a;
|
||||
int dst_k, dst_a;
|
||||
@ -120,8 +120,8 @@ void ReplaceColorFilter::applyToGrayscale(FilterManager* filterMgr)
|
||||
|
||||
void ReplaceColorFilter::applyToIndexed(FilterManager* filterMgr)
|
||||
{
|
||||
const ase_uint8* src_address = (ase_uint8*)filterMgr->getSourceAddress();
|
||||
ase_uint8* dst_address = (ase_uint8*)filterMgr->getDestinationAddress();
|
||||
const uint8_t* src_address = (uint8_t*)filterMgr->getSourceAddress();
|
||||
uint8_t* dst_address = (uint8_t*)filterMgr->getDestinationAddress();
|
||||
int w = filterMgr->getWidth();
|
||||
int x, c;
|
||||
|
||||
|
@ -48,7 +48,7 @@ static int flood_count; /* number of flooded segments */
|
||||
|
||||
#define FLOOD_LINE(c) (((FLOODED_LINE *)_scratch_mem) + c)
|
||||
|
||||
static inline bool color_equal_32(ase_uint32 c1, ase_uint32 c2, int tolerance)
|
||||
static inline bool color_equal_32(uint32_t c1, uint32_t c2, int tolerance)
|
||||
{
|
||||
if (tolerance == 0)
|
||||
return (c1 == c2) || (_rgba_geta(c1) == 0 && _rgba_geta(c2) == 0);
|
||||
@ -72,7 +72,7 @@ static inline bool color_equal_32(ase_uint32 c1, ase_uint32 c2, int tolerance)
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool color_equal_16(ase_uint16 c1, ase_uint16 c2, int tolerance)
|
||||
static inline bool color_equal_16(uint16_t c1, uint16_t c2, int tolerance)
|
||||
{
|
||||
if (tolerance == 0)
|
||||
return (c1 == c2) || (_graya_geta(c1) == 0 && _graya_geta(c2) == 0);
|
||||
@ -90,7 +90,7 @@ static inline bool color_equal_16(ase_uint16 c1, ase_uint16 c2, int tolerance)
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool color_equal_8(ase_uint8 c1, ase_uint8 c2, int tolerance)
|
||||
static inline bool color_equal_8(uint8_t c1, uint8_t c2, int tolerance)
|
||||
{
|
||||
if (tolerance == 0)
|
||||
return (c1 == c2);
|
||||
@ -116,7 +116,7 @@ static int flooder (Image *image, int x, int y,
|
||||
|
||||
case IMAGE_RGB:
|
||||
{
|
||||
ase_uint32 *address = ((ase_uint32 **)image->line)[y];
|
||||
uint32_t* address = ((uint32_t**)image->line)[y];
|
||||
|
||||
/* check start pixel */
|
||||
if (!color_equal_32((int)*(address+x), src_color, tolerance))
|
||||
@ -138,7 +138,7 @@ static int flooder (Image *image, int x, int y,
|
||||
|
||||
case IMAGE_GRAYSCALE:
|
||||
{
|
||||
ase_uint16 *address = ((ase_uint16 **)image->line)[y];
|
||||
uint16_t* address = ((uint16_t**)image->line)[y];
|
||||
|
||||
/* check start pixel */
|
||||
if (!color_equal_16((int)*(address+x), src_color, tolerance))
|
||||
@ -160,7 +160,7 @@ static int flooder (Image *image, int x, int y,
|
||||
|
||||
case IMAGE_INDEXED:
|
||||
{
|
||||
ase_uint8 *address = ((ase_uint8 **)image->line)[y];
|
||||
uint8_t* address = ((uint8_t**)image->line)[y];
|
||||
|
||||
/* check start pixel */
|
||||
if (!color_equal_8((int)*(address+x), src_color, tolerance))
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
|
||||
// Add the specified "color" in the histogram as many times as the
|
||||
// specified value in "count".
|
||||
void addSamples(ase_uint32 color, size_t count = 1)
|
||||
void addSamples(uint32_t color, size_t count = 1)
|
||||
{
|
||||
int i = histogramIndex(color);
|
||||
|
||||
@ -67,7 +67,7 @@ public:
|
||||
// image has more than 256 colors the m_histogram is used
|
||||
// instead.
|
||||
if (m_useHighPrecision) {
|
||||
std::vector<ase_uint32>::iterator it =
|
||||
std::vector<uint32_t>::iterator it =
|
||||
std::find(m_highPrecision.begin(), m_highPrecision.end(), color);
|
||||
|
||||
// The color is not in the high-precision table
|
||||
@ -99,7 +99,7 @@ public:
|
||||
// OK, we have to use the histogram and some algorithm (like
|
||||
// median-cut) to quantize "optimal" colors.
|
||||
else {
|
||||
std::vector<ase_uint32> result;
|
||||
std::vector<uint32_t> result;
|
||||
median_cut(*this, to-from+1, result);
|
||||
|
||||
for (int i=0; i<(int)result.size(); ++i)
|
||||
@ -113,7 +113,7 @@ private:
|
||||
// Converts input color in a index for the histogram. It reduces
|
||||
// each 8-bit component to the resolution given in the template
|
||||
// parameters.
|
||||
size_t histogramIndex(ase_uint32 color) const
|
||||
size_t histogramIndex(uint32_t color) const
|
||||
{
|
||||
return histogramIndex((_rgba_getr(color) >> (8 - RBits)),
|
||||
(_rgba_getg(color) >> (8 - GBits)),
|
||||
@ -130,7 +130,7 @@ private:
|
||||
|
||||
// High precision histogram to create an accurate palette if RGB
|
||||
// source images contains less than 256 colors.
|
||||
std::vector<ase_uint32> m_highPrecision;
|
||||
std::vector<uint32_t> m_highPrecision;
|
||||
|
||||
// True if we can use m_highPrecision still (it means that the
|
||||
// number of different samples is less than 256 colors still).
|
||||
|
@ -133,7 +133,7 @@ void Dirty::saveImagePixels(Image* image)
|
||||
for (; col_it != col_end; ++col_it) {
|
||||
Col* col = *col_it;
|
||||
|
||||
ase_uint8* address = (ase_uint8*)image_address(image, col->x, row->y);
|
||||
uint8_t* address = (uint8_t*)image_address(image, col->x, row->y);
|
||||
std::copy(address, address+getLineSize(col->w), col->data.begin());
|
||||
}
|
||||
}
|
||||
@ -151,7 +151,7 @@ void Dirty::swapImagePixels(Image* image)
|
||||
for (; col_it != col_end; ++col_it) {
|
||||
Col* col = *col_it;
|
||||
|
||||
ase_uint8* address = (ase_uint8*)image_address(image, col->x, row->y);
|
||||
uint8_t* address = (uint8_t*)image_address(image, col->x, row->y);
|
||||
std::swap_ranges(address, address+getLineSize(col->w), col->data.begin());
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
struct Col {
|
||||
int x, w;
|
||||
std::vector<ase_uint8> data;
|
||||
std::vector<uint8_t> data;
|
||||
|
||||
Col(int x, int w) : x(x), w(w) { }
|
||||
};
|
||||
|
@ -347,7 +347,7 @@ void image_fixup_transparent_colors(Image* image)
|
||||
switch (image->imgtype) {
|
||||
|
||||
case IMAGE_RGB: {
|
||||
ase_uint32 c;
|
||||
uint32_t c;
|
||||
int r, g, b, count;
|
||||
|
||||
for (y=0; y<image->h; ++y) {
|
||||
@ -386,7 +386,7 @@ void image_fixup_transparent_colors(Image* image)
|
||||
}
|
||||
|
||||
case IMAGE_GRAYSCALE: {
|
||||
ase_uint16 c;
|
||||
uint16_t c;
|
||||
int k, count;
|
||||
|
||||
for (y=0; y<image->h; ++y) {
|
||||
@ -436,7 +436,7 @@ void image_resize(const Image* src, Image* dst, ResizeMethod method, const Palet
|
||||
|
||||
// TODO optimize this
|
||||
case RESIZE_METHOD_NEAREST_NEIGHBOR: {
|
||||
ase_uint32 color;
|
||||
uint32_t color;
|
||||
double u, v, du, dv;
|
||||
int x, y;
|
||||
|
||||
@ -458,7 +458,7 @@ void image_resize(const Image* src, Image* dst, ResizeMethod method, const Palet
|
||||
|
||||
// TODO optimize this
|
||||
case RESIZE_METHOD_BILINEAR: {
|
||||
ase_uint32 color[4], dst_color = 0;
|
||||
uint32_t color[4], dst_color = 0;
|
||||
double u, v, du, dv;
|
||||
int u_floor, u_floor2;
|
||||
int v_floor, v_floor2;
|
||||
@ -568,8 +568,8 @@ int image_count_diff(const Image* i1, const Image* i2)
|
||||
|
||||
case IMAGE_RGB:
|
||||
{
|
||||
ase_uint32 *address1 = (ase_uint32 *)i1->dat;
|
||||
ase_uint32 *address2 = (ase_uint32 *)i2->dat;
|
||||
uint32_t* address1 = (uint32_t*)i1->dat;
|
||||
uint32_t* address2 = (uint32_t*)i2->dat;
|
||||
for (c=0; c<size; c++)
|
||||
if (*(address1++) != *(address2++))
|
||||
diff++;
|
||||
@ -578,8 +578,8 @@ int image_count_diff(const Image* i1, const Image* i2)
|
||||
|
||||
case IMAGE_GRAYSCALE:
|
||||
{
|
||||
ase_uint16 *address1 = (ase_uint16 *)i1->dat;
|
||||
ase_uint16 *address2 = (ase_uint16 *)i2->dat;
|
||||
uint16_t* address1 = (uint16_t*)i1->dat;
|
||||
uint16_t* address2 = (uint16_t*)i2->dat;
|
||||
for (c=0; c<size; c++)
|
||||
if (*(address1++) != *(address2++))
|
||||
diff++;
|
||||
@ -588,8 +588,8 @@ int image_count_diff(const Image* i1, const Image* i2)
|
||||
|
||||
case IMAGE_INDEXED:
|
||||
{
|
||||
ase_uint8 *address1 = (ase_uint8 *)i1->dat;
|
||||
ase_uint8 *address2 = (ase_uint8 *)i2->dat;
|
||||
uint8_t* address1 = (uint8_t*)i1->dat;
|
||||
uint8_t* address2 = (uint8_t*)i2->dat;
|
||||
for (c=0; c<size; c++)
|
||||
if (*(address1++) != *(address2++))
|
||||
diff++;
|
||||
@ -599,8 +599,8 @@ int image_count_diff(const Image* i1, const Image* i2)
|
||||
case IMAGE_BITMAP:
|
||||
/* TODO test it */
|
||||
{
|
||||
ase_uint8 *address1 = (ase_uint8 *)i1->dat;
|
||||
ase_uint8 *address2 = (ase_uint8 *)i2->dat;
|
||||
uint8_t* address1 = (uint8_t*)i1->dat;
|
||||
uint8_t* address2 = (uint8_t*)i2->dat;
|
||||
div_t d1 = div (0, 8);
|
||||
div_t d2 = div (0, 8);
|
||||
for (c=0; c<size; c++) {
|
||||
|
@ -48,9 +48,9 @@ class Image : public GfxObj
|
||||
public:
|
||||
int imgtype;
|
||||
int w, h;
|
||||
ase_uint8* dat; // pixmap data
|
||||
ase_uint8** line; // start of each scanline
|
||||
ase_uint32 mask_color; // skipped color in merge process
|
||||
uint8_t* dat; // Pixmap data.
|
||||
uint8_t** line; // Start of each scanline.
|
||||
uint32_t mask_color; // Skipped color in merge process.
|
||||
|
||||
Image(int imgtype, int w, int h);
|
||||
virtual ~Image();
|
||||
|
@ -55,9 +55,9 @@ public:
|
||||
{
|
||||
int bytes_per_line = Traits::scanline_size(w);
|
||||
|
||||
dat = new ase_uint8[bytes_per_line*h];
|
||||
dat = new uint8_t[bytes_per_line*h];
|
||||
try {
|
||||
line = (ase_uint8**)new address_t*[h];
|
||||
line = (uint8_t**)new address_t*[h];
|
||||
}
|
||||
catch (...) {
|
||||
delete[] dat;
|
||||
@ -67,7 +67,7 @@ public:
|
||||
address_t addr = raw_pixels();
|
||||
for (int y=0; y<h; ++y) {
|
||||
((address_t*)line)[y] = addr;
|
||||
addr = (address_t)(((ase_uint8*)addr) + bytes_per_line);
|
||||
addr = (address_t)(((uint8_t*)addr) + bytes_per_line);
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ public:
|
||||
virtual void merge(const Image* src, int x, int y, int opacity, int blend_mode)
|
||||
{
|
||||
BLEND_COLOR blender = Traits::get_blender(blend_mode);
|
||||
register ase_uint32 mask_color = src->mask_color;
|
||||
register uint32_t mask_color = src->mask_color;
|
||||
Image* dst = this;
|
||||
address_t src_address;
|
||||
address_t dst_address;
|
||||
@ -750,7 +750,7 @@ void ImageImpl<IndexedTraits>::to_allegro(BITMAP *bmp, int _x, int _y, const Pal
|
||||
unsigned long bmp_address;
|
||||
int depth = bitmap_color_depth(bmp);
|
||||
int x, y;
|
||||
ase_uint32 c;
|
||||
uint32_t c;
|
||||
|
||||
bmp_select(bmp);
|
||||
|
||||
|
@ -27,27 +27,27 @@
|
||||
#define _rgba_b_shift 16
|
||||
#define _rgba_a_shift 24
|
||||
|
||||
inline ase_uint8 _rgba_getr(ase_uint32 c)
|
||||
inline uint8_t _rgba_getr(uint32_t c)
|
||||
{
|
||||
return (c >> _rgba_r_shift) & 0xff;
|
||||
}
|
||||
|
||||
inline ase_uint8 _rgba_getg(ase_uint32 c)
|
||||
inline uint8_t _rgba_getg(uint32_t c)
|
||||
{
|
||||
return (c >> _rgba_g_shift) & 0xff;
|
||||
}
|
||||
|
||||
inline ase_uint8 _rgba_getb(ase_uint32 c)
|
||||
inline uint8_t _rgba_getb(uint32_t c)
|
||||
{
|
||||
return (c >> _rgba_b_shift) & 0xff;
|
||||
}
|
||||
|
||||
inline ase_uint8 _rgba_geta(ase_uint32 c)
|
||||
inline uint8_t _rgba_geta(uint32_t c)
|
||||
{
|
||||
return (c >> _rgba_a_shift) & 0xff;
|
||||
}
|
||||
|
||||
inline ase_uint32 _rgba(ase_uint8 r, ase_uint8 g, ase_uint8 b, ase_uint8 a)
|
||||
inline uint32_t _rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
|
||||
{
|
||||
return ((r << _rgba_r_shift) |
|
||||
(g << _rgba_g_shift) |
|
||||
@ -66,7 +66,7 @@ struct RgbTraits
|
||||
is_binary = false,
|
||||
};
|
||||
|
||||
typedef ase_uint32 pixel_t;
|
||||
typedef uint32_t pixel_t;
|
||||
typedef pixel_t* address_t;
|
||||
typedef const pixel_t* const_address_t;
|
||||
|
||||
@ -88,17 +88,17 @@ struct RgbTraits
|
||||
#define _graya_v_shift 0
|
||||
#define _graya_a_shift 8
|
||||
|
||||
inline ase_uint8 _graya_getv(ase_uint16 c)
|
||||
inline uint8_t _graya_getv(uint16_t c)
|
||||
{
|
||||
return (c >> _graya_v_shift) & 0xff;
|
||||
}
|
||||
|
||||
inline ase_uint8 _graya_geta(ase_uint16 c)
|
||||
inline uint8_t _graya_geta(uint16_t c)
|
||||
{
|
||||
return (c >> _graya_a_shift) & 0xff;
|
||||
}
|
||||
|
||||
inline ase_uint16 _graya(ase_uint8 v, ase_uint8 a)
|
||||
inline uint16_t _graya(uint8_t v, uint8_t a)
|
||||
{
|
||||
return ((v << _graya_v_shift) |
|
||||
(a << _graya_a_shift));
|
||||
@ -115,7 +115,7 @@ struct GrayscaleTraits
|
||||
is_binary = false,
|
||||
};
|
||||
|
||||
typedef ase_uint16 pixel_t;
|
||||
typedef uint16_t pixel_t;
|
||||
typedef pixel_t* address_t;
|
||||
typedef const pixel_t* const_address_t;
|
||||
|
||||
@ -145,7 +145,7 @@ struct IndexedTraits
|
||||
is_binary = false,
|
||||
};
|
||||
|
||||
typedef ase_uint8 pixel_t;
|
||||
typedef uint8_t pixel_t;
|
||||
typedef pixel_t* address_t;
|
||||
typedef const pixel_t* const_address_t;
|
||||
|
||||
@ -169,7 +169,7 @@ struct BitmapTraits
|
||||
is_binary = true,
|
||||
};
|
||||
|
||||
typedef ase_uint8 pixel_t;
|
||||
typedef uint8_t pixel_t;
|
||||
typedef pixel_t* address_t;
|
||||
typedef const pixel_t* const_address_t;
|
||||
|
||||
|
@ -148,13 +148,13 @@ void mask_none(Mask* mask)
|
||||
void mask_invert(Mask* mask)
|
||||
{
|
||||
if (mask->bitmap) {
|
||||
ase_uint8 *address;
|
||||
uint8_t* address;
|
||||
int u, v;
|
||||
div_t d;
|
||||
|
||||
for (v=0; v<mask->h; v++) {
|
||||
d.quot = d.rem = 0;
|
||||
address = ((ase_uint8 **)mask->bitmap->line)[v];
|
||||
address = ((uint8_t**)mask->bitmap->line)[v];
|
||||
for (u=0; u<mask->w; u++) {
|
||||
*address ^= (1<<d.rem);
|
||||
_image_bitmap_next_bit(d, address);
|
||||
@ -237,8 +237,8 @@ void mask_by_color(Mask* mask, const Image *src, int color, int fuzziness)
|
||||
switch (src->imgtype) {
|
||||
|
||||
case IMAGE_RGB: {
|
||||
ase_uint32 *src_address;
|
||||
ase_uint8 *dst_address;
|
||||
uint32_t* src_address;
|
||||
uint8_t* dst_address;
|
||||
int src_r, src_g, src_b, src_a;
|
||||
int dst_r, dst_g, dst_b, dst_a;
|
||||
int u, v, c;
|
||||
@ -250,8 +250,8 @@ void mask_by_color(Mask* mask, const Image *src, int color, int fuzziness)
|
||||
dst_a = _rgba_geta(color);
|
||||
|
||||
for (v=0; v<src->h; v++) {
|
||||
src_address = ((ase_uint32 **)src->line)[v];
|
||||
dst_address = ((ase_uint8 **)dst->line)[v];
|
||||
src_address = ((uint32_t**)src->line)[v];
|
||||
dst_address = ((uint8_t**)dst->line)[v];
|
||||
|
||||
d = div (0, 8);
|
||||
|
||||
@ -275,8 +275,8 @@ void mask_by_color(Mask* mask, const Image *src, int color, int fuzziness)
|
||||
} break;
|
||||
|
||||
case IMAGE_GRAYSCALE: {
|
||||
ase_uint16 *src_address;
|
||||
ase_uint8 *dst_address;
|
||||
uint16_t* src_address;
|
||||
uint8_t* dst_address;
|
||||
int src_k, src_a;
|
||||
int dst_k, dst_a;
|
||||
int u, v, c;
|
||||
@ -286,8 +286,8 @@ void mask_by_color(Mask* mask, const Image *src, int color, int fuzziness)
|
||||
dst_a = _graya_geta(color);
|
||||
|
||||
for (v=0; v<src->h; v++) {
|
||||
src_address = ((ase_uint16 **)src->line)[v];
|
||||
dst_address = ((ase_uint8 **)dst->line)[v];
|
||||
src_address = ((uint16_t**)src->line)[v];
|
||||
dst_address = ((uint8_t**)dst->line)[v];
|
||||
|
||||
d = div (0, 8);
|
||||
|
||||
@ -307,14 +307,14 @@ void mask_by_color(Mask* mask, const Image *src, int color, int fuzziness)
|
||||
} break;
|
||||
|
||||
case IMAGE_INDEXED: {
|
||||
ase_uint8 *src_address;
|
||||
ase_uint8 *dst_address;
|
||||
uint8_t* src_address;
|
||||
uint8_t* dst_address;
|
||||
int u, v, c;
|
||||
div_t d;
|
||||
|
||||
for (v=0; v<src->h; v++) {
|
||||
src_address = ((ase_uint8 **)src->line)[v];
|
||||
dst_address = ((ase_uint8 **)dst->line)[v];
|
||||
src_address = ((uint8_t**)src->line)[v];
|
||||
dst_address = ((uint8_t**)dst->line)[v];
|
||||
|
||||
d = div (0, 8);
|
||||
|
||||
|
@ -89,7 +89,7 @@ namespace quantization {
|
||||
|
||||
// Returns the color enclosed by the box calculating the mean of
|
||||
// all histogram's points inside the box.
|
||||
ase_uint32 meanColor(const Histogram& histogram) const
|
||||
uint32_t meanColor(const Histogram& histogram) const
|
||||
{
|
||||
size_t r = 0, g = 0, b = 0;
|
||||
size_t count = 0;
|
||||
@ -253,7 +253,7 @@ namespace quantization {
|
||||
// quantization for frame buffer display,”, Computer Graphics,
|
||||
// 16(3), pp. 297-307 (1982)
|
||||
template<class Histogram>
|
||||
void median_cut(const Histogram& histogram, size_t maxBoxes, std::vector<ase_uint32>& result)
|
||||
void median_cut(const Histogram& histogram, size_t maxBoxes, std::vector<uint32_t>& result)
|
||||
{
|
||||
// We need a priority queue to split bigger boxes first (see Box::operator<).
|
||||
std::priority_queue<Box<Histogram> > boxes;
|
||||
|
@ -87,7 +87,7 @@ void Palette::setFrame(int frame)
|
||||
m_frame = frame;
|
||||
}
|
||||
|
||||
void Palette::setEntry(int i, ase_uint32 color)
|
||||
void Palette::setEntry(int i, uint32_t color)
|
||||
{
|
||||
ASSERT(i >= 0 && i < size());
|
||||
ASSERT(_rgba_geta(color) == 255);
|
||||
@ -267,7 +267,7 @@ void SortPalette::addChain(SortPalette* chain)
|
||||
m_chain = chain;
|
||||
}
|
||||
|
||||
bool SortPalette::operator()(ase_uint32 c1, ase_uint32 c2)
|
||||
bool SortPalette::operator()(uint32_t c1, uint32_t c2)
|
||||
{
|
||||
int value1 = 0, value2 = 0;
|
||||
|
||||
@ -350,7 +350,7 @@ bool SortPalette::operator()(ase_uint32 c1, ase_uint32 c2)
|
||||
|
||||
struct PalEntryWithIndex {
|
||||
int index;
|
||||
ase_uint32 color;
|
||||
uint32_t color;
|
||||
};
|
||||
|
||||
struct PalEntryWithIndexPredicate {
|
||||
@ -529,7 +529,7 @@ int Palette::findBestfit(int r, int g, int b) const
|
||||
|
||||
i = 1;
|
||||
while (i < size()) {
|
||||
ase_uint32 rgb = m_colors[i];
|
||||
uint32_t rgb = m_colors[i];
|
||||
|
||||
coldiff = (col_diff + 0) [ ((_rgba_getg(rgb)>>3) - g) & 0x7F ];
|
||||
if (coldiff < lowest) {
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
|
||||
void addChain(SortPalette* chain);
|
||||
|
||||
bool operator()(ase_uint32 c1, ase_uint32 c2);
|
||||
bool operator()(uint32_t c1, uint32_t c2);
|
||||
|
||||
private:
|
||||
Channel m_channel;
|
||||
@ -67,12 +67,12 @@ public:
|
||||
int getFrame() const { return m_frame; }
|
||||
void setFrame(int frame);
|
||||
|
||||
ase_uint32 getEntry(int i) const {
|
||||
uint32_t getEntry(int i) const {
|
||||
ASSERT(i >= 0 && i < size());
|
||||
return m_colors[i];
|
||||
}
|
||||
|
||||
void setEntry(int i, ase_uint32 color);
|
||||
void setEntry(int i, uint32_t color);
|
||||
|
||||
void copyColorsTo(Palette* dst) const;
|
||||
|
||||
@ -97,7 +97,7 @@ public:
|
||||
|
||||
private:
|
||||
int m_frame;
|
||||
std::vector<ase_uint32> m_colors;
|
||||
std::vector<uint32_t> m_colors;
|
||||
int m_modifications;
|
||||
};
|
||||
|
||||
|
@ -217,8 +217,8 @@ typedef struct _ArtBitmapSVPData ArtBitmapSVPData;
|
||||
|
||||
struct _ArtBitmapSVPData
|
||||
{
|
||||
Image *image;
|
||||
ase_uint8 *address;
|
||||
Image* image;
|
||||
uint8_t* address;
|
||||
int shift;
|
||||
int x0, x1;
|
||||
int color;
|
||||
@ -227,7 +227,7 @@ struct _ArtBitmapSVPData
|
||||
|
||||
static void blend_rgb_hline(Image *image, int x1, int y, int x2, int rgb, int a)
|
||||
{
|
||||
ase_uint32 *address = ((ase_uint32 **)image->line)[y]+x1;
|
||||
uint32_t* address = ((uint32_t**)image->line)[y]+x1;
|
||||
int x;
|
||||
|
||||
for (x=x1; x<=x2; x++) {
|
||||
@ -238,7 +238,7 @@ static void blend_rgb_hline(Image *image, int x1, int y, int x2, int rgb, int a)
|
||||
|
||||
static void blend_grayscale_hline(Image *image, int x1, int y, int x2, int k, int a)
|
||||
{
|
||||
ase_uint16 *address = ((ase_uint16 **)image->line)[y]+x1;
|
||||
uint16_t* address = ((uint16_t**)image->line)[y]+x1;
|
||||
int x;
|
||||
|
||||
for (x=x1; x<=x2; x++) {
|
||||
@ -249,7 +249,7 @@ static void blend_grayscale_hline(Image *image, int x1, int y, int x2, int k, in
|
||||
|
||||
static void blend_indexed_hline(Image *image, int x1, int y, int x2, int i, int a)
|
||||
{
|
||||
ase_uint8 *address = ((ase_uint8 **)image->line)[y]+x1;
|
||||
uint8_t* address = ((uint8_t**)image->line)[y]+x1;
|
||||
int x;
|
||||
|
||||
if (a > 128)
|
||||
@ -353,7 +353,7 @@ static void art_image_svp_aa (const ArtSVP *svp,
|
||||
}
|
||||
|
||||
data.image = image;
|
||||
data.address = ((ase_uint8 *)image->line[y0]) + (x0<<data.shift);
|
||||
data.address = ((uint8_t*)image->line[y0]) + (x0<<data.shift);
|
||||
data.x0 = x0;
|
||||
data.x1 = x1+1;
|
||||
data.color = color;
|
||||
|
@ -81,10 +81,10 @@ Image* quantization::convert_imgtype(const Image* image, int imgtype,
|
||||
const Palette* palette,
|
||||
bool has_background_layer)
|
||||
{
|
||||
ase_uint32* rgb_address;
|
||||
ase_uint16* gray_address;
|
||||
ase_uint8* idx_address;
|
||||
ase_uint32 c;
|
||||
uint32_t* rgb_address;
|
||||
uint16_t* gray_address;
|
||||
uint8_t* idx_address;
|
||||
uint32_t c;
|
||||
int i, r, g, b, size;
|
||||
Image *new_image;
|
||||
|
||||
@ -107,13 +107,13 @@ Image* quantization::convert_imgtype(const Image* image, int imgtype,
|
||||
switch (image->imgtype) {
|
||||
|
||||
case IMAGE_RGB:
|
||||
rgb_address = (ase_uint32*)image->dat;
|
||||
rgb_address = (uint32_t*)image->dat;
|
||||
|
||||
switch (new_image->imgtype) {
|
||||
|
||||
// RGB -> Grayscale
|
||||
case IMAGE_GRAYSCALE:
|
||||
gray_address = (ase_uint16*)new_image->dat;
|
||||
gray_address = (uint16_t*)new_image->dat;
|
||||
for (i=0; i<size; i++) {
|
||||
c = *rgb_address;
|
||||
|
||||
@ -147,13 +147,13 @@ Image* quantization::convert_imgtype(const Image* image, int imgtype,
|
||||
break;
|
||||
|
||||
case IMAGE_GRAYSCALE:
|
||||
gray_address = (ase_uint16*)image->dat;
|
||||
gray_address = (uint16_t*)image->dat;
|
||||
|
||||
switch (new_image->imgtype) {
|
||||
|
||||
// Grayscale -> RGB
|
||||
case IMAGE_RGB:
|
||||
rgb_address = (ase_uint32*)new_image->dat;
|
||||
rgb_address = (uint32_t*)new_image->dat;
|
||||
for (i=0; i<size; i++) {
|
||||
c = *gray_address;
|
||||
g = _graya_getv(c);
|
||||
@ -186,7 +186,7 @@ Image* quantization::convert_imgtype(const Image* image, int imgtype,
|
||||
|
||||
// Indexed -> RGB
|
||||
case IMAGE_RGB:
|
||||
rgb_address = (ase_uint32*)new_image->dat;
|
||||
rgb_address = (uint32_t*)new_image->dat;
|
||||
for (i=0; i<size; i++) {
|
||||
c = *idx_address;
|
||||
|
||||
@ -203,7 +203,7 @@ Image* quantization::convert_imgtype(const Image* image, int imgtype,
|
||||
|
||||
// Indexed -> Grayscale
|
||||
case IMAGE_GRAYSCALE:
|
||||
gray_address = (ase_uint16*)new_image->dat;
|
||||
gray_address = (uint16_t*)new_image->dat;
|
||||
for (i=0; i<size; i++) {
|
||||
c = *idx_address;
|
||||
|
||||
@ -338,7 +338,7 @@ static Image* ordered_dithering(const Image* src_image,
|
||||
static void create_palette_from_bitmaps(const std::vector<Image*>& images, Palette* palette, bool has_background_layer)
|
||||
{
|
||||
quantization::ColorHistogram<5, 6, 5> histogram;
|
||||
ase_uint32 color;
|
||||
uint32_t color;
|
||||
RgbTraits::address_t address;
|
||||
|
||||
// If the sprite has a background layer, the first entry can be
|
||||
|
@ -127,7 +127,7 @@ bool Sprite::needAlpha() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void Sprite::setTransparentColor(ase_uint32 color)
|
||||
void Sprite::setTransparentColor(uint32_t color)
|
||||
{
|
||||
m_transparentColor = color;
|
||||
}
|
||||
|
@ -63,8 +63,8 @@ public:
|
||||
// alpha channel in the render.
|
||||
bool needAlpha() const;
|
||||
|
||||
ase_uint32 getTransparentColor() const { return m_transparentColor; }
|
||||
void setTransparentColor(ase_uint32 color);
|
||||
uint32_t getTransparentColor() const { return m_transparentColor; }
|
||||
void setTransparentColor(uint32_t color);
|
||||
|
||||
int getMemSize() const;
|
||||
|
||||
@ -154,7 +154,7 @@ private:
|
||||
RgbMap* m_rgbMap;
|
||||
|
||||
// Transparent color used in indexed images
|
||||
ase_uint32 m_transparentColor;
|
||||
uint32_t m_transparentColor;
|
||||
|
||||
// Disable default constructor and copying
|
||||
Sprite();
|
||||
|
@ -109,7 +109,7 @@ static void ink_hline8_opaque(int x1, int y, int x2, IToolLoop* loop)
|
||||
(IndexedTraits,
|
||||
*dst_address = c );
|
||||
|
||||
/* memset(((ase_uint8 **)data->dst_image->line)[y]+x1, data->color, x2-x1+1); */
|
||||
/* memset(((uint8_t**)data->dst_image->line)[y]+x1, data->color, x2-x1+1); */
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -140,8 +140,8 @@ static void ink_hline8_transparent(int x1, int y, int x2, IToolLoop* loop)
|
||||
{
|
||||
Palette* pal = get_current_palette();
|
||||
RgbMap* rgbmap = loop->getSprite()->getRgbMap();
|
||||
ase_uint32 c;
|
||||
ase_uint32 tc = pal->getEntry(loop->getPrimaryColor());
|
||||
uint32_t c;
|
||||
uint32_t tc = pal->getEntry(loop->getPrimaryColor());
|
||||
int opacity = loop->getOpacity();
|
||||
|
||||
DEFINE_INK_PROCESSING_SRCDST
|
||||
@ -316,8 +316,8 @@ static void ink_hline8_blur(int x1, int y, int x2, IToolLoop* loop)
|
||||
|
||||
static void ink_hline32_replace(int x1, int y, int x2, IToolLoop* loop)
|
||||
{
|
||||
ase_uint32 color1 = loop->getPrimaryColor();
|
||||
ase_uint32 color2 = loop->getSecondaryColor();
|
||||
uint32_t color1 = loop->getPrimaryColor();
|
||||
uint32_t color2 = loop->getSecondaryColor();
|
||||
int opacity = loop->getOpacity();
|
||||
|
||||
DEFINE_INK_PROCESSING_SRCDST
|
||||
@ -345,8 +345,8 @@ static void ink_hline8_replace(int x1, int y, int x2, IToolLoop* loop)
|
||||
int color1 = loop->getPrimaryColor();
|
||||
const Palette *pal = get_current_palette();
|
||||
RgbMap* rgbmap = loop->getSprite()->getRgbMap();
|
||||
ase_uint32 c;
|
||||
ase_uint32 tc = pal->getEntry(loop->getSecondaryColor());
|
||||
uint32_t c;
|
||||
uint32_t tc = pal->getEntry(loop->getSecondaryColor());
|
||||
int opacity = loop->getOpacity();
|
||||
|
||||
DEFINE_INK_PROCESSING_SRCDST
|
||||
@ -424,7 +424,7 @@ static void ink_hline8_jumble(int x1, int y, int x2, IToolLoop* loop)
|
||||
{
|
||||
const Palette *pal = get_current_palette();
|
||||
const RgbMap* rgbmap = loop->getSprite()->getRgbMap();
|
||||
ase_uint32 c, tc;
|
||||
uint32_t c, tc;
|
||||
int opacity = loop->getOpacity();
|
||||
Point speed(loop->getSpeed() / 4);
|
||||
TiledMode tiled = loop->getTiledMode();
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "base/exception.h"
|
||||
|
||||
typedef ase_uint32 ObjectId;
|
||||
typedef uint32_t ObjectId;
|
||||
|
||||
// Thrown when you use ObjectsContainer::insertObject() with an
|
||||
// existent ID or pointer.
|
||||
|
@ -256,28 +256,28 @@ static UndoAction undo_actions[] = {
|
||||
|
||||
// Raw data
|
||||
|
||||
static Dirty *read_raw_dirty(ase_uint8* raw_data);
|
||||
static ase_uint8* write_raw_dirty(ase_uint8* raw_data, Dirty* dirty);
|
||||
static Dirty *read_raw_dirty(uint8_t* raw_data);
|
||||
static uint8_t* write_raw_dirty(uint8_t* raw_data, Dirty* dirty);
|
||||
static int get_raw_dirty_size(Dirty *dirty);
|
||||
|
||||
static Image* read_raw_image(ObjectsContainer* objects, ase_uint8* raw_data);
|
||||
static ase_uint8* write_raw_image(ObjectsContainer* objects, ase_uint8* raw_data, Image* image);
|
||||
static Image* read_raw_image(ObjectsContainer* objects, uint8_t* raw_data);
|
||||
static uint8_t* write_raw_image(ObjectsContainer* objects, uint8_t* raw_data, Image* image);
|
||||
static int get_raw_image_size(Image* image);
|
||||
|
||||
static Cel* read_raw_cel(ObjectsContainer* objects, ase_uint8* raw_data);
|
||||
static ase_uint8* write_raw_cel(ObjectsContainer* objects, ase_uint8* raw_data, Cel* cel);
|
||||
static Cel* read_raw_cel(ObjectsContainer* objects, uint8_t* raw_data);
|
||||
static uint8_t* write_raw_cel(ObjectsContainer* objects, uint8_t* raw_data, Cel* cel);
|
||||
static int get_raw_cel_size(Cel* cel);
|
||||
|
||||
static Layer* read_raw_layer(ObjectsContainer* objects, ase_uint8* raw_data);
|
||||
static ase_uint8* write_raw_layer(ObjectsContainer* objects, ase_uint8* raw_data, Layer* layer);
|
||||
static Layer* read_raw_layer(ObjectsContainer* objects, uint8_t* raw_data);
|
||||
static uint8_t* write_raw_layer(ObjectsContainer* objects, uint8_t* raw_data, Layer* layer);
|
||||
static int get_raw_layer_size(Layer* layer);
|
||||
|
||||
static Palette* read_raw_palette(ase_uint8* raw_data);
|
||||
static ase_uint8* write_raw_palette(ase_uint8* raw_data, Palette* palette);
|
||||
static Palette* read_raw_palette(uint8_t* raw_data);
|
||||
static uint8_t* write_raw_palette(uint8_t* raw_data, Palette* palette);
|
||||
static int get_raw_palette_size(Palette* palette);
|
||||
|
||||
static Mask* read_raw_mask(ase_uint8* raw_data);
|
||||
static ase_uint8* write_raw_mask(ase_uint8* raw_data, Mask* mask);
|
||||
static Mask* read_raw_mask(uint8_t* raw_data);
|
||||
static uint8_t* write_raw_mask(uint8_t* raw_data, Mask* mask);
|
||||
static int get_raw_mask_size(Mask* mask);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -650,9 +650,9 @@ struct UndoChunkData
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId objectId;
|
||||
ase_uint32 fieldOffset;
|
||||
ase_uint32 fieldSize;
|
||||
ase_uint8 fieldData[0];
|
||||
uint32_t fieldOffset;
|
||||
uint32_t fieldSize;
|
||||
uint8_t fieldData[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_data(void* object, void* fieldAddress, int fieldSize)
|
||||
@ -663,8 +663,8 @@ void UndoHistory::undo_data(void* object, void* fieldAddress, int fieldSize)
|
||||
|
||||
static void chunk_data_new(UndoStream* stream, void* object, void* fieldAddress, int fieldSize)
|
||||
{
|
||||
ase_uint32 fieldOffset = (ase_uint32)(((ase_uint8*)fieldAddress) -
|
||||
((ase_uint8*)object));
|
||||
uint32_t fieldOffset = (uint32_t)(((uint8_t*)fieldAddress) -
|
||||
((uint8_t*)object));
|
||||
|
||||
ASSERT(fieldSize >= 1);
|
||||
|
||||
@ -685,7 +685,7 @@ static void chunk_data_invert(UndoStream* stream, UndoChunkData *chunk)
|
||||
unsigned int offset = chunk->fieldOffset;
|
||||
unsigned int size = chunk->fieldSize;
|
||||
void* object = stream->getObjects()->getObject(chunk->objectId);
|
||||
void* field = (void*)(((ase_uint8*)object) + offset);
|
||||
void* field = (void*)(((uint8_t*)object) + offset);
|
||||
|
||||
// Save the current data
|
||||
chunk_data_new(stream, object, field, size);
|
||||
@ -713,9 +713,9 @@ struct UndoChunkImage
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId image_id;
|
||||
ase_uint8 imgtype;
|
||||
ase_uint16 x, y, w, h;
|
||||
ase_uint8 data[0];
|
||||
uint8_t imgtype;
|
||||
uint16_t x, y, w, h;
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_image(Image* image, int x, int y, int w, int h)
|
||||
@ -727,7 +727,7 @@ void UndoHistory::undo_image(Image* image, int x, int y, int w, int h)
|
||||
static void chunk_image_new(UndoStream* stream, Image* image, int x, int y, int w, int h)
|
||||
{
|
||||
UndoChunkImage* chunk;
|
||||
ase_uint8* ptr;
|
||||
uint8_t* ptr;
|
||||
int v, size;
|
||||
|
||||
ASSERT(w >= 1 && h >= 1);
|
||||
@ -764,7 +764,7 @@ static void chunk_image_invert(UndoStream* stream, UndoChunkImage* chunk)
|
||||
throw UndoException("Image type does not match");
|
||||
|
||||
int x, y, w, h;
|
||||
ase_uint8* ptr;
|
||||
uint8_t* ptr;
|
||||
int v, size;
|
||||
|
||||
x = chunk->x;
|
||||
@ -800,9 +800,9 @@ struct UndoChunkFlip
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId image_id;
|
||||
ase_uint8 imgtype;
|
||||
ase_uint16 x1, y1, x2, y2;
|
||||
ase_uint8 horz;
|
||||
uint8_t imgtype;
|
||||
uint16_t x1, y1, x2, y2;
|
||||
uint8_t horz;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_flip(Image* image, int x1, int y1, int x2, int y2, bool horz)
|
||||
@ -869,7 +869,7 @@ struct UndoChunkDirty
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId image_id;
|
||||
ase_uint8 data[0];
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_dirty(Image* image, Dirty* dirty)
|
||||
@ -918,7 +918,7 @@ struct UndoChunkAddImage
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId stock_id;
|
||||
ase_uint32 image_index;
|
||||
uint32_t image_index;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_add_image(Stock *stock, int image_index)
|
||||
@ -968,8 +968,8 @@ struct UndoChunkRemoveImage
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId stock_id;
|
||||
ase_uint32 image_index;
|
||||
ase_uint8 data[0];
|
||||
uint32_t image_index;
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_remove_image(Stock *stock, int image_index)
|
||||
@ -1022,8 +1022,8 @@ struct UndoChunkReplaceImage
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId stock_id;
|
||||
ase_uint32 image_index;
|
||||
ase_uint8 data[0];
|
||||
uint32_t image_index;
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_replace_image(Stock *stock, int image_index)
|
||||
@ -1125,7 +1125,7 @@ struct UndoChunkRemoveCel
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId layer_id;
|
||||
ase_uint8 data[0];
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_remove_cel(Layer* layer, Cel* cel)
|
||||
@ -1171,8 +1171,8 @@ struct UndoChunkSetLayerName
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId layer_id;
|
||||
ase_uint16 name_length;
|
||||
ase_uint8 name_text[0];
|
||||
uint16_t name_length;
|
||||
uint8_t name_text[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_layer_name(Layer* layer)
|
||||
@ -1273,7 +1273,7 @@ struct UndoChunkRemoveLayer
|
||||
UndoChunk head;
|
||||
ObjectId folder_id;
|
||||
ObjectId after_id;
|
||||
ase_uint8 data[0];
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_remove_layer(Layer* layer)
|
||||
@ -1456,7 +1456,7 @@ struct UndoChunkRemovePalette
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint8 data[0];
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_remove_palette(Sprite *sprite, Palette* palette)
|
||||
@ -1503,10 +1503,10 @@ struct UndoChunkSetPaletteColors
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 frame;
|
||||
ase_uint8 from;
|
||||
ase_uint8 to;
|
||||
ase_uint8 data[0];
|
||||
uint32_t frame;
|
||||
uint8_t from;
|
||||
uint8_t to;
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_palette_colors(Sprite *sprite, Palette* palette, int from, int to)
|
||||
@ -1520,7 +1520,7 @@ static void chunk_set_palette_colors_new(UndoStream* stream, Sprite *sprite, Pal
|
||||
UndoChunkSetPaletteColors* chunk = (UndoChunkSetPaletteColors*)
|
||||
undo_chunk_new(stream,
|
||||
UNDO_TYPE_SET_PALETTE_COLORS,
|
||||
sizeof(UndoChunkSetPaletteColors) + sizeof(ase_uint32)*(to-from+1));
|
||||
sizeof(UndoChunkSetPaletteColors) + sizeof(uint32_t)*(to-from+1));
|
||||
|
||||
chunk->sprite_id = stream->getObjects()->addObject(sprite);
|
||||
chunk->frame = sprite->getCurrentFrame();
|
||||
@ -1528,8 +1528,8 @@ static void chunk_set_palette_colors_new(UndoStream* stream, Sprite *sprite, Pal
|
||||
chunk->to = to;
|
||||
|
||||
// Write (to-from+1) palette color entries
|
||||
ase_uint32 dword;
|
||||
ase_uint8* raw_data = chunk->data;
|
||||
uint32_t dword;
|
||||
uint8_t* raw_data = chunk->data;
|
||||
for (int i=from; i<=to; ++i)
|
||||
write_raw_uint32(palette->getEntry(i));
|
||||
}
|
||||
@ -1544,9 +1544,9 @@ static void chunk_set_palette_colors_invert(UndoStream* stream, UndoChunkSetPale
|
||||
// Add the chunk to invert the operation
|
||||
chunk_set_palette_colors_new(stream, sprite, palette, chunk->from, chunk->to);
|
||||
|
||||
ase_uint32 dword;
|
||||
ase_uint32 color;
|
||||
ase_uint8* raw_data = chunk->data;
|
||||
uint32_t dword;
|
||||
uint32_t color;
|
||||
uint8_t* raw_data = chunk->data;
|
||||
|
||||
for (int i=(int)chunk->from; i<=(int)chunk->to; ++i) {
|
||||
read_raw_uint32(color);
|
||||
@ -1569,9 +1569,9 @@ struct UndoChunkRemapPalette
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 frame_from;
|
||||
ase_uint32 frame_to;
|
||||
ase_uint8 mapping[256];
|
||||
uint32_t frame_from;
|
||||
uint32_t frame_to;
|
||||
uint8_t mapping[256];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_remap_palette(Sprite* sprite, int frame_from, int frame_to, const std::vector<int>& mapping)
|
||||
@ -1625,7 +1625,7 @@ struct UndoChunkSetMask
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId doc_id;
|
||||
ase_uint8 data[0];
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_mask(Document* document)
|
||||
@ -1672,7 +1672,7 @@ struct UndoChunkSetImgType
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 imgtype;
|
||||
uint32_t imgtype;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_imgtype(Sprite* sprite)
|
||||
@ -1716,8 +1716,8 @@ struct UndoChunkSetSize
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 width;
|
||||
ase_uint32 height;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_size(Sprite* sprite)
|
||||
@ -1761,7 +1761,7 @@ struct UndoChunkSetFrame
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 frame;
|
||||
uint32_t frame;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_frame(Sprite* sprite)
|
||||
@ -1804,7 +1804,7 @@ struct UndoChunkSetFrames
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 frames;
|
||||
uint32_t frames;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_frames(Sprite *sprite)
|
||||
@ -1848,8 +1848,8 @@ struct UndoChunkSetFrlen
|
||||
{
|
||||
UndoChunk head;
|
||||
ObjectId sprite_id;
|
||||
ase_uint32 frame;
|
||||
ase_uint32 duration;
|
||||
uint32_t frame;
|
||||
uint32_t duration;
|
||||
};
|
||||
|
||||
void UndoHistory::undo_set_frlen(Sprite *sprite, int frame)
|
||||
@ -1931,9 +1931,9 @@ static void undo_chunk_free(UndoChunk* chunk)
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
static Dirty *read_raw_dirty(ase_uint8* raw_data)
|
||||
static Dirty *read_raw_dirty(uint8_t* raw_data)
|
||||
{
|
||||
ase_uint16 word;
|
||||
uint16_t word;
|
||||
int x1, y1, x2, y2, size;
|
||||
int u, v, x, y, w;
|
||||
int imgtype;
|
||||
@ -1984,9 +1984,9 @@ static Dirty *read_raw_dirty(ase_uint8* raw_data)
|
||||
return dirty;
|
||||
}
|
||||
|
||||
static ase_uint8* write_raw_dirty(ase_uint8* raw_data, Dirty* dirty)
|
||||
static uint8_t* write_raw_dirty(uint8_t* raw_data, Dirty* dirty)
|
||||
{
|
||||
ase_uint16 word;
|
||||
uint16_t word;
|
||||
|
||||
write_raw_uint8(dirty->getImgType());
|
||||
write_raw_uint16(dirty->x1());
|
||||
@ -2046,15 +2046,15 @@ static int get_raw_dirty_size(Dirty* dirty)
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
static Image* read_raw_image(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
static Image* read_raw_image(ObjectsContainer* objects, uint8_t* raw_data)
|
||||
{
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
ObjectId image_id;
|
||||
int imgtype;
|
||||
int width;
|
||||
int height;
|
||||
ase_uint32 mask_color;
|
||||
uint32_t mask_color;
|
||||
Image* image;
|
||||
int c, size;
|
||||
|
||||
@ -2079,11 +2079,11 @@ static Image* read_raw_image(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
return image;
|
||||
}
|
||||
|
||||
static ase_uint8* write_raw_image(ObjectsContainer* objects, ase_uint8* raw_data, Image* image)
|
||||
static uint8_t* write_raw_image(ObjectsContainer* objects, uint8_t* raw_data, Image* image)
|
||||
{
|
||||
ObjectId image_id = objects->addObject(image);
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
int c, size;
|
||||
|
||||
write_raw_uint32(image_id); // ID
|
||||
@ -2118,10 +2118,10 @@ static int get_raw_image_size(Image* image)
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
static Cel* read_raw_cel(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
static Cel* read_raw_cel(ObjectsContainer* objects, uint8_t* raw_data)
|
||||
{
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
int frame, image, x, y, opacity;
|
||||
ObjectId cel_id;
|
||||
Cel* cel;
|
||||
@ -2141,11 +2141,11 @@ static Cel* read_raw_cel(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
return cel;
|
||||
}
|
||||
|
||||
static ase_uint8* write_raw_cel(ObjectsContainer* objects, ase_uint8* raw_data, Cel* cel)
|
||||
static uint8_t* write_raw_cel(ObjectsContainer* objects, uint8_t* raw_data, Cel* cel)
|
||||
{
|
||||
ObjectId cel_id = objects->addObject(cel);
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
|
||||
write_raw_uint32(cel_id);
|
||||
write_raw_uint16(cel->frame);
|
||||
@ -2169,10 +2169,10 @@ static int get_raw_cel_size(Cel* cel)
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
static Layer* read_raw_layer(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
static Layer* read_raw_layer(ObjectsContainer* objects, uint8_t* raw_data)
|
||||
{
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
ObjectId layer_id, sprite_id;
|
||||
std::vector<char> name(1);
|
||||
int name_length, flags, layer_type;
|
||||
@ -2209,7 +2209,7 @@ static Layer* read_raw_layer(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
/* read cels */
|
||||
for (c=0; c<cels; c++) {
|
||||
Cel* cel;
|
||||
ase_uint8 has_image;
|
||||
uint8_t has_image;
|
||||
|
||||
// Read the cel
|
||||
cel = read_raw_cel(objects, raw_data);
|
||||
@ -2263,11 +2263,11 @@ static Layer* read_raw_layer(ObjectsContainer* objects, ase_uint8* raw_data)
|
||||
return layer;
|
||||
}
|
||||
|
||||
static ase_uint8* write_raw_layer(ObjectsContainer* objects, ase_uint8* raw_data, Layer* layer)
|
||||
static uint8_t* write_raw_layer(ObjectsContainer* objects, uint8_t* raw_data, Layer* layer)
|
||||
{
|
||||
ObjectId layer_id = objects->addObject(layer);
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
std::string name = layer->getName();
|
||||
|
||||
write_raw_uint32(layer_id); // ID
|
||||
@ -2371,11 +2371,11 @@ static int get_raw_layer_size(Layer* layer)
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
static Palette* read_raw_palette(ase_uint8* raw_data)
|
||||
static Palette* read_raw_palette(uint8_t* raw_data)
|
||||
{
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
ase_uint32 color;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
uint32_t color;
|
||||
int frame, ncolors;
|
||||
Palette* palette;
|
||||
|
||||
@ -2394,11 +2394,11 @@ static Palette* read_raw_palette(ase_uint8* raw_data)
|
||||
return palette;
|
||||
}
|
||||
|
||||
static ase_uint8* write_raw_palette(ase_uint8* raw_data, Palette* palette)
|
||||
static uint8_t* write_raw_palette(uint8_t* raw_data, Palette* palette)
|
||||
{
|
||||
ase_uint32 dword;
|
||||
ase_uint16 word;
|
||||
ase_uint32 color;
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
uint32_t color;
|
||||
|
||||
write_raw_uint16(palette->getFrame()); // frame
|
||||
write_raw_uint16(palette->size()); // number of colors
|
||||
@ -2429,9 +2429,9 @@ static int get_raw_palette_size(Palette* palette)
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
static Mask* read_raw_mask(ase_uint8* raw_data)
|
||||
static Mask* read_raw_mask(uint8_t* raw_data)
|
||||
{
|
||||
ase_uint16 word;
|
||||
uint16_t word;
|
||||
int x, y, w, h;
|
||||
int c, size;
|
||||
Mask* mask;
|
||||
@ -2456,9 +2456,9 @@ static Mask* read_raw_mask(ase_uint8* raw_data)
|
||||
return mask;
|
||||
}
|
||||
|
||||
static ase_uint8* write_raw_mask(ase_uint8* raw_data, Mask* mask)
|
||||
static uint8_t* write_raw_mask(uint8_t* raw_data, Mask* mask)
|
||||
{
|
||||
ase_uint16 word;
|
||||
uint16_t word;
|
||||
int c, size = (mask->w+7)/8;
|
||||
|
||||
write_raw_uint16(mask->x); /* xpos */
|
||||
|
@ -958,7 +958,7 @@ void UndoTransaction::clearMask(int bgcolor)
|
||||
// clear the masked zones
|
||||
for (v=0; v<mask->h; v++) {
|
||||
div_t d = div(0, 8);
|
||||
ase_uint8* address = ((ase_uint8 **)mask->bitmap->line)[v]+d.quot;
|
||||
uint8_t* address = ((uint8_t**)mask->bitmap->line)[v]+d.quot;
|
||||
|
||||
for (u=0; u<mask->w; u++) {
|
||||
if ((*address & (1<<d.rem))) {
|
||||
|
@ -120,7 +120,7 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
gint x2,
|
||||
gint y2)
|
||||
{
|
||||
ase_uint8 *data;
|
||||
uint8_t* data;
|
||||
int x;
|
||||
int start, end;
|
||||
int val, last;
|
||||
@ -167,7 +167,7 @@ find_empty_segs (PixelRegion *maskPR,
|
||||
l_num_empty = *num_empty;
|
||||
|
||||
d = div (start, 8);
|
||||
data = ((ase_uint8 *)maskPR->line[scanline])+d.quot;
|
||||
data = ((uint8_t*)maskPR->line[scanline])+d.quot;
|
||||
|
||||
for (x = start; x < end;)
|
||||
{
|
||||
|
@ -26,9 +26,9 @@
|
||||
#define CF_DIBV5 17
|
||||
#endif
|
||||
|
||||
static ase_uint32 get_shift_from_mask(ase_uint32 mask)
|
||||
static uint32_t get_shift_from_mask(uint32_t mask)
|
||||
{
|
||||
ase_uint32 shift = 0;
|
||||
uint32_t shift = 0;
|
||||
for (shift=0; shift<32; ++shift)
|
||||
if (mask & (1 << shift))
|
||||
return shift;
|
||||
@ -66,17 +66,17 @@ static void set_win32_clipboard_bitmap(Image* image, Palette* palette)
|
||||
|
||||
switch (image->imgtype) {
|
||||
case IMAGE_RGB:
|
||||
scanline = sizeof(ase_uint32) * image->w;
|
||||
scanline = sizeof(uint32_t) * image->w;
|
||||
color_depth = 32;
|
||||
break;
|
||||
case IMAGE_GRAYSCALE:
|
||||
// this is right! Grayscaled is copied as RGBA in Win32 Clipboard
|
||||
scanline = sizeof(ase_uint32) * image->w;
|
||||
scanline = sizeof(uint32_t) * image->w;
|
||||
color_depth = 32;
|
||||
break;
|
||||
case IMAGE_INDEXED:
|
||||
padding = (4-(image->w&3))&3;
|
||||
scanline = sizeof(ase_uint8) * image->w;
|
||||
scanline = sizeof(uint8_t) * image->w;
|
||||
scanline += padding;
|
||||
color_depth = 8;
|
||||
palette_entries = palette->size();
|
||||
@ -109,8 +109,8 @@ static void set_win32_clipboard_bitmap(Image* image, Palette* palette)
|
||||
// write pixels
|
||||
switch (image->imgtype) {
|
||||
case IMAGE_RGB: {
|
||||
ase_uint32* dst = (ase_uint32*)(((ase_uint8*)bi)+bi->bV5Size);
|
||||
ase_uint32 c;
|
||||
uint32_t* dst = (uint32_t*)(((uint8_t*)bi)+bi->bV5Size);
|
||||
uint32_t c;
|
||||
for (int y=image->h-1; y>=0; --y)
|
||||
for (int x=0; x<image->w; ++x) {
|
||||
c = image_getpixel_fast<RgbTraits>(image, x, y);
|
||||
@ -122,8 +122,8 @@ static void set_win32_clipboard_bitmap(Image* image, Palette* palette)
|
||||
break;
|
||||
}
|
||||
case IMAGE_GRAYSCALE: {
|
||||
ase_uint32* dst = (ase_uint32*)(((ase_uint8*)bi)+bi->bV5Size);
|
||||
ase_uint16 c;
|
||||
uint32_t* dst = (uint32_t*)(((uint8_t*)bi)+bi->bV5Size);
|
||||
uint16_t c;
|
||||
for (int y=image->h-1; y>=0; --y)
|
||||
for (int x=0; x<image->w; ++x) {
|
||||
c = image_getpixel_fast<GrayscaleTraits>(image, x, y);
|
||||
@ -136,7 +136,7 @@ static void set_win32_clipboard_bitmap(Image* image, Palette* palette)
|
||||
}
|
||||
case IMAGE_INDEXED: {
|
||||
Palette* palette = get_current_palette();
|
||||
RGBQUAD* rgbquad = (RGBQUAD*)(((ase_uint8*)bi)+bi->bV5Size);
|
||||
RGBQUAD* rgbquad = (RGBQUAD*)(((uint8_t*)bi)+bi->bV5Size);
|
||||
for (int i=0; i<palette->size(); ++i) {
|
||||
rgbquad->rgbRed = _rgba_getr(palette->getEntry(i));
|
||||
rgbquad->rgbGreen = _rgba_getg(palette->getEntry(i));
|
||||
@ -144,7 +144,7 @@ static void set_win32_clipboard_bitmap(Image* image, Palette* palette)
|
||||
rgbquad++;
|
||||
}
|
||||
|
||||
ase_uint8* dst = (ase_uint8*)(((ase_uint8*)bi)+bi->bV5Size
|
||||
uint8_t* dst = (uint8_t*)(((uint8_t*)bi)+bi->bV5Size
|
||||
+ palette_entries*sizeof(RGBQUAD));
|
||||
for (int y=image->h-1; y>=0; --y) {
|
||||
for (int x=0; x<image->w; ++x) {
|
||||
@ -197,18 +197,18 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
|
||||
// 32 BPP
|
||||
case 32:
|
||||
if (bi->bmiHeader.biCompression == BI_BITFIELDS) {
|
||||
ase_uint32* src = (ase_uint32*)(((ase_uint8*)bi)+bi->bmiHeader.biSize+sizeof(RGBQUAD)*3);
|
||||
ase_uint32 c;
|
||||
uint32_t* src = (uint32_t*)(((uint8_t*)bi)+bi->bmiHeader.biSize+sizeof(RGBQUAD)*3);
|
||||
uint32_t c;
|
||||
|
||||
ase_uint32 r_mask = (ase_uint32)*((ase_uint32*)&bi->bmiColors[0]);
|
||||
ase_uint32 g_mask = (ase_uint32)*((ase_uint32*)&bi->bmiColors[1]);
|
||||
ase_uint32 b_mask = (ase_uint32)*((ase_uint32*)&bi->bmiColors[2]);
|
||||
ase_uint32 r_shift = get_shift_from_mask(r_mask);
|
||||
ase_uint32 g_shift = get_shift_from_mask(g_mask);
|
||||
ase_uint32 b_shift = get_shift_from_mask(b_mask);
|
||||
uint32_t r_mask = (uint32_t)*((uint32_t*)&bi->bmiColors[0]);
|
||||
uint32_t g_mask = (uint32_t)*((uint32_t*)&bi->bmiColors[1]);
|
||||
uint32_t b_mask = (uint32_t)*((uint32_t*)&bi->bmiColors[2]);
|
||||
uint32_t r_shift = get_shift_from_mask(r_mask);
|
||||
uint32_t g_shift = get_shift_from_mask(g_mask);
|
||||
uint32_t b_shift = get_shift_from_mask(b_mask);
|
||||
|
||||
for (int y=image->h-1; y>=0; --y) {
|
||||
ase_uint32* dst = (ase_uint32*)image->line[y];
|
||||
uint32_t* dst = (uint32_t*)image->line[y];
|
||||
|
||||
for (int x=0; x<image->w; ++x) {
|
||||
c = *(src++);
|
||||
@ -219,11 +219,11 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
|
||||
}
|
||||
}
|
||||
else if (bi->bmiHeader.biCompression == BI_RGB) {
|
||||
ase_uint32* src = (ase_uint32*)(((ase_uint8*)bi)+bi->bmiHeader.biSize);
|
||||
ase_uint32 c;
|
||||
uint32_t* src = (uint32_t*)(((uint8_t*)bi)+bi->bmiHeader.biSize);
|
||||
uint32_t c;
|
||||
|
||||
for (int y=image->h-1; y>=0; --y) {
|
||||
ase_uint32* dst = (ase_uint32*)image->line[y];
|
||||
uint32_t* dst = (uint32_t*)image->line[y];
|
||||
|
||||
for (int x=0; x<image->w; ++x) {
|
||||
c = *(src++);
|
||||
@ -239,12 +239,12 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
|
||||
|
||||
// 24 BPP
|
||||
case 24: {
|
||||
ase_uint8* src = (((ase_uint8*)bi)+bi->bmiHeader.biSize);
|
||||
ase_uint8 r, g, b;
|
||||
uint8_t* src = (((uint8_t*)bi)+bi->bmiHeader.biSize);
|
||||
uint8_t r, g, b;
|
||||
int padding = (4-((image->w*3)&3))&3;
|
||||
|
||||
for (int y=image->h-1; y>=0; --y) {
|
||||
ase_uint32* dst = (ase_uint32*)image->line[y];
|
||||
uint32_t* dst = (uint32_t*)image->line[y];
|
||||
|
||||
for (int x=0; x<image->w; ++x) {
|
||||
b = *(src++);
|
||||
@ -261,8 +261,8 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
|
||||
// 16 BPP
|
||||
case 16: {
|
||||
// TODO I am not sure if this really works
|
||||
ase_uint8* src = (((ase_uint8*)bi)+bi->bmiHeader.biSize);
|
||||
ase_uint8 b1, b2, r, g, b;
|
||||
uint8_t* src = (((uint8_t*)bi)+bi->bmiHeader.biSize);
|
||||
uint8_t b1, b2, r, g, b;
|
||||
int padding = (4-((image->w*2)&3))&3;
|
||||
|
||||
for (int y=image->h-1; y>=0; --y) {
|
||||
@ -290,7 +290,7 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette)
|
||||
bi->bmiColors[c].rgbBlue, 255));
|
||||
}
|
||||
|
||||
ase_uint8* src = (((ase_uint8*)bi)+bi->bmiHeader.biSize+sizeof(RGBQUAD)*colors);
|
||||
uint8_t* src = (((uint8_t*)bi)+bi->bmiHeader.biSize+sizeof(RGBQUAD)*colors);
|
||||
int padding = (4-(image->w&3))&3;
|
||||
|
||||
for (int y=image->h-1; y>=0; --y) {
|
||||
|
@ -110,7 +110,7 @@ bool save_col_file(const Palette *pal, const char *filename)
|
||||
fputw(PROCOL_MAGIC_NUMBER, f); /* file format identifier */
|
||||
fputw(0, f); /* version file */
|
||||
|
||||
ase_uint32 c;
|
||||
uint32_t c;
|
||||
for (int i=0; i<256; i++) {
|
||||
c = pal->getEntry(i);
|
||||
|
||||
|
@ -41,7 +41,7 @@ Image* NewImageFromMask(const Document* srcDocument)
|
||||
{
|
||||
const Sprite* srcSprite = srcDocument->getSprite();
|
||||
const Mask* srcMask = srcDocument->getMask();
|
||||
const ase_uint8* address;
|
||||
const uint8_t* address;
|
||||
int x, y, u, v, getx, gety;
|
||||
Image *dst;
|
||||
const Image *src = srcSprite->getCurrentImage(&x, &y);
|
||||
@ -62,7 +62,7 @@ Image* NewImageFromMask(const Document* srcDocument)
|
||||
// Copy the masked zones
|
||||
for (v=0; v<srcMask->h; v++) {
|
||||
d = div(0, 8);
|
||||
address = ((const ase_uint8 **)srcMask->bitmap->line)[v]+d.quot;
|
||||
address = ((const uint8_t**)srcMask->bitmap->line)[v]+d.quot;
|
||||
|
||||
for (u=0; u<srcMask->w; u++) {
|
||||
if ((*address & (1<<d.rem))) {
|
||||
|
@ -35,7 +35,7 @@ template<class DstTraits, class SrcTraits>
|
||||
class BlenderHelper
|
||||
{
|
||||
BLEND_COLOR m_blend_color;
|
||||
ase_uint32 m_mask_color;
|
||||
uint32_t m_mask_color;
|
||||
public:
|
||||
BlenderHelper(const Image* src, const Palette* pal, int blend_mode)
|
||||
{
|
||||
@ -58,7 +58,7 @@ template<>
|
||||
class BlenderHelper<RgbTraits, GrayscaleTraits>
|
||||
{
|
||||
BLEND_COLOR m_blend_color;
|
||||
ase_uint32 m_mask_color;
|
||||
uint32_t m_mask_color;
|
||||
public:
|
||||
BlenderHelper(const Image* src, const Palette* pal, int blend_mode)
|
||||
{
|
||||
@ -84,7 +84,7 @@ class BlenderHelper<RgbTraits, IndexedTraits>
|
||||
{
|
||||
const Palette* m_pal;
|
||||
int m_blend_mode;
|
||||
ase_uint32 m_mask_color;
|
||||
uint32_t m_mask_color;
|
||||
public:
|
||||
BlenderHelper(const Image* src, const Palette* pal, int blend_mode)
|
||||
{
|
||||
@ -376,7 +376,7 @@ Image* RenderEngine::renderSprite(const Document* document,
|
||||
void (*zoomed_func)(Image*, const Image*, const Palette*, int, int, int, int, int);
|
||||
const LayerImage* background = sprite->getBackgroundLayer();
|
||||
bool need_checked_bg = (background != NULL ? !background->is_readable(): true);
|
||||
ase_uint32 bg_color = 0;
|
||||
uint32_t bg_color = 0;
|
||||
Image *image;
|
||||
|
||||
switch (sprite->getImgType()) {
|
||||
|
@ -285,7 +285,7 @@ void Editor::editor_draw_cursor(int x, int y, bool refresh)
|
||||
->getToolSettings(current_tool);
|
||||
|
||||
int pen_color = get_pen_color(m_sprite);
|
||||
ase_uint32 new_mask_color;
|
||||
uint32_t new_mask_color;
|
||||
Pen* pen = editor_get_current_pen();
|
||||
|
||||
// Create the extra cel to show the pen preview
|
||||
|
@ -570,7 +570,7 @@ void Editor::flashCurrentLayer()
|
||||
for (u=0; u<flash_image->w; ++u) {
|
||||
if (u-x >= 0 && u-x < src_image->w &&
|
||||
v-y >= 0 && v-y < src_image->h) {
|
||||
ase_uint32 color = image_getpixel(src_image, u-x, v-y);
|
||||
uint32_t color = image_getpixel(src_image, u-x, v-y);
|
||||
if (color != src_image->mask_color) {
|
||||
Color ccc = Color::fromRgb(255, 255, 255);
|
||||
image_putpixel(flash_image, u, v,
|
||||
@ -755,7 +755,7 @@ void Editor::editor_update_statusbar_for_standby()
|
||||
// For eye-dropper
|
||||
else if (current_tool->getInk(0)->isEyedropper()) {
|
||||
int imgtype = m_sprite->getImgType();
|
||||
ase_uint32 pixel = m_sprite->getPixel(x, y);
|
||||
uint32_t pixel = m_sprite->getPixel(x, y);
|
||||
Color color = Color::fromImage(imgtype, pixel);
|
||||
|
||||
int alpha = 255;
|
||||
|
@ -199,7 +199,7 @@ public:
|
||||
return Rect(cel->x, cel->y, image->w, image->h);
|
||||
}
|
||||
|
||||
void setMaskColor(ase_uint32 mask_color)
|
||||
void setMaskColor(uint32_t mask_color)
|
||||
{
|
||||
{
|
||||
DocumentWriter documentWriter(m_documentReader);
|
||||
@ -273,7 +273,7 @@ Rect PixelsMovement::getImageBounds()
|
||||
return m_impl->getImageBounds();
|
||||
}
|
||||
|
||||
void PixelsMovement::setMaskColor(ase_uint32 mask_color)
|
||||
void PixelsMovement::setMaskColor(uint32_t mask_color)
|
||||
{
|
||||
m_impl->setMaskColor(mask_color);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
|
||||
gfx::Rect getImageBounds();
|
||||
|
||||
void setMaskColor(ase_uint32 mask_color);
|
||||
void setMaskColor(uint32_t mask_color);
|
||||
|
||||
private:
|
||||
class PixelsMovementImpl* m_impl;
|
||||
|
@ -129,8 +129,8 @@ void PaletteView::selectRange(int begin, int end, int range_type)
|
||||
|
||||
static void swap_color(Palette* palette, int i1, int i2)
|
||||
{
|
||||
ase_uint32 c1 = palette->getEntry(i1);
|
||||
ase_uint32 c2 = palette->getEntry(i2);
|
||||
uint32_t c1 = palette->getEntry(i1);
|
||||
uint32_t c2 = palette->getEntry(i2);
|
||||
|
||||
palette->setEntry(i2, c1);
|
||||
palette->setEntry(i1, c2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user