tesseract/src/ccstruct
Robin Watts 6bcb941bcf Avoid tesseract writing Pix out/reading them back.
By default, when we ImageData::SetPix, we write the data out as a
PNG, just to read it back in to get a compressed buffer of data.
We then use this to generate a new Pix.

In builds of Tesseract on systems where we don't have temp files,
writing files out is problematic.

Not only that, but compressing/uncompressing is slow, and on minimal
builds of leptonica, where we've disabled the format writers to reduce
memory footprint, we get no compression anyway.

In such cases, it'd be far nicer just to keep the original Pix as
the internal data.

Also, when recovering the pixmap from the ImageData, if we know we're
only going to read from the data, we can avoid duplicating it and
just use the original. This is exactly the case when GRAPHICS_DISABLED
is set.

So, introduce a TESSERACT_IMAGEDATA_AS_PIX predefine that we can use
to cause the internal data to be a Pix rather than a compressed
buffer.



Given we don't do compression, and they were writing to memory,
this was all just more effort than we needed.

Also, if we're using GRAPHICS_DISABLED, we might as well just
pixCopy rather than pixClone as only the scaler uses this.
2020-05-04 21:01:22 +01:00
..
blamer.cpp Remove redundant method from class GenericVector 2020-01-18 11:30:14 +01:00
blamer.h Remove redundant method from class GenericVector 2020-01-18 11:30:14 +01:00
blobbox.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
blobbox.h Fix CID 1164649 (Uninitialized scalar field) 2019-09-14 17:37:00 +02:00
blobs.cpp Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
blobs.h Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
blread.cpp Remove member functions STRING::string and StringParam::string 2019-09-23 08:33:08 +02:00
blread.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
boxread.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
boxread.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
boxword.cpp ccmain: Use C++-11 code instead of TessCallback1 2019-07-04 16:03:30 +02:00
boxword.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
ccstruct.cpp CCStruct: Define virtual destructor in .cpp file 2018-09-04 07:42:06 +02:00
ccstruct.h Remove cutil_class.* 2019-07-16 07:03:52 +02:00
coutln.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
coutln.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
crakedge.h Replace tabs by blanks in source code 2018-07-03 16:29:14 +02:00
debugpixa.h Fix line endings 2018-04-25 19:04:50 +02:00
detlinefit.cpp Replace MAX_FLOAT32 by standard FLT_MAX and remove unused MIN_FLOAT32 2018-07-02 13:29:39 +02:00
detlinefit.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
dppoint.cpp Replace ASSERT_HOST in genericvector.h 2018-06-20 22:32:17 +02:00
dppoint.h Modernize and format code 2019-04-03 21:02:23 +02:00
fontinfo.cpp Use C++-11 code instead of TessCallback for function set_compare_callback 2019-07-04 16:03:30 +02:00
fontinfo.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
imagedata.cpp Avoid tesseract writing Pix out/reading them back. 2020-05-04 21:01:22 +01:00
imagedata.h Avoid tesseract writing Pix out/reading them back. 2020-05-04 21:01:22 +01:00
linlsq.cpp Fix warnings from LGTM 2019-08-30 22:04:24 +02:00
linlsq.h Clean more include files and include statements 2018-06-24 19:45:12 +02:00
matrix.cpp Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
matrix.h Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
mod128.cpp Add missing static attributes 2019-05-26 08:53:09 +02:00
mod128.h Modernize code by replacing C type casts 2019-04-07 09:04:51 +02:00
normalis.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
normalis.h Fix some typos in comments (most of them found by codespell) 2019-12-02 14:30:13 +01:00
ocrblock.cpp Remove member functions STRING::string and StringParam::string 2019-09-23 08:33:08 +02:00
ocrblock.h Remove member functions STRING::string and StringParam::string 2019-09-23 08:33:08 +02:00
ocrpara.cpp Remove member functions STRING::string and StringParam::string 2019-09-23 08:33:08 +02:00
ocrpara.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
ocrrow.cpp ccstruct: Replace BOOL8, TRUE, FALSE by bool, true, false and modernize code 2019-03-31 17:53:06 +02:00
ocrrow.h Modernize code by replacing C type casts 2019-04-07 09:04:51 +02:00
otsuthr.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
otsuthr.h Fix line endings 2018-04-25 19:04:50 +02:00
pageres.cpp Remove redundant method from class GenericVector 2020-01-18 11:30:14 +01:00
pageres.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
params_training_featdef.cpp Replace string.h by standard C++ cstring 2018-06-21 20:40:26 +02:00
params_training_featdef.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
pdblock.cpp Fix compiler warnings 2019-05-19 22:10:22 +02:00
pdblock.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
points.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
points.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
polyaprx.cpp Remove vecfuncs.cpp and vecfunc.h 2019-09-25 21:20:03 +02:00
polyaprx.h Add missing include statements and clean some include statements 2018-07-07 16:24:53 +02:00
polyblk.cpp Remove unneeded compare statement (-Wtautological-unsigned-enum-zero-compare) 2019-09-29 22:13:27 +02:00
polyblk.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
quadlsq.cpp quadlsq: Fix warnings from LGTM 2019-10-18 12:07:54 +02:00
quadlsq.h Replace tabs by blanks in source code 2018-07-03 16:29:14 +02:00
quadratc.h Modernize code by replacing C type casts 2019-04-07 09:04:51 +02:00
quspline.cpp Modernize code by replacing C type casts 2019-04-07 09:04:51 +02:00
quspline.h Add missing include statements and clean some include statements 2018-07-07 16:24:53 +02:00
ratngs.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
ratngs.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
rect.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
rect.h Update includes to use <>. 2019-10-29 14:50:11 +03:00
rejctmap.cpp Remove BOOL8, TRUE, FALSE from host.h 2019-03-31 18:27:20 +02:00
rejctmap.h Clean usage of assert.h 2018-06-21 19:31:05 +02:00
seam.cpp Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
seam.h Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
split.cpp Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
split.h Remove Emacs C modeline in comment line 1 2019-12-05 13:57:50 +01:00
statistc.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
statistc.h Fix CID 1164638 (Uninitialized scalar field) 2019-09-14 17:18:15 +02:00
stepblob.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
stepblob.h Modernize C++ code using auto 2019-03-26 07:55:08 +01:00
werd.cpp Update includes to use <>. 2019-10-29 14:50:11 +03:00
werd.h Update includes to use <>. 2019-10-29 14:50:11 +03:00